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 */
14 
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 }