FOSSology
4.4.0
Open Source License Compliance by Open Source Software
GroupTest.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
14
use
Fossology\UI\Api\Models\Group
;
15
use PHPUnit\Framework\TestCase;
16
17
class
GroupTest
extends
TestCase
18
{
26
private
function
getGroupInfo
()
27
{
28
$expectedArray = [
29
"id"
=> 4,
30
"name"
=>
"fossy"
,
31
];
32
$obj =
new
Group
(4,
"fossy"
);
33
return
[
34
'expectedArray'
=> $expectedArray,
35
'obj'
=> $obj
36
];
37
}
38
44
public
function
testDataFormat
()
45
{
46
$expectedArray = $this->
getGroupInfo
()[
'expectedArray'
];
47
$group = $this->
getGroupInfo
()[
'obj'
];
48
$this->assertEquals($expectedArray, $group->getArray());
49
}
50
56
public
function
testGetId
()
57
{
58
$group =
new
Group
(4,
"fossy"
);
59
$this->assertEquals(4, $group->getId());
60
}
61
67
public
function
testSetId
()
68
{
69
$group =
new
Group
(4,
"fossy"
);
70
$group->setId(10);
71
$this->assertEquals(10, $group->getId());
72
}
73
79
public
function
testGetName
()
80
{
81
$group =
new
Group
(4,
"fossy"
);
82
$this->assertEquals(
"fossy"
, $group->getName());
83
}
84
90
public
function
testSetName
()
91
{
92
$group =
new
Group
(4,
"fossy"
);
93
$group->setName(
"newName"
);
94
$this->assertEquals(
"newName"
, $group->getName());
95
}
96
}
Fossology\UI\Api\Models\Group
Definition:
Group.php:16
Fossology\UI\Api\Test\Models\GroupTest
Definition:
GroupTest.php:18
Fossology\UI\Api\Test\Models\GroupTest\getGroupInfo
getGroupInfo()
Definition:
GroupTest.php:26
Fossology\UI\Api\Test\Models\GroupTest\testGetName
testGetName()
Definition:
GroupTest.php:79
Fossology\UI\Api\Test\Models\GroupTest\testDataFormat
testDataFormat()
Definition:
GroupTest.php:44
Fossology\UI\Api\Test\Models\GroupTest\testGetId
testGetId()
Definition:
GroupTest.php:56
Fossology\UI\Api\Test\Models\GroupTest\testSetId
testSetId()
Definition:
GroupTest.php:67
Fossology\UI\Api\Test\Models\GroupTest\testSetName
testSetName()
Definition:
GroupTest.php:90
Fossology\UI\Api\Test\Models
src
www
ui_tests
api
Models
GroupTest.php
Generated on Fri Jan 10 2025 11:26:03 for FOSSology by
1.9.1