FOSSology
4.4.0
Open Source License Compliance by Open Source Software
FolderTest.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\Folder
;
16
21
class
FolderTest
extends
\PHPUnit\Framework\TestCase
22
{
27
public
function
testDataFormat
()
28
{
29
$expectedParent = [
30
'id'
=> 2,
31
'name'
=>
'parent'
,
32
'description'
=>
'Root folder'
,
33
'parent'
=> null
34
];
35
$expectedChild = [
36
'id'
=> 3,
37
'name'
=>
'folder-1'
,
38
'description'
=>
'Folder 1'
,
39
'parent'
=> 2
40
];
41
42
$parentFolder =
new
Folder
(
'2'
,
'parent'
,
'Root folder'
,
null
);
43
$childFolder =
new
Folder
(
'3'
,
'folder-1'
,
'Folder 1'
,
'2'
);
44
45
$this->assertEquals($expectedParent, $parentFolder->getArray());
46
$this->assertEquals($expectedChild, $childFolder->getArray());
47
}
48
}
Fossology\UI\Api\Models\Folder
Definition:
Folder.php:15
Fossology\UI\Api\Test\Models\FolderTest
Tests for Folder model.
Definition:
FolderTest.php:22
Fossology\UI\Api\Test\Models\FolderTest\testDataFormat
testDataFormat()
Definition:
FolderTest.php:27
Fossology\UI\Api\Test\Models
src
www
ui_tests
api
Models
FolderTest.php
Generated on Mon Nov 18 2024 07:37:13 for FOSSology by
1.9.1