FOSSology  4.4.0
Open Source License Compliance by Open Source Software
SearchResultTest.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2020 Siemens AG
4  Author: Gaurav Mishra <mishra.gaurav@siemens.com>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
14 
18 
23 class SearchResultTest extends \PHPUnit\Framework\TestCase
24 {
29  public function testDataFormat()
30  {
31  $hash = new Hash('sha1checksum', 'md5checksum', 'sha256checksum', 123123);
32  $upload = new Upload(2, 'root', 3, '', 'my.tar.gz', '01-01-2020', null,
33  $hash);
34  $expectedResult = [
35  'upload' => $upload->getArray(),
36  'uploadTreeId' => 12,
37  'filename' => 'fileinupload.txt'
38  ];
39 
40  $actualResult = new SearchResult($upload->getArray(), '12',
41  'fileinupload.txt');
42 
43  $this->assertEquals($expectedResult, $actualResult->getArray());
44  }
45 }
Hash model holding information about file like checksums and size.
Definition: Hash.php:18
Model to hold search results.
Model class to hold Upload info.
Definition: Upload.php:17