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
*/
13
namespace
Fossology\UI\Api\Test\Models
;
14
15
use
Fossology\UI\Api\Models\Upload
;
16
use
Fossology\UI\Api\Models\SearchResult
;
17
use
Fossology\UI\Api\Models\Hash
;
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
}
Fossology\UI\Api\Models\Hash
Hash model holding information about file like checksums and size.
Definition:
Hash.php:18
Fossology\UI\Api\Models\SearchResult
Model to hold search results.
Definition:
SearchResult.php:19
Fossology\UI\Api\Models\Upload
Model class to hold Upload info.
Definition:
Upload.php:17
Fossology\UI\Api\Test\Models\SearchResultTest
Test for SearchResult model.
Definition:
SearchResultTest.php:24
Fossology\UI\Api\Test\Models\SearchResultTest\testDataFormat
testDataFormat()
Definition:
SearchResultTest.php:29
Fossology\UI\Api\Test\Models
src
www
ui_tests
api
Models
SearchResultTest.php
Generated on Mon Nov 18 2024 07:37:14 for FOSSology by
1.9.1