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());
27 $plugin =
new Plugin(
new Backend\Mock());
28 $fakeServer->addPlugin($plugin);
30 $fakeServer->emit(
'beforeMethod', [
new HTTP\
Request(),
new HTTP\
Response()])
43 $backend->fail =
true;
45 $plugin =
new Plugin($backend);
46 $fakeServer->addPlugin($plugin);
47 $fakeServer->emit(
'beforeMethod', [
new HTTP\
Request(),
new HTTP\
Response()]);
58 $backend->fail =
true;
60 $plugin =
new Plugin($backend);
61 $plugin->autoRequireLogin =
false;
62 $fakeServer->addPlugin($plugin);
64 $fakeServer->emit(
'beforeMethod', [
new HTTP\
Request(),
new HTTP\
Response()])
66 $this->assertEquals(1, count($plugin->getLoginFailedReasons()));
78 $backend2->fail =
true;
81 $plugin->addBackend($backend1);
82 $plugin->addBackend($backend2);
84 $fakeServer->addPlugin($plugin);
85 $fakeServer->emit(
'beforeMethod', [
new HTTP\
Request(),
new HTTP\
Response()]);
87 $this->assertEquals(
'principals/admin', $plugin->getCurrentPrincipal());
100 $fakeServer->addPlugin($plugin);
101 $fakeServer->emit(
'beforeMethod', [
new HTTP\
Request(),
new HTTP\
Response()]);
112 $backend->invalidCheckResponse =
true;
114 $plugin =
new Plugin($backend);
115 $fakeServer->addPlugin($plugin);
116 $fakeServer->emit(
'beforeMethod', [
new HTTP\
Request(),
new HTTP\
Response()]);
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());
An exception for terminatinating execution or to throw for unit testing.
testAuthenticateFail()
@depends testInit @expectedException Sabre\DAV\Exception\NotAuthenticated
testAuthenticate()
@depends testInit
testMultipleBackend()
@depends testAuthenticate
testInvalidCheckResponse()
@depends testInit @expectedException Sabre\DAV\Exception
testNoAuthBackend()
@depends testInit @expectedException Sabre\DAV\Exception
testGetCurrentPrincipal()
@depends testAuthenticate
testAuthenticateFailDontAutoRequire()
@depends testAuthenticateFail
This plugin provides Authentication for a WebDAV server.
The Request class represents a single HTTP request.
This class represents a single HTTP response.