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

Public Member Functions

 setUp ()
 
 testGet ()
 Sabre More...
 
 testGetDoesntExist ()
 
 testHEAD ()
 Sabre More...
 
 testOPTIONS ()
 Sabre More...
 
 testPUT ()
 Sabre More...
 
 testPROPPATCH ()
 Sabre More...
 
 testCOPY ()
 Sabre More...
 
 testMOVE ()
 Sabre More...
 
 testACL ()
 Sabre More...
 
 testLOCK ()
 Sabre More...
 
 testBeforeBind ()
 Sabre More...
 
 testBeforeUnbind ()
 Sabre More...
 
 testPropFind ()
 
 testBeforeGetPropertiesNoListing ()
 

Protected Attributes

 $server
 
 $plugin
 

Detailed Description

Definition at line 7 of file BlockAccessTest.php.

Member Function Documentation

◆ setUp()

Sabre\DAVACL\BlockAccessTest::setUp ( )

Definition at line 15 of file BlockAccessTest.php.

References $nodes.

15  {
16 
17  $nodes = [
18  new DAV\SimpleCollection('testdir'),
19  ];
20 
21  $this->server = new DAV\Server($nodes);
22  $this->plugin = new Plugin();
23  $this->plugin->setDefaultAcl([]);
24  $this->server->addPlugin(
25  new DAV\Auth\Plugin(
26  new DAV\Auth\Backend\Mock()
27  )
28  );
29  // Login
30  $this->server->getPlugin('auth')->beforeMethod(
31  new \Sabre\HTTP\Request(),
32  new \Sabre\HTTP\Response()
33  );
34  $this->server->addPlugin($this->plugin);
35 
36  }

◆ testACL()

Sabre\DAVACL\BlockAccessTest::testACL ( )

Sabre

Definition at line 135 of file BlockAccessTest.php.

135  {
136 
137  $this->server->httpRequest->setMethod('ACL');
138  $this->server->httpRequest->setUrl('/testdir');
139 
140  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
141 
142  }

◆ testBeforeBind()

Sabre\DAVACL\BlockAccessTest::testBeforeBind ( )

Sabre

Definition at line 159 of file BlockAccessTest.php.

159  {
160 
161  $this->server->emit('beforeBind', ['testdir/file']);
162 
163  }

◆ testBeforeGetPropertiesNoListing()

Sabre\DAVACL\BlockAccessTest::testBeforeGetPropertiesNoListing ( )

Definition at line 201 of file BlockAccessTest.php.

References $r.

201  {
202 
203  $this->plugin->hideNodesFromListings = true;
204  $propFind = new DAV\PropFind('testdir', [
205  '{DAV:}displayname',
206  '{DAV:}getcontentlength',
207  '{DAV:}bar',
208  '{DAV:}owner',
209  ]);
210 
211  $r = $this->server->emit('propFind', [$propFind, new DAV\SimpleCollection('testdir')]);
212  $this->assertFalse($r);
213 
214  }
$r
Definition: example_031.php:79

◆ testBeforeUnbind()

Sabre\DAVACL\BlockAccessTest::testBeforeUnbind ( )

Sabre

Definition at line 168 of file BlockAccessTest.php.

168  {
169 
170  $this->server->emit('beforeUnbind', ['testdir']);
171 
172  }

◆ testCOPY()

Sabre\DAVACL\BlockAccessTest::testCOPY ( )

Sabre

Definition at line 111 of file BlockAccessTest.php.

111  {
112 
113  $this->server->httpRequest->setMethod('COPY');
114  $this->server->httpRequest->setUrl('/testdir');
115 
116  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
117 
118  }

◆ testGet()

Sabre\DAVACL\BlockAccessTest::testGet ( )

Sabre

Definition at line 41 of file BlockAccessTest.php.

41  {
42 
43  $this->server->httpRequest->setMethod('GET');
44  $this->server->httpRequest->setUrl('/testdir');
45 
46  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
47 
48  }

