FOSSology
4.5.1
Open Source License Compliance by Open Source Software
ObligationTest.php
Go to the documentation of this file.
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2021 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\Obligation
;
16
use PHPUnit\Framework\TestCase;
17
22
class
ObligationTest
extends
TestCase
23
{
25
31
public
function
testConstructor
()
32
{
33
$obligation =
new
Obligation
(
"123"
,
'My obligation'
,
'Obligation'
,
34
'This should represent some valid obligation text.'
,
'yellow'
);
35
$this->assertInstanceOf(Obligation::class, $obligation);
36
}
37
42
public
function
testDataFormat
()
43
{
44
$expectedObligation = [
45
'id'
=> 123,
46
'topic'
=>
'My obligation'
,
47
'type'
=>
'Obligation'
,
48
'text'
=>
'This should represent some valid obligation text.'
,
49
'classification'
=>
'yellow'
,
50
'comment'
=>
""
51
];
52
53
$actualObligation =
new
Obligation
(
"123"
,
'My obligation'
,
'Obligation'
,
54
'This should represent some valid obligation text.'
,
'yellow'
);
55
56
$this->assertEquals($expectedObligation, $actualObligation->getArray());
57
}
58
}
Fossology\UI\Api\Models\Obligation
Definition:
Obligation.php:20
Fossology\UI\Api\Test\Models\ObligationTest
Test for Obligation model.
Definition:
ObligationTest.php:23
Fossology\UI\Api\Test\Models\ObligationTest\testConstructor
testConstructor()
Definition:
ObligationTest.php:31
Fossology\UI\Api\Test\Models\ObligationTest\testDataFormat
testDataFormat()
Definition:
ObligationTest.php:42
Fossology\UI\Api\Test\Models
Definition:
AdminAcknowledgementTest.php:11
src
www
ui_tests
api
Models
ObligationTest.php
Generated on Thu Jun 5 2025 06:51:44 for FOSSology by
1.9.1