From e43748e6cb454b92f8206ec14938ffae4c0174d9 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Fri, 4 Jan 2013 08:29:46 -0500
Subject: [PATCH] Removed arbitrary VuFind\Cart reference in MultiAuthTest to
 prevent confusion; added test involving bad service name.

---
 .../unit-tests/src/Auth/MultiAuthTest.php     | 22 ++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/module/VuFind/tests/unit-tests/src/Auth/MultiAuthTest.php b/module/VuFind/tests/unit-tests/src/Auth/MultiAuthTest.php
index 4cc23b562c3..7b2c176c07c 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);
-- 
GitLab