diff --git a/module/VuFind/tests/unit-tests/src/Auth/MultiAuthTest.php b/module/VuFind/tests/unit-tests/src/Auth/MultiAuthTest.php index 4cc23b562c3b5db0b93c439d49856f54a4af5cb2..7b2c176c07cf4a92a60b13e061e899e0d358c665 100644 --- a/module/VuFind/tests/unit-tests/src/Auth/MultiAuthTest.php +++ b/module/VuFind/tests/unit-tests/src/Auth/MultiAuthTest.php @@ -109,10 +109,26 @@ class MultiAuthTest extends \VuFindTest\Unit\DbTestCase return $request; } + /** + * Test login with handler configured to load a service which does not exist. + * + * @return void + */ + public function testLoginWithBadService() + { + $this + ->setExpectedException('Zend\ServiceManager\Exception\ServiceNotFoundException'); + $config = $this->getAuthConfig(); + $config->MultiAuth->method_order = 'InappropriateService,Database'; + + $request = $this->getLoginRequest(); + $this->getAuthObject($config)->authenticate($request); + } + /** * Test login with handler configured to load a class which does not conform - * to the appropriate authentication interface. (We'll use \VuFind\Cart as an - * arbitrary inappropriate class). + * to the appropriate authentication interface. (We'll use this test class + * as an arbitrary inappropriate class). * * @return void */ @@ -121,7 +137,7 @@ class MultiAuthTest extends \VuFindTest\Unit\DbTestCase $this ->setExpectedException('Zend\ServiceManager\Exception\RuntimeException'); $config = $this->getAuthConfig(); - $config->MultiAuth->method_order = 'VuFind\Cart,Database'; + $config->MultiAuth->method_order = get_class($this) . ',Database'; $request = $this->getLoginRequest(); $this->getAuthObject($config)->authenticate($request);