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

Public Member Functions

 setUp ()
 
 testGet ()
 
 testGetDoesntExist ()
 
 testHEAD ()
 
 testOPTIONS ()
 
 testPUT ()
 
 testPROPPATCH ()
 
 testCOPY ()
 
 testMOVE ()
 
 testLOCK ()
 
 testBeforeBind ()
 
 testBeforeUnbind ()
 

Protected Attributes

 $server
 

Detailed Description

Definition at line 7 of file AllowAccessTest.php.

Member Function Documentation

◆ setUp()

Sabre\DAVACL\AllowAccessTest::setUp ( )

Definition at line 14 of file AllowAccessTest.php.

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

References $aclPlugin, and $nodes.

◆ testBeforeBind()

Sabre\DAVACL\AllowAccessTest::testBeforeBind ( )

Definition at line 119 of file AllowAccessTest.php.

119 {
120
121 $this->assertTrue($this->server->emit('beforeBind', ['testdir/file']));
122
123 }

◆ testBeforeUnbind()

Sabre\DAVACL\AllowAccessTest::testBeforeUnbind ( )

Definition at line 126 of file AllowAccessTest.php.

126 {
127
128 $this->assertTrue($this->server->emit('beforeUnbind', ['testdir']));
129
130 }

◆ testCOPY()

Sabre\DAVACL\AllowAccessTest::testCOPY ( )

Definition at line 92 of file AllowAccessTest.php.

92 {
93
94 $this->server->httpRequest->setMethod('COPY');
95 $this->server->httpRequest->setUrl('/testdir');
96
97 $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]));
98
99 }

◆ testGet()

Sabre\DAVACL\AllowAccessTest::testGet ( )

Definition at line 38 of file AllowAccessTest.php.

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

◆ testGetDoesntExist()

Sabre\DAVACL\AllowAccessTest::testGetDoesntExist ( )

Definition at line 47 of file AllowAccessTest.php.

47 {
48
49 $this->server->httpRequest->setMethod('GET');
50 $this->server->httpRequest->setUrl('/foo');
51
52 $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]));
53
54 }

◆ testHEAD()

Sabre\DAVACL\AllowAccessTest::testHEAD ( )

Definition at line 56 of file AllowAccessTest.php.

56 {
57
58 $this->server->httpRequest->setMethod('HEAD');
59 $this->server->httpRequest->setUrl('/testdir');
60
61 $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]));
62
63 }

◆ testLOCK()

Sabre\DAVACL\AllowAccessTest::testLOCK ( )

Definition at line 110 of file AllowAccessTest.php.

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

◆ testMOVE()

Sabre\DAVACL\AllowAccessTest::testMOVE ( )

Definition at line 101 of file AllowAccessTest.php.

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

◆ testOPTIONS()

Sabre\DAVACL\AllowAccessTest::testOPTIONS ( )

Definition at line 65 of file AllowAccessTest.php.

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

◆ testPROPPATCH()

Sabre\DAVACL\AllowAccessTest::testPROPPATCH ( )

Definition at line 83 of file AllowAccessTest.php.

83 {
84
85 $this->server->httpRequest->setMethod('PROPPATCH');
86 $this->server->httpRequest->setUrl('/testdir');
87
88 $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]));
89
90 }

◆ testPUT()

Sabre\DAVACL\AllowAccessTest::testPUT ( )

Definition at line 74 of file AllowAccessTest.php.

74 {
75
76 $this->server->httpRequest->setMethod('PUT');
77 $this->server->httpRequest->setUrl('/testdir/file1.txt');
78
79 $this->assertTrue($this->server->emit('beforeMethod', [$this->server->httpRequest, $this->server->httpResponse]));
80
81 }

Field Documentation

◆ $server

Sabre\DAVACL\AllowAccessTest::$server
protected

Definition at line 12 of file AllowAccessTest.php.


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