Skip to content
Snippets Groups Projects
Commit 8c2e08b8 authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Prevent notices in PHP 5.4.

parent a56822d6
No related merge requests found
...@@ -233,7 +233,7 @@ class EuropeanaResults implements RecommendInterface, ...@@ -233,7 +233,7 @@ class EuropeanaResults implements RecommendInterface,
$resultsProcessed[] = [ $resultsProcessed[] = [
'title' => $value->getTitle(), 'title' => $value->getTitle(),
'link' => $link, 'link' => $link,
'enclosure' => $value->getEnclosure()['url'] 'enclosure' => $value->getEnclosure()['url'] ?? null
]; ];
} }
if (count($resultsProcessed) == $this->limit) { if (count($resultsProcessed) == $this->limit) {
......
...@@ -41,6 +41,22 @@ use VuFind\View\Helper\Root\RecordDataFormatterFactory; ...@@ -41,6 +41,22 @@ use VuFind\View\Helper\Root\RecordDataFormatterFactory;
*/ */
class RecordDataFormatterTest extends \VuFindTest\Unit\ViewHelperTestCase class RecordDataFormatterTest extends \VuFindTest\Unit\ViewHelperTestCase
{ {
/**
* Get a mock record router.
*
* @return \VuFind\Record\Router
*/
protected function getMockRecordRouter()
{
$mock = $this->getMockBuilder(\VuFind\Record\Router::class)
->disableOriginalConstructor()
->setMethods(['getActionRouteDetails'])
->getMock();
$mock->expects($this->any())->method('getActionRouteDetails')
->will($this->returnValue(['route' => 'home', 'params' => []]));
return $mock;
}
/** /**
* Get view helpers needed by test. * Get view helpers needed by test.
* *
...@@ -59,7 +75,7 @@ class RecordDataFormatterTest extends \VuFindTest\Unit\ViewHelperTestCase ...@@ -59,7 +75,7 @@ class RecordDataFormatterTest extends \VuFindTest\Unit\ViewHelperTestCase
'openUrl' => new \VuFind\View\Helper\Root\OpenUrl($context, [], $this->getMockBuilder(\VuFind\Resolver\Driver\PluginManager::class)->disableOriginalConstructor()->getMock()), 'openUrl' => new \VuFind\View\Helper\Root\OpenUrl($context, [], $this->getMockBuilder(\VuFind\Resolver\Driver\PluginManager::class)->disableOriginalConstructor()->getMock()),
'proxyUrl' => new \VuFind\View\Helper\Root\ProxyUrl(), 'proxyUrl' => new \VuFind\View\Helper\Root\ProxyUrl(),
'record' => new \VuFind\View\Helper\Root\Record(), 'record' => new \VuFind\View\Helper\Root\Record(),
'recordLink' => new \VuFind\View\Helper\Root\RecordLink($this->getMockBuilder(\VuFind\Record\Router::class)->disableOriginalConstructor()->getMock()), 'recordLink' => new \VuFind\View\Helper\Root\RecordLink($this->getMockRecordRouter()),
'searchOptions' => new \VuFind\View\Helper\Root\SearchOptions(new \VuFind\Search\Options\PluginManager($this->getServiceManager())), 'searchOptions' => new \VuFind\View\Helper\Root\SearchOptions(new \VuFind\Search\Options\PluginManager($this->getServiceManager())),
'searchTabs' => $this->getMockBuilder(\VuFind\View\Helper\Root\SearchTabs::class)->disableOriginalConstructor()->getMock(), 'searchTabs' => $this->getMockBuilder(\VuFind\View\Helper\Root\SearchTabs::class)->disableOriginalConstructor()->getMock(),
'transEsc' => new \VuFind\View\Helper\Root\TransEsc(), 'transEsc' => new \VuFind\View\Helper\Root\TransEsc(),
......
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