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

Public Member Functions

 testInit ()
 
 testAuthenticate ()
 testInit More...
 
 testAuthenticateFail ()
 testInit Sabre More...
 
 testAuthenticateFailDontAutoRequire ()
 testAuthenticateFail More...
 
 testMultipleBackend ()
 testAuthenticate More...
 
 testNoAuthBackend ()
 testInit Sabre More...
 
 testInvalidCheckResponse ()
 testInit Sabre More...
 
 testGetCurrentPrincipal ()
 testAuthenticate More...
 

Detailed Description

Definition at line 8 of file PluginTest.php.

Member Function Documentation

◆ testAuthenticate()

Sabre\DAV\Auth\PluginTest::testAuthenticate ( )

testInit

Definition at line 24 of file PluginTest.php.

24  {
25 
26  $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
27  $plugin = new Plugin(new Backend\Mock());
28  $fakeServer->addPlugin($plugin);
29  $this->assertTrue(
30  $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()])
31  );
32 
33  }

◆ testAuthenticateFail()

Sabre\DAV\Auth\PluginTest::testAuthenticateFail ( )

testInit Sabre

Definition at line 39 of file PluginTest.php.

39  {
40 
41  $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
42  $backend = new Backend\Mock();
43  $backend->fail = true;
44 
45  $plugin = new Plugin($backend);
46  $fakeServer->addPlugin($plugin);
47  $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]);
48 
49  }

◆ testAuthenticateFailDontAutoRequire()

Sabre\DAV\Auth\PluginTest::testAuthenticateFailDontAutoRequire ( )

testAuthenticateFail

Definition at line 54 of file PluginTest.php.

54  {
55 
56  $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
57  $backend = new Backend\Mock();
58  $backend->fail = true;
59 
60  $plugin = new Plugin($backend);
61  $plugin->autoRequireLogin = false;
62  $fakeServer->addPlugin($plugin);
63  $this->assertTrue(
64  $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()])
65  );
66  $this->assertEquals(1, count($plugin->getLoginFailedReasons()));
67 
68  }

◆ testGetCurrentPrincipal()

Sabre\DAV\Auth\PluginTest::testGetCurrentPrincipal ( )

testAuthenticate

Definition at line 123 of file PluginTest.php.

123  {
124 
125  $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
126  $plugin = new Plugin(new Backend\Mock());
127  $fakeServer->addPlugin($plugin);
128  $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]);
129  $this->assertEquals('principals/admin', $plugin->getCurrentPrincipal());
130 
131  }

◆ testInit()

Sabre\DAV\Auth\PluginTest::testInit ( )

Definition at line 10 of file PluginTest.php.

10  {
11 
12  $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
13  $plugin = new Plugin(new Backend\Mock());
14  $this->assertTrue($plugin instanceof Plugin);
15  $fakeServer->addPlugin($plugin);
16  $this->assertEquals($plugin, $fakeServer->getPlugin('auth'));
17  $this->assertInternalType('array', $plugin->getPluginInfo());
18 
19  }

◆ testInvalidCheckResponse()

Sabre\DAV\Auth\PluginTest::testInvalidCheckResponse ( )

testInit Sabre

Definition at line 108 of file PluginTest.php.

108  {
109 
110  $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
111  $backend = new Backend\Mock();
112  $backend->invalidCheckResponse = true;
113 
114  $plugin = new Plugin($backend);
115  $fakeServer->addPlugin($plugin);
116  $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]);
117 
118  }

◆ testMultipleBackend()

Sabre\DAV\Auth\PluginTest::testMultipleBackend ( )

testAuthenticate

Definition at line 73 of file PluginTest.php.

73  {
74 
75  $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
76  $backend1 = new Backend\Mock();
77  $backend2 = new Backend\Mock();
78  $backend2->fail = true;
79 
80  $plugin = new Plugin();
81  $plugin->addBackend($backend1);
82  $plugin->addBackend($backend2);
83 
84  $fakeServer->addPlugin($plugin);
85  $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]);
86 
87  $this->assertEquals('principals/admin', $plugin->getCurrentPrincipal());
88 
89  }

◆ testNoAuthBackend()

Sabre\DAV\Auth\PluginTest::testNoAuthBackend ( )

testInit Sabre

Definition at line 95 of file PluginTest.php.

95  {
96 
97  $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla'));
98 
99  $plugin = new Plugin();
100  $fakeServer->addPlugin($plugin);
101  $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]);
102 
103  }

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