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

Update flash messenger plugin.

parent de4736ea
No related merge requests found
...@@ -247,7 +247,6 @@ $config = [ ...@@ -247,7 +247,6 @@ $config = [
'controller_plugins' => [ 'controller_plugins' => [
'factories' => [ 'factories' => [
'favorites' => 'VuFind\Controller\Plugin\Factory::getFavorites', 'favorites' => 'VuFind\Controller\Plugin\Factory::getFavorites',
'flashmessenger' => 'VuFind\Controller\Plugin\Factory::getFlashMessenger',
'followup' => 'VuFind\Controller\Plugin\Factory::getFollowup', 'followup' => 'VuFind\Controller\Plugin\Factory::getFollowup',
'holds' => 'VuFind\Controller\Plugin\Factory::getHolds', 'holds' => 'VuFind\Controller\Plugin\Factory::getHolds',
'newItems' => 'VuFind\Controller\Plugin\Factory::getNewItems', 'newItems' => 'VuFind\Controller\Plugin\Factory::getNewItems',
...@@ -257,11 +256,16 @@ $config = [ ...@@ -257,11 +256,16 @@ $config = [
'reserves' => 'VuFind\Controller\Plugin\Factory::getReserves', 'reserves' => 'VuFind\Controller\Plugin\Factory::getReserves',
'resultScroller' => 'VuFind\Controller\Plugin\Factory::getResultScroller', 'resultScroller' => 'VuFind\Controller\Plugin\Factory::getResultScroller',
'storageRetrievalRequests' => 'VuFind\Controller\Plugin\Factory::getStorageRetrievalRequests', 'storageRetrievalRequests' => 'VuFind\Controller\Plugin\Factory::getStorageRetrievalRequests',
'Zend\Mvc\Plugin\FlashMessenger\FlashMessenger' =>
'VuFind\Controller\Plugin\Factory::getFlashMessenger',
], ],
'invokables' => [ 'invokables' => [
'db-upgrade' => 'VuFind\Controller\Plugin\DbUpgrade', 'db-upgrade' => 'VuFind\Controller\Plugin\DbUpgrade',
'renewals' => 'VuFind\Controller\Plugin\Renewals', 'renewals' => 'VuFind\Controller\Plugin\Renewals',
] ],
'aliases' => [
'flashMessenger' => 'Zend\Mvc\Plugin\FlashMessenger\FlashMessenger',
],
], ],
'service_manager' => [ 'service_manager' => [
'allow_override' => true, 'allow_override' => true,
......
...@@ -29,6 +29,7 @@ namespace VuFind\Controller\Plugin; ...@@ -29,6 +29,7 @@ namespace VuFind\Controller\Plugin;
use Zend\Config\Config; use Zend\Config\Config;
use Zend\Mvc\Controller\Plugin\AbstractPlugin; use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use Zend\Mvc\Plugin\FlashMessenger\FlashMessenger;
/** /**
* Zend action helper to perform new items-related actions * Zend action helper to perform new items-related actions
...@@ -61,11 +62,11 @@ class NewItems extends AbstractPlugin ...@@ -61,11 +62,11 @@ class NewItems extends AbstractPlugin
/** /**
* Figure out which bib IDs to load from the ILS. * Figure out which bib IDs to load from the ILS.
* *
* @param \VuFind\ILS\Connection $catalog ILS connection * @param \VuFind\ILS\Connection $catalog ILS connection
* @param \VuFind\Search\Solr\Params $params Solr parameters * @param \VuFind\Search\Solr\Params $params Solr parameters
* @param string $range Range setting * @param string $range Range setting
* @param string $dept Department setting * @param string $dept Department setting
* @param \Zend\Mvc\Controller\Plugin\FlashMessenger $flash Flash messenger * @param FlashMessenger $flash Flash messenger
* *
* @return array * @return array
*/ */
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
*/ */
namespace VuFind\View\Helper\Root; namespace VuFind\View\Helper\Root;
use Zend\Mvc\Controller\Plugin\FlashMessenger; use Zend\Mvc\Plugin\FlashMessenger\FlashMessenger;
use Zend\View\Helper\AbstractHelper; use Zend\View\Helper\AbstractHelper;
/** /**
......
...@@ -50,7 +50,7 @@ class NewItemsTest extends TestCase ...@@ -50,7 +50,7 @@ class NewItemsTest extends TestCase
*/ */
public function testGetBibIDsFromCatalog() public function testGetBibIDsFromCatalog()
{ {
$flash = $this->createMock('Zend\Mvc\Controller\Plugin\FlashMessenger'); $flash = $this->createMock('Zend\Mvc\Plugin\FlashMessenger\FlashMessenger');
$config = new Config(['result_pages' => 10]); $config = new Config(['result_pages' => 10]);
$newItems = new NewItems($config); $newItems = new NewItems($config);
$bibs = $newItems->getBibIDsFromCatalog( $bibs = $newItems->getBibIDsFromCatalog(
...@@ -66,7 +66,7 @@ class NewItemsTest extends TestCase ...@@ -66,7 +66,7 @@ class NewItemsTest extends TestCase
*/ */
public function testGetBibIDsFromCatalogWithIDLimit() public function testGetBibIDsFromCatalogWithIDLimit()
{ {
$flash = $this->createMock('Zend\Mvc\Controller\Plugin\FlashMessenger'); $flash = $this->createMock('Zend\Mvc\Plugin\FlashMessenger\FlashMessenger');
$flash->expects($this->once())->method('addMessage') $flash->expects($this->once())->method('addMessage')
->with($this->equalTo('too_many_new_items'), $this->equalTo('info')); ->with($this->equalTo('too_many_new_items'), $this->equalTo('info'));
$config = new Config(['result_pages' => 10]); $config = new Config(['result_pages' => 10]);
......
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