Definition at line 7 of file ObjectTreeTest.php.
◆ setup()
Sabre\DAV\ObjectTreeTest::setup |
( |
| ) |
|
Definition at line 11 of file ObjectTreeTest.php.
References Sabre\TestUtil\clearTempDir().
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);
static clearTempDir()
This function deletes all the contents of the temporary directory.
◆ teardown()
Sabre\DAV\ObjectTreeTest::teardown |
( |
| ) |
|
◆ testCopyDirectory()
Sabre\DAV\ObjectTreeTest::testCopyDirectory |
( |
| ) |
|
testCopyFile
Definition at line 54 of file ObjectTreeTest.php.
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'));
◆ testCopyFile()
Sabre\DAV\ObjectTreeTest::testCopyFile |
( |
| ) |
|
Definition at line 43 of file ObjectTreeTest.php.
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'));
◆ testGetRootNode()
Sabre\DAV\ObjectTreeTest::testGetRootNode |
( |
| ) |
|
Definition at line 29 of file ObjectTreeTest.php.
References $root.
31 $root = $this->tree->getNodeForPath(
'');
32 $this->assertInstanceOf(
'Sabre\\DAV\\FSExt\\Directory',
$root);
◆ testGetSubDir()
Sabre\DAV\ObjectTreeTest::testGetSubDir |
( |
| ) |
|
Definition at line 36 of file ObjectTreeTest.php.
References $root.
38 $root = $this->tree->getNodeForPath(
'subdir');
39 $this->assertInstanceOf(
'Sabre\\DAV\\FSExt\\Directory',
$root);
◆ testMoveDirectory()
Sabre\DAV\ObjectTreeTest::testMoveDirectory |
( |
| ) |
|
testCopyDirectory
Definition at line 90 of file ObjectTreeTest.php.
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'));
◆ testMoveFile()
Sabre\DAV\ObjectTreeTest::testMoveFile |
( |
| ) |
|
testCopyFile
Definition at line 66 of file ObjectTreeTest.php.
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'));
◆ testMoveFileNewParent()
Sabre\DAV\ObjectTreeTest::testMoveFileNewParent |
( |
| ) |
|
testMoveFile
Definition at line 78 of file ObjectTreeTest.php.
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'));
◆ $tree
Sabre\DAV\ObjectTreeTest::$tree |
|
protected |
The documentation for this class was generated from the following file: