diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php index 3ed79a7da..b566dd757 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php @@ -49,6 +49,25 @@ class PluginTest extends \PHPUnit_Framework_TestCase { } /** + * @depends testAuthenticateFail + */ + function testAuthenticateFailDontAutoRequire() { + + $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); + $backend = new Backend\Mock(); + $backend->fail = true; + + $plugin = new Plugin($backend); + $plugin->autoRequireLogin = false; + $fakeServer->addPlugin($plugin); + $this->assertTrue( + $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]) + ); + $this->assertEquals(1, count($plugin->getLoginFailedReasons())); + + } + + /** * @depends testAuthenticate */ function testMultipleBackend() { |