Skip to content
Snippets Groups Projects
Commit 4c7db9ed authored by Demian Katz's avatar Demian Katz
Browse files

Merge pull request #298 from EreMaijala/multibackend

Changed MultiBackend supportsMethod() logic a bit so that if a source ca...
parents cac7c090 86a7b823
No related merge requests found
...@@ -1173,7 +1173,10 @@ class MultiBackend extends AbstractBase ...@@ -1173,7 +1173,10 @@ class MultiBackend extends AbstractBase
$source = $this->defaultDriver; $source = $this->defaultDriver;
} }
if (!$source) { if (!$source) {
return false; // If we can't determine the source, assume we are capable to handle
// the request. This might happen e.g. when the user hasn't yet done
// a catalog login.
return true;
} }
$driver = $this->getDriver($source); $driver = $this->getDriver($source);
......
...@@ -2228,11 +2228,11 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase ...@@ -2228,11 +2228,11 @@ class MultiBackendTest extends \VuFindTest\Unit\TestCase
$methodReturn = $driver->supportsMethod('getStatus', $patron); $methodReturn = $driver->supportsMethod('getStatus', $patron);
$this->assertTrue($methodReturn); $this->assertTrue($methodReturn);
//Case: The method doesn't exists in any of the drivers //Case: No parameters are given
//Result: A return of false //Result: A return of true
$methodReturn = $driver->supportsMethod('fail', null); $methodReturn = $driver->supportsMethod('getStatus', null);
$this->assertFalse($methodReturn); $this->assertTrue($methodReturn);
//Case: getLoginDrivers and getDefaultLoginDriver are always supported //Case: getLoginDrivers and getDefaultLoginDriver are always supported
//Result: A return of true //Result: A return of true
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment