From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- .../sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php | 68 ++++++++++------------ 1 file changed, 31 insertions(+), 37 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php index 743446127..03c8a4624 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/PluginTest.php @@ -1,58 +1,57 @@ assertTrue($plugin instanceof Plugin); $fakeServer->addPlugin($plugin); $this->assertEquals($plugin, $fakeServer->getPlugin('auth')); $this->assertInternalType('array', $plugin->getPluginInfo()); - } /** * @depends testInit */ - function testAuthenticate() { - + public function testAuthenticate() + { $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $plugin = new Plugin(new Backend\Mock()); $fakeServer->addPlugin($plugin); $this->assertTrue( - $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]) + $fakeServer->emit('beforeMethod:GET', [new HTTP\Request('GET', '/'), new HTTP\Response()]) ); - } /** * @depends testInit - * @expectedException Sabre\DAV\Exception\NotAuthenticated + * @expectedException \Sabre\DAV\Exception\NotAuthenticated */ - function testAuthenticateFail() { - + public function testAuthenticateFail() + { $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $backend = new Backend\Mock(); $backend->fail = true; $plugin = new Plugin($backend); $fakeServer->addPlugin($plugin); - $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]); - + $fakeServer->emit('beforeMethod:GET', [new HTTP\Request('GET', '/'), new HTTP\Response()]); } /** * @depends testAuthenticateFail */ - function testAuthenticateFailDontAutoRequire() { - + public function testAuthenticateFailDontAutoRequire() + { $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $backend = new Backend\Mock(); $backend->fail = true; @@ -61,17 +60,16 @@ class PluginTest extends \PHPUnit_Framework_TestCase { $plugin->autoRequireLogin = false; $fakeServer->addPlugin($plugin); $this->assertTrue( - $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]) + $fakeServer->emit('beforeMethod:GET', [new HTTP\Request('GET', '/'), new HTTP\Response()]) ); $this->assertEquals(1, count($plugin->getLoginFailedReasons())); - } /** * @depends testAuthenticate */ - function testMultipleBackend() { - + public function testMultipleBackend() + { $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $backend1 = new Backend\Mock(); $backend2 = new Backend\Mock(); @@ -82,52 +80,48 @@ class PluginTest extends \PHPUnit_Framework_TestCase { $plugin->addBackend($backend2); $fakeServer->addPlugin($plugin); - $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]); + $fakeServer->emit('beforeMethod:GET', [new HTTP\Request('GET', '/'), new HTTP\Response()]); $this->assertEquals('principals/admin', $plugin->getCurrentPrincipal()); - } /** * @depends testInit - * @expectedException Sabre\DAV\Exception + * @expectedException \Sabre\DAV\Exception */ - function testNoAuthBackend() { - + public function testNoAuthBackend() + { $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $plugin = new Plugin(); $fakeServer->addPlugin($plugin); - $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]); - + $fakeServer->emit('beforeMethod:GET', [new HTTP\Request('GET', '/'), new HTTP\Response()]); } + /** * @depends testInit - * @expectedException Sabre\DAV\Exception + * @expectedException \Sabre\DAV\Exception */ - function testInvalidCheckResponse() { - + public function testInvalidCheckResponse() + { $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $backend = new Backend\Mock(); $backend->invalidCheckResponse = true; $plugin = new Plugin($backend); $fakeServer->addPlugin($plugin); - $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]); - + $fakeServer->emit('beforeMethod:GET', [new HTTP\Request('GET', '/'), new HTTP\Response()]); } /** * @depends testAuthenticate */ - function testGetCurrentPrincipal() { - + public function testGetCurrentPrincipal() + { $fakeServer = new DAV\Server(new DAV\SimpleCollection('bla')); $plugin = new Plugin(new Backend\Mock()); $fakeServer->addPlugin($plugin); - $fakeServer->emit('beforeMethod', [new HTTP\Request(), new HTTP\Response()]); + $fakeServer->emit('beforeMethod:GET', [new HTTP\Request('GET', '/'), new HTTP\Response()]); $this->assertEquals('principals/admin', $plugin->getCurrentPrincipal()); - } - } -- cgit v1.2.3