◆ testGetDoesntExist()

Sabre\DAVACL\BlockAccessTest::testGetDoesntExist ( )

Definition at line 50 of file BlockAccessTest.php.

References $r.

50  {
51 
52  $this->server->httpRequest->setMethod('GET');
53  $this->server->httpRequest->setUrl('/foo');
54 
55  $r = $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
56  $this->assertTrue($r);
57 
58  }
$r
Definition: example_031.php:79

◆ testHEAD()

Sabre\DAVACL\BlockAccessTest::testHEAD ( )

Sabre

Definition at line 63 of file BlockAccessTest.php.

63  {
64 
65  $this->server->httpRequest->setMethod('HEAD');
66  $this->server->httpRequest->setUrl('/testdir');
67 
68  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
69 
70  }

◆ testLOCK()

Sabre\DAVACL\BlockAccessTest::testLOCK ( )

Sabre

Definition at line 147 of file BlockAccessTest.php.

147  {
148 
149  $this->server->httpRequest->setMethod('LOCK');
150  $this->server->httpRequest->setUrl('/testdir');
151 
152  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
153 
154  }

◆ testMOVE()

Sabre\DAVACL\BlockAccessTest::testMOVE ( )

Sabre

Definition at line 123 of file BlockAccessTest.php.

123  {
124 
125  $this->server->httpRequest->setMethod('MOVE');
126  $this->server->httpRequest->setUrl('/testdir');
127 
128  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
129 
130  }

◆ testOPTIONS()

Sabre\DAVACL\BlockAccessTest::testOPTIONS ( )

Sabre

Definition at line 75 of file BlockAccessTest.php.

75  {
76 
77  $this->server->httpRequest->setMethod('OPTIONS');
78  $this->server->httpRequest->setUrl('/testdir');
79 
80  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
81 
82  }

◆ testPropFind()

Sabre\DAVACL\BlockAccessTest::testPropFind ( )

Definition at line 174 of file BlockAccessTest.php.

References $r.

174  {
175 
176  $propFind = new DAV\PropFind('testdir', [
177  '{DAV:}displayname',
178  '{DAV:}getcontentlength',
179  '{DAV:}bar',
180  '{DAV:}owner',
181  ]);
182 
183  $r = $this->server->emit('propFind', [$propFind, new DAV\SimpleCollection('testdir')]);
184  $this->assertTrue($r);
185 
186  $expected = [
187  200 => [],
188  404 => [],
189  403 => [
190  '{DAV:}displayname' => null,
191  '{DAV:}getcontentlength' => null,
192  '{DAV:}bar' => null,
193  '{DAV:}owner' => null,
194  ],
195  ];
196 
197  $this->assertEquals($expected, $propFind->getResultForMultiStatus());
198 
199  }
$r
Definition: example_031.php:79

◆ testPROPPATCH()

Sabre\DAVACL\BlockAccessTest::testPROPPATCH ( )

Sabre

Definition at line 99 of file BlockAccessTest.php.

99  {
100 
101  $this->server->httpRequest->setMethod('PROPPATCH');
102  $this->server->httpRequest->setUrl('/testdir');
103 
104  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
105 
106  }

◆ testPUT()

Sabre\DAVACL\BlockAccessTest::testPUT ( )

Sabre

Definition at line 87 of file BlockAccessTest.php.

87  {
88 
89  $this->server->httpRequest->setMethod('PUT');
90  $this->server->httpRequest->setUrl('/testdir');
91 
92  $this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]);
93 
94  }

Field Documentation

◆ $plugin

Sabre\DAVACL\BlockAccessTest::$plugin
protected

Definition at line 13 of file BlockAccessTest.php.

◆ $server

Sabre\DAVACL\BlockAccessTest::$server
protected

Definition at line 12 of file BlockAccessTest.php.


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