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

Added print test.

parent 301c9ae1
No related merge requests found
...@@ -200,6 +200,8 @@ class CartTest extends \VuFindTest\Unit\MinkTestCase ...@@ -200,6 +200,8 @@ class CartTest extends \VuFindTest\Unit\MinkTestCase
* Select all of the items currently in the cart lightbox. * Select all of the items currently in the cart lightbox.
* *
* @param Element $page Page element * @param Element $page Page element
*
* @return void
*/ */
protected function selectAllItemsInCart(Element $page) protected function selectAllItemsInCart(Element $page)
{ {
...@@ -365,4 +367,31 @@ class CartTest extends \VuFindTest\Unit\MinkTestCase ...@@ -365,4 +367,31 @@ class CartTest extends \VuFindTest\Unit\MinkTestCase
$session->stop(); $session->stop();
} }
/**
* Test that the print control works.
*
* @return void
*/
public function testCartPrint()
{
$session = $this->getMinkSession();
$session->start();
$page = $this->setUpGenericCartTest($session);
$button = $page->find('css', '.cart-controls button[name=print]');
// First try clicking without selecting anything:
$button->click();
$this->checkForNonSelectedMessage($page);
// Now do it for real -- we should get redirected.
$this->selectAllItemsInCart($page);
$button->click();
list(, $params) = explode('?', $session->getCurrentUrl());
$this->assertEquals(
'print=true&id[]=VuFind|testsample1&id[]=VuFind|testsample2', $params
);
$session->stop();
}
} }
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