FOSSology
4.4.0
Open Source License Compliance by Open Source Software
InfoTest.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\Info
;
16
use
Fossology\UI\Api\Models\InfoType
;
17
22
class
InfoTest
extends
\PHPUnit\Framework\TestCase
23
{
28
public
function
testDataFormat
()
29
{
30
$expectedInfo = [
31
'code'
=> 200,
32
'message'
=>
"All good"
,
33
'type'
=>
"INFO"
34
];
35
$expectedError = [
36
'code'
=> 500,
37
'message'
=>
"Something bad"
,
38
'type'
=>
"ERROR"
39
];
40
41
$actualInfo =
new
Info
(200,
"All good"
, InfoType::INFO);
42
$actualError =
new
Info
(500,
"Something bad"
, InfoType::ERROR);
43
44
$this->assertEquals($expectedInfo, $actualInfo->getArray());
45
$this->assertEquals($expectedError, $actualError->getArray());
46
}
47
}
Fossology\UI\Api\Models\InfoType
Different type of infos provided by REST.
Definition:
InfoType.php:16
Fossology\UI\Api\Models\Info
Info model to contain general error and return values.
Definition:
Info.php:19
Fossology\UI\Api\Test\Models\InfoTest
Tests for Info model.
Definition:
InfoTest.php:23
Fossology\UI\Api\Test\Models\InfoTest\testDataFormat
testDataFormat()
Definition:
InfoTest.php:28
Fossology\UI\Api\Test\Models
src
www
ui_tests
api
Models
InfoTest.php
Generated on Mon Nov 18 2024 07:37:14 for FOSSology by
1.9.1