ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAV\TreeTest Class Reference
+ Inheritance diagram for Sabre\DAV\TreeTest:
+ Collaboration diagram for Sabre\DAV\TreeTest:

Public Member Functions

 testNodeExists ()
 
 testCopy ()
 
 testMove ()
 
 testDeepMove ()
 
 testDelete ()
 
 testGetChildren ()
 
 testGetMultipleNodes ()
 
 testGetMultipleNodes2 ()
 

Detailed Description

Definition at line 5 of file TreeTest.php.

Member Function Documentation

◆ testCopy()

Sabre\DAV\TreeTest::testCopy ( )

Definition at line 16 of file TreeTest.php.

References $tree.

16  {
17 
18  $tree = new TreeMock();
19  $tree->copy('hi', 'hi2');
20 
21  $this->assertArrayHasKey('hi2', $tree->getNodeForPath('')->newDirectories);
22  $this->assertEquals('foobar', $tree->getNodeForPath('hi/file')->get());
23  $this->assertEquals(['test1' => 'value'], $tree->getNodeForPath('hi/file')->getProperties([]));
24 
25  }

◆ testDeepMove()

Sabre\DAV\TreeTest::testDeepMove ( )

Definition at line 37 of file TreeTest.php.

References $tree.

37  {
38 
39  $tree = new TreeMock();
40  $tree->move('hi/sub', 'hi2');
41 
42  $this->assertArrayHasKey('hi2', $tree->getNodeForPath('')->newDirectories);
43  $this->assertTrue($tree->getNodeForPath('hi/sub')->isDeleted);
44 
45  }

◆ testDelete()

Sabre\DAV\TreeTest::testDelete ( )

Definition at line 47 of file TreeTest.php.

References $tree.

47  {
48 
49  $tree = new TreeMock();
50  $tree->delete('hi');
51  $this->assertTrue($tree->getNodeForPath('hi')->isDeleted);
52 
53  }

◆ testGetChildren()

Sabre\DAV\TreeTest::testGetChildren ( )

Definition at line 55 of file TreeTest.php.

References $tree.

55  {
56 
57  $tree = new TreeMock();
58  $children = $tree->getChildren('');
59  $this->assertEquals(2, count($children));
60  $this->assertEquals('hi', $children[0]->getName());
61 
62  }

◆ testGetMultipleNodes()

Sabre\DAV\TreeTest::testGetMultipleNodes ( )

Definition at line 64 of file TreeTest.php.

References $result, and $tree.

64  {
65 
66  $tree = new TreeMock();
67  $result = $tree->getMultipleNodes(['hi/sub', 'hi/file']);
68  $this->assertArrayHasKey('hi/sub', $result);
69  $this->assertArrayHasKey('hi/file', $result);
70 
71  $this->assertEquals('sub', $result['hi/sub']->getName());
72  $this->assertEquals('file', $result['hi/file']->getName());
73 
74  }
$result

◆ testGetMultipleNodes2()

Sabre\DAV\TreeTest::testGetMultipleNodes2 ( )

Definition at line 75 of file TreeTest.php.

References $result, and $tree.

75  {
76 
77  $tree = new TreeMock();
78  $result = $tree->getMultipleNodes(['multi/1', 'multi/2']);
79  $this->assertArrayHasKey('multi/1', $result);
80  $this->assertArrayHasKey('multi/2', $result);
81 
82  }
$result

◆ testMove()

Sabre\DAV\TreeTest::testMove ( )

Definition at line 27 of file TreeTest.php.

References $tree.

27  {
28 
29  $tree = new TreeMock();
30  $tree->move('hi', 'hi2');
31 
32  $this->assertEquals('hi2', $tree->getNodeForPath('hi')->getName());
33  $this->assertTrue($tree->getNodeForPath('hi')->isRenamed);
34 
35  }

◆ testNodeExists()

Sabre\DAV\TreeTest::testNodeExists ( )

Definition at line 7 of file TreeTest.php.

References $tree.

7  {
8 
9  $tree = new TreeMock();
10 
11  $this->assertTrue($tree->nodeExists('hi'));
12  $this->assertFalse($tree->nodeExists('hello'));
13 
14  }

The documentation for this class was generated from the following file: