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

Adjusted tests to match revised strings.

parent a343298d
No related merge requests found
...@@ -299,7 +299,7 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -299,7 +299,7 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase
); );
$page = $this->gotoRecordById(); $page = $this->gotoRecordById();
$element = $this->findCss($page, '.alert.alert-info a'); $element = $this->findCss($page, '.alert.alert-info a');
$this->assertEquals('Login', $element->getText()); $this->assertEquals('Login for hold and recall information', $element->getText());
$element->click(); $element->click();
$this->snooze(); $this->snooze();
$this->findCss($page, '.createAccountLink')->click(); $this->findCss($page, '.createAccountLink')->click();
...@@ -368,7 +368,7 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -368,7 +368,7 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase
// Log in the user on the record page: // Log in the user on the record page:
$page = $this->gotoRecordById(); $page = $this->gotoRecordById();
$element = $this->findCss($page, '.alert.alert-info a'); $element = $this->findCss($page, '.alert.alert-info a');
$this->assertEquals('Login', $element->getText()); $this->assertEquals('Login for hold and recall information', $element->getText());
$element->click(); $element->click();
$this->snooze(); $this->snooze();
$this->fillInLoginForm($page, 'username1', 'test', false); $this->fillInLoginForm($page, 'username1', 'test', false);
...@@ -433,7 +433,7 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -433,7 +433,7 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase
// Log in the user on the record page: // Log in the user on the record page:
$page = $this->gotoRecordById(); $page = $this->gotoRecordById();
$element = $this->findCss($page, '.alert.alert-info a'); $element = $this->findCss($page, '.alert.alert-info a');
$this->assertEquals('Login', $element->getText()); $this->assertEquals('Login for hold and recall information', $element->getText());
$element->click(); $element->click();
$this->snooze(); $this->snooze();
$this->fillInLoginForm($page, 'username1', 'test', false); $this->fillInLoginForm($page, 'username1', 'test', false);
...@@ -469,7 +469,7 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase ...@@ -469,7 +469,7 @@ class IlsActionsTest extends \VuFindTest\Unit\MinkTestCase
// Log in the user on the record page: // Log in the user on the record page:
$page = $this->gotoRecordById(); $page = $this->gotoRecordById();
$element = $this->findCss($page, '.alert.alert-info a'); $element = $this->findCss($page, '.alert.alert-info a');
$this->assertEquals('Login', $element->getText()); $this->assertEquals('Login for hold and recall information', $element->getText());
$element->click(); $element->click();
$this->snooze(); $this->snooze();
$this->fillInLoginForm($page, 'username1', 'test', false); $this->fillInLoginForm($page, 'username1', 'test', false);
......
...@@ -86,6 +86,21 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase ...@@ -86,6 +86,21 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase
]; ];
} }
/**
* Mock out the translator.
*
* @return \Zend\I18n\Translator\TranslatorInterface
*/
protected function getMockTranslator()
{
$mock = $this->getMockBuilder('Zend\I18n\Translator\TranslatorInterface')
->getMock();
$mock->expects($this->at(1))->method('translate')
->with($this->equalTo('showing_results_of_html'), $this->equalTo('default'))
->will($this->returnValue('Showing <strong>%%start%% - %%end%%</strong> results of <strong>%%total%%</strong>'));
return $mock;
}
/** /**
* Test feed generation * Test feed generation
* *
...@@ -107,6 +122,7 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase ...@@ -107,6 +122,7 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase
$results->getParams()->initFromRequest($request); $results->getParams()->initFromRequest($request);
$helper = new ResultFeed(); $helper = new ResultFeed();
$helper->setTranslator($this->getMockTranslator());
$helper->setView($this->getPhpRenderer($this->getPlugins())); $helper->setView($this->getPhpRenderer($this->getPlugins()));
$feed = $helper->__invoke($results, '/test/path'); $feed = $helper->__invoke($results, '/test/path');
$this->assertTrue(is_object($feed)); $this->assertTrue(is_object($feed));
...@@ -121,7 +137,7 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase ...@@ -121,7 +137,7 @@ class ResultFeedTest extends \VuFindTest\Unit\ViewHelperTestCase
// Now re-parse it and check for some expected values: // Now re-parse it and check for some expected values:
$parsedFeed = \Zend\Feed\Reader\Reader::importString($rss); $parsedFeed = \Zend\Feed\Reader\Reader::importString($rss);
$this->assertEquals( $this->assertEquals(
'Showing 1-2 of 2', $parsedFeed->getDescription() 'Showing 1 - 2 results of 2', $parsedFeed->getDescription()
); );
$items = []; $items = [];
$i = 0; $i = 0;
......
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