forked from vufind-org/vufind
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7293036
commit 9926c7d
Showing
6 changed files
with
27 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/** | ||
* AJAX handler to look up DOI data. | ||
* AJAX handler to look up identifier-based link data. | ||
* | ||
* PHP version 8 | ||
* | ||
|
@@ -36,15 +36,15 @@ | |
use function count; | ||
|
||
/** | ||
* AJAX handler to look up DOI data. | ||
* AJAX handler to look up identifier-based link data. | ||
* | ||
* @category VuFind | ||
* @package AJAX | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development Wiki | ||
*/ | ||
class DoiLookup extends AbstractBase | ||
class IdentifierLinksLookup extends AbstractBase | ||
{ | ||
/** | ||
* DOI Linker Plugin Manager | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/** | ||
* Factory for DoiLookup AJAX handler. | ||
* Factory for IdentifierLinksLookup AJAX handler. | ||
* | ||
* PHP version 8 | ||
* | ||
|
@@ -35,15 +35,15 @@ | |
use Psr\Container\ContainerInterface; | ||
|
||
/** | ||
* Factory for DoiLookup AJAX handler. | ||
* Factory for IdentifierLinksLookup AJAX handler. | ||
* | ||
* @category VuFind | ||
* @package AJAX | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development Wiki | ||
*/ | ||
class DoiLookupFactory implements \Laminas\ServiceManager\Factory\FactoryInterface | ||
class IdentifierLinksLookupFactory implements \Laminas\ServiceManager\Factory\FactoryInterface | ||
{ | ||
/** | ||
* Create an object | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/** | ||
* DoiLookup test class. | ||
* IdentifierLinksLookup test class. | ||
* | ||
* PHP version 8 | ||
* | ||
|
@@ -30,21 +30,21 @@ | |
namespace VuFindTest\AjaxHandler; | ||
|
||
use Laminas\View\Renderer\PhpRenderer; | ||
use VuFind\AjaxHandler\DoiLookup; | ||
use VuFind\AjaxHandler\DoiLookupFactory; | ||
use VuFind\AjaxHandler\IdentifierLinksLookup; | ||
use VuFind\AjaxHandler\IdentifierLinksLookupFactory; | ||
use VuFind\DoiLinker\DoiLinkerInterface; | ||
use VuFind\DoiLinker\PluginManager; | ||
|
||
/** | ||
* DoiLookup test class. | ||
* IdentifierLinksLookup test class. | ||
* | ||
* @category VuFind | ||
* @package Tests | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org Main Page | ||
*/ | ||
class DoiLookupTest extends \VuFindTest\Unit\AjaxHandlerTestCase | ||
class IdentifierLinksLookupTest extends \VuFindTest\Unit\AjaxHandlerTestCase | ||
{ | ||
use \VuFindTest\Feature\ConfigPluginManagerTrait; | ||
|
||
|
@@ -83,19 +83,17 @@ protected function getMockPlugin( | |
->createMock(DoiLinkerInterface::class, ['getLinks']); | ||
$mockPlugin->expects($this->$times())->method('getLinks') | ||
->with($this->equalTo($expected)) | ||
->will( | ||
$this->returnValue( | ||
[ | ||
$doi => [ | ||
[ | ||
'link' => 'http://' . $value, | ||
'label' => $value, | ||
'icon' => 'remote-icon', | ||
'localIcon' => 'local-icon', | ||
], | ||
->willReturn( | ||
[ | ||
$doi => [ | ||
[ | ||
'link' => 'http://' . $value, | ||
'label' => $value, | ||
'icon' => 'remote-icon', | ||
'localIcon' => 'local-icon', | ||
], | ||
] | ||
) | ||
], | ||
] | ||
); | ||
return $mockPlugin; | ||
} | ||
|
@@ -149,8 +147,8 @@ function ($plugin) use ($plugins) { | |
|
||
$this->container->set('ViewRenderer', $mockRenderer); | ||
|
||
$factory = new DoiLookupFactory(); | ||
$handler = $factory($this->container, DoiLookup::class); | ||
$factory = new IdentifierLinksLookupFactory(); | ||
$handler = $factory($this->container, IdentifierLinksLookup::class); | ||
$params = $this->getParamsHelper(['doi' => $requested]); | ||
return $handler->handleRequest($params); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters