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

Public Member Functions

 testPut ()
 @expectedException Sabre\DAV\Exception\Forbidden More...
 
 testGet ()
 @expectedException Sabre\DAV\Exception\Forbidden More...
 
 testGetSize ()
 
 testGetETag ()
 
 testGetContentType ()
 
 testDelete ()
 @expectedException Sabre\DAV\Exception\Forbidden More...
 
 testSetName ()
 @expectedException Sabre\DAV\Exception\Forbidden More...
 
 testGetLastModified ()
 
 testGetChild ()
 
 testChildExists ()
 
 testChildExistsFalse ()
 
 testGetChild404 ()
 @expectedException Sabre\DAV\Exception\NotFound More...
 
 testCreateFile ()
 @expectedException Sabre\DAV\Exception\Forbidden More...
 
 testCreateDirectory ()
 @expectedException Sabre\DAV\Exception\Forbidden More...
 
 testSimpleDirectoryConstruct ()
 
 testSimpleDirectoryConstructChild ()
 @depends testSimpleDirectoryConstruct More...
 
 testSimpleDirectoryBadParam ()
 @expectedException Sabre\DAV\Exception @depends testSimpleDirectoryConstruct More...
 
 testSimpleDirectoryAddChild ()
 @depends testSimpleDirectoryConstruct More...
 
 testSimpleDirectoryGetChildren ()
 @depends testSimpleDirectoryConstruct @depends testSimpleDirectoryAddChild More...
 
 testSimpleDirectoryGetName ()
 
 testSimpleDirectoryGetChild404 ()
 @depends testSimpleDirectoryConstruct @expectedException Sabre\DAV\Exception\NotFound More...
 

Detailed Description

Definition at line 5 of file BasicNodeTest.php.

Member Function Documentation

◆ testChildExists()

Sabre\DAV\BasicNodeTest::testChildExists ( )

Definition at line 87 of file BasicNodeTest.php.

87 {
88
89 $dir = new DirectoryMock();
90 $this->assertTrue($dir->childExists('mockfile'));
91
92 }

◆ testChildExistsFalse()

Sabre\DAV\BasicNodeTest::testChildExistsFalse ( )

Definition at line 94 of file BasicNodeTest.php.

94 {
95
96 $dir = new DirectoryMock();
97 $this->assertFalse($dir->childExists('mockfile2'));
98
99 }

◆ testCreateDirectory()

Sabre\DAV\BasicNodeTest::testCreateDirectory ( )

@expectedException Sabre\DAV\Exception\Forbidden

Definition at line 124 of file BasicNodeTest.php.

124 {
125
126 $dir = new DirectoryMock();
127 $dir->createDirectory('hello');
128
129 }

◆ testCreateFile()

Sabre\DAV\BasicNodeTest::testCreateFile ( )

@expectedException Sabre\DAV\Exception\Forbidden

Definition at line 114 of file BasicNodeTest.php.

114 {
115
116 $dir = new DirectoryMock();
117 $dir->createFile('hello', 'data');
118
119 }

◆ testDelete()

Sabre\DAV\BasicNodeTest::testDelete ( )

@expectedException Sabre\DAV\Exception\Forbidden

Definition at line 52 of file BasicNodeTest.php.

52 {
53
54 $file = new FileMock();
55 $file->delete();
56
57 }

◆ testGet()

Sabre\DAV\BasicNodeTest::testGet ( )

@expectedException Sabre\DAV\Exception\Forbidden

Definition at line 20 of file BasicNodeTest.php.

20 {
21
22 $file = new FileMock();
23 $file->get();
24
25 }

◆ testGetChild()

Sabre\DAV\BasicNodeTest::testGetChild ( )

Definition at line 79 of file BasicNodeTest.php.

79 {
80
81 $dir = new DirectoryMock();
82 $file = $dir->getChild('mockfile');
83 $this->assertTrue($file instanceof FileMock);
84
85 }

◆ testGetChild404()

Sabre\DAV\BasicNodeTest::testGetChild404 ( )

@expectedException Sabre\DAV\Exception\NotFound

Definition at line 104 of file BasicNodeTest.php.

104 {
105
106 $dir = new DirectoryMock();
107 $file = $dir->getChild('blabla');
108
109 }

◆ testGetContentType()

Sabre\DAV\BasicNodeTest::testGetContentType ( )

Definition at line 42 of file BasicNodeTest.php.

42 {
43
44 $file = new FileMock();
45 $this->assertNull($file->getContentType());
46
47 }

◆ testGetETag()

Sabre\DAV\BasicNodeTest::testGetETag ( )

Definition at line 35 of file BasicNodeTest.php.

35 {
36
37 $file = new FileMock();
38 $this->assertNull($file->getETag());
39
40 }

◆ testGetLastModified()

Sabre\DAV\BasicNodeTest::testGetLastModified ( )

Definition at line 69 of file BasicNodeTest.php.

69 {
70
71 $file = new FileMock();
72 // checking if lastmod is within the range of a few seconds
73 $lastMod = $file->getLastModified();
74 $compareTime = ($lastMod + 1) - time();
75 $this->assertTrue($compareTime < 3);
76
77 }

◆ testGetSize()

Sabre\DAV\BasicNodeTest::testGetSize ( )

Definition at line 27 of file BasicNodeTest.php.

27 {
28
29 $file = new FileMock();
30 $this->assertEquals(0, $file->getSize());
31
32 }

◆ testPut()

Sabre\DAV\BasicNodeTest::testPut ( )

@expectedException Sabre\DAV\Exception\Forbidden

Definition at line 10 of file BasicNodeTest.php.

10 {
11
12 $file = new FileMock();
13 $file->put('hi');
14
15 }

◆ testSetName()

Sabre\DAV\BasicNodeTest::testSetName ( )

@expectedException Sabre\DAV\Exception\Forbidden

Definition at line 62 of file BasicNodeTest.php.

62 {
63
64 $file = new FileMock();
65 $file->setName('hi');
66
67 }

◆ testSimpleDirectoryAddChild()

Sabre\DAV\BasicNodeTest::testSimpleDirectoryAddChild ( )

@depends testSimpleDirectoryConstruct

Definition at line 164 of file BasicNodeTest.php.

164 {
165
166 $file = new FileMock();
167 $dir = new SimpleCollection('simpledir');
168 $dir->addChild($file);
169 $file2 = $dir->getChild('mockfile');
170
171 $this->assertEquals($file, $file2);
172
173 }

◆ testSimpleDirectoryBadParam()

Sabre\DAV\BasicNodeTest::testSimpleDirectoryBadParam ( )

@expectedException Sabre\DAV\Exception @depends testSimpleDirectoryConstruct

Definition at line 155 of file BasicNodeTest.php.

155 {
156
157 $dir = new SimpleCollection('simpledir', ['string shouldn\'t be here']);
158
159 }

◆ testSimpleDirectoryConstruct()

Sabre\DAV\BasicNodeTest::testSimpleDirectoryConstruct ( )

Definition at line 131 of file BasicNodeTest.php.

131 {
132
133 $dir = new SimpleCollection('simpledir', []);
134 $this->assertInstanceOf('Sabre\DAV\SimpleCollection', $dir);
135
136 }

◆ testSimpleDirectoryConstructChild()

Sabre\DAV\BasicNodeTest::testSimpleDirectoryConstructChild ( )

@depends testSimpleDirectoryConstruct

Definition at line 141 of file BasicNodeTest.php.

141 {
142
143 $file = new FileMock();
144 $dir = new SimpleCollection('simpledir', [$file]);
145 $file2 = $dir->getChild('mockfile');
146
147 $this->assertEquals($file, $file2);
148
149 }

◆ testSimpleDirectoryGetChild404()

Sabre\DAV\BasicNodeTest::testSimpleDirectoryGetChild404 ( )

@depends testSimpleDirectoryConstruct @expectedException Sabre\DAV\Exception\NotFound

Definition at line 203 of file BasicNodeTest.php.

203 {
204
205 $dir = new SimpleCollection('simpledir');
206 $dir->getChild('blabla');
207
208 }

◆ testSimpleDirectoryGetChildren()

Sabre\DAV\BasicNodeTest::testSimpleDirectoryGetChildren ( )

@depends testSimpleDirectoryConstruct @depends testSimpleDirectoryAddChild

Definition at line 179 of file BasicNodeTest.php.

179 {
180
181 $file = new FileMock();
182 $dir = new SimpleCollection('simpledir');
183 $dir->addChild($file);
184
185 $this->assertEquals([$file], $dir->getChildren());
186
187 }

◆ testSimpleDirectoryGetName()

Sabre\DAV\BasicNodeTest::testSimpleDirectoryGetName ( )

Definition at line 192 of file BasicNodeTest.php.

192 {
193
194 $dir = new SimpleCollection('simpledir');
195 $this->assertEquals('simpledir', $dir->getName());
196
197 }

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