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

Public Member Functions

 setup ()
 
 teardown ()
 
 testGetRootNode ()
 
 testGetSubDir ()
 
 testCopyFile ()
 
 testCopyDirectory ()
 @depends testCopyFile More...
 
 testMoveFile ()
 @depends testCopyFile More...
 
 testMoveFileNewParent ()
 @depends testMoveFile More...
 
 testMoveDirectory ()
 @depends testCopyDirectory More...
 

Protected Attributes

 $tree
 

Detailed Description

Definition at line 7 of file ObjectTreeTest.php.

Member Function Documentation

◆ setup()

Sabre\DAV\ObjectTreeTest::setup ( )

Definition at line 11 of file ObjectTreeTest.php.

11 {
12
14 mkdir(SABRE_TEMPDIR . '/root');
15 mkdir(SABRE_TEMPDIR . '/root/subdir');
16 file_put_contents(SABRE_TEMPDIR . '/root/file.txt', 'contents');
17 file_put_contents(SABRE_TEMPDIR . '/root/subdir/subfile.txt', 'subcontents');
18 $rootNode = new FSExt\Directory(SABRE_TEMPDIR . '/root');
19 $this->tree = new Tree($rootNode);
20
21 }
static clearTempDir()
This function deletes all the contents of the temporary directory.
Definition: TestUtil.php:12

References Sabre\TestUtil\clearTempDir().

+ Here is the call graph for this function:

◆ teardown()

Sabre\DAV\ObjectTreeTest::teardown ( )

Definition at line 23 of file ObjectTreeTest.php.

23 {
24
26
27 }

References Sabre\TestUtil\clearTempDir().

+ Here is the call graph for this function:

◆ testCopyDirectory()

Sabre\DAV\ObjectTreeTest::testCopyDirectory ( )

@depends testCopyFile

Definition at line 54 of file ObjectTreeTest.php.

54 {
55
56 $this->tree->copy('subdir', 'subdir2');
57 $this->assertTrue(file_exists(SABRE_TEMPDIR . '/root/subdir2'));
58 $this->assertTrue(file_exists(SABRE_TEMPDIR . '/root/subdir2/subfile.txt'));
59 $this->assertEquals('subcontents', file_get_contents(SABRE_TEMPDIR . '/root/subdir2/subfile.txt'));
60
61 }

◆ testCopyFile()

Sabre\DAV\ObjectTreeTest::testCopyFile ( )

Definition at line 43 of file ObjectTreeTest.php.

43 {
44
45 $this->tree->copy('file.txt', 'file2.txt');
46 $this->assertTrue(file_exists(SABRE_TEMPDIR . '/root/file2.txt'));
47 $this->assertEquals('contents', file_get_contents(SABRE_TEMPDIR . '/root/file2.txt'));
48
49 }

◆ testGetRootNode()

Sabre\DAV\ObjectTreeTest::testGetRootNode ( )

Definition at line 29 of file ObjectTreeTest.php.

29 {
30
31 $root = $this->tree->getNodeForPath('');
32 $this->assertInstanceOf('Sabre\\DAV\\FSExt\\Directory', $root);
33
34 }
$root
Definition: sabredav.php:45

References $root.

◆ testGetSubDir()

Sabre\DAV\ObjectTreeTest::testGetSubDir ( )

Definition at line 36 of file ObjectTreeTest.php.

36 {
37
38 $root = $this->tree->getNodeForPath('subdir');
39 $this->assertInstanceOf('Sabre\\DAV\\FSExt\\Directory', $root);
40
41 }

References $root.

◆ testMoveDirectory()

Sabre\DAV\ObjectTreeTest::testMoveDirectory ( )

@depends testCopyDirectory

Definition at line 90 of file ObjectTreeTest.php.

90 {
91
92 $this->tree->move('subdir', 'subdir2');
93 $this->assertTrue(file_exists(SABRE_TEMPDIR . '/root/subdir2'));
94 $this->assertTrue(file_exists(SABRE_TEMPDIR . '/root/subdir2/subfile.txt'));
95 $this->assertFalse(file_exists(SABRE_TEMPDIR . '/root/subdir'));
96 $this->assertEquals('subcontents', file_get_contents(SABRE_TEMPDIR . '/root/subdir2/subfile.txt'));
97
98 }

◆ testMoveFile()

Sabre\DAV\ObjectTreeTest::testMoveFile ( )

@depends testCopyFile

Definition at line 66 of file ObjectTreeTest.php.

66 {
67
68 $this->tree->move('file.txt', 'file2.txt');
69 $this->assertTrue(file_exists(SABRE_TEMPDIR . '/root/file2.txt'));
70 $this->assertFalse(file_exists(SABRE_TEMPDIR . '/root/file.txt'));
71 $this->assertEquals('contents', file_get_contents(SABRE_TEMPDIR . '/root/file2.txt'));
72
73 }

◆ testMoveFileNewParent()

Sabre\DAV\ObjectTreeTest::testMoveFileNewParent ( )

@depends testMoveFile

Definition at line 78 of file ObjectTreeTest.php.

78 {
79
80 $this->tree->move('file.txt', 'subdir/file2.txt');
81 $this->assertTrue(file_exists(SABRE_TEMPDIR . '/root/subdir/file2.txt'));
82 $this->assertFalse(file_exists(SABRE_TEMPDIR . '/root/file.txt'));
83 $this->assertEquals('contents', file_get_contents(SABRE_TEMPDIR . '/root/subdir/file2.txt'));
84
85 }

Field Documentation

◆ $tree

Sabre\DAV\ObjectTreeTest::$tree
protected

Definition at line 9 of file ObjectTreeTest.php.


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