ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CollectionTest.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAVACL\FS;
4
5class CollectionTest extends FileTest {
6
7 function setUp() {
8
9 $this->path = SABRE_TEMPDIR;
10 $this->sut = new Collection($this->path, $this->acl, $this->owner);
11
12 }
13
14 function tearDown() {
15
17
18 }
19
20 function testGetChildFile() {
21
22 file_put_contents(SABRE_TEMPDIR . '/file.txt', 'hello');
23 $child = $this->sut->getChild('file.txt');
24 $this->assertInstanceOf('Sabre\\DAVACL\\FS\\File', $child);
25
26 $this->assertEquals('file.txt', $child->getName());
27 $this->assertEquals($this->acl, $child->getACL());
28 $this->assertEquals($this->owner, $child->getOwner());
29
30 }
31
33
34 mkdir(SABRE_TEMPDIR . '/dir');
35 $child = $this->sut->getChild('dir');
36 $this->assertInstanceOf('Sabre\\DAVACL\\FS\\Collection', $child);
37
38 $this->assertEquals('dir', $child->getName());
39 $this->assertEquals($this->acl, $child->getACL());
40 $this->assertEquals($this->owner, $child->getOwner());
41
42 }
43
44}
An exception for terminatinating execution or to throw for unit testing.
This is an ACL-enabled collection.
Definition: Collection.php:18
static clearTempDir()
This function deletes all the contents of the temporary directory.
Definition: TestUtil.php:12