FOSSology
4.4.0
Open Source License Compliance by Open Source Software
ScanCodeTest.php
Go to the documentation of this file.
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2024 Valens Niyonsenga <valensniyonsenga2003@gmail.com>
4
SPDX-License-Identifier: GPL-2.0-only
5
*/
6
11
namespace
Fossology\UI\Api\Test\Models
;
12
13
use
Fossology\UI\Api\Models\Scancode
;
14
use Monolog\Test\TestCase;
15
16
class
ScanCodeTest
extends
TestCase
17
{
25
private
function
getScanCodeInfo
()
26
{
27
$expectedArray = [
28
"license"
=>
false
,
29
"copyright"
=>
false
,
30
"email"
=>
false
,
31
"url"
=> false
32
];
33
$obj =
new
Scancode
();
34
return
[
35
'expectedArray'
=> $expectedArray,
36
'obj'
=> $obj
37
];
38
}
39
45
public
function
testDataFormat
()
46
{
47
$expectedArray = $this->
getScanCodeInfo
()[
'expectedArray'
];
48
$scanCode = $this->
getScanCodeInfo
()[
'obj'
];
49
$this->assertEquals($expectedArray, $scanCode->getArray());
50
}
51
58
public
function
testSetAndGetLicense
()
59
{
60
$info = $this->
getScanCodeInfo
();
61
$obj = $info[
'obj'
];
62
$obj->setScanLicense(
true
);
63
$this->assertTrue($obj->getScanLicense());
64
}
65
72
public
function
testSetAndGetCopyright
()
73
{
74
$info = $this->
getScanCodeInfo
();
75
$obj = $info[
'obj'
];
76
$obj->setScanCopyright(
true
);
77
$this->assertTrue($obj->getScanCopyright());
78
}
79
86
public
function
testSetAndGetEmail
()
87
{
88
$info = $this->
getScanCodeInfo
();
89
$obj = $info[
'obj'
];
90
$obj->setScanEmail(
true
);
91
$this->assertTrue($obj->getScanEmail());
92
}
93
100
public
function
testSetAndGetUrl
()
101
{
102
$info = $this->
getScanCodeInfo
();
103
$obj = $info[
'obj'
];
104
$obj->setScanUrl(
true
);
105
$this->assertTrue($obj->getScanUrl());
106
}
107
}
Fossology\UI\Api\Models\Scancode
Scancode model.
Definition:
Scancode.php:19
Fossology\UI\Api\Test\Models\ScanCodeTest
Definition:
ScanCodeTest.php:17
Fossology\UI\Api\Test\Models\ScanCodeTest\testSetAndGetEmail
testSetAndGetEmail()
Definition:
ScanCodeTest.php:86
Fossology\UI\Api\Test\Models\ScanCodeTest\testDataFormat
testDataFormat()
Definition:
ScanCodeTest.php:45
Fossology\UI\Api\Test\Models\ScanCodeTest\testSetAndGetCopyright
testSetAndGetCopyright()
Definition:
ScanCodeTest.php:72
Fossology\UI\Api\Test\Models\ScanCodeTest\testSetAndGetUrl
testSetAndGetUrl()
Definition:
ScanCodeTest.php:100
Fossology\UI\Api\Test\Models\ScanCodeTest\getScanCodeInfo
getScanCodeInfo()
Definition:
ScanCodeTest.php:25
Fossology\UI\Api\Test\Models\ScanCodeTest\testSetAndGetLicense
testSetAndGetLicense()
Definition:
ScanCodeTest.php:58
Fossology\UI\Api\Test\Models
src
www
ui_tests
api
Models
ScanCodeTest.php
Generated on Fri Jan 10 2025 11:26:03 for FOSSology by
1.9.1