Skip to content
Snippets Groups Projects
Commit edf53457 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Test language switching.

parent c26becd2
No related merge requests found
...@@ -79,4 +79,30 @@ class BasicTest extends \VuFindTest\Unit\MinkTestCase ...@@ -79,4 +79,30 @@ class BasicTest extends \VuFindTest\Unit\MinkTestCase
$this->findCss($page, '.location')->getText() $this->findCss($page, '.location')->getText()
); );
} }
/**
* Test language switching by checking a link in the footer
*
* @return void
*/
public function testLanguage()
{
$session = $this->getMinkSession();
$session->visit($this->getVuFindUrl() . '/Search/Home');
$page = $session->getPage();
// Check footer help-link
$this->assertEquals(
'Search Tips',
$this->findCss($page, 'footer .help-link')->getHTML()
);
// Change the language:
$this->findCss($page, '.language.dropdown')->click();
$this->findCss($page, '.language.dropdown li:not(.active) a')->click();
$this->snooze();
// Check footer help-link
$this->assertNotEquals(
'Search Tips',
$this->findCss($page, 'footer .help-link')->getHTML()
);
}
} }
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<? endif; ?> <? endif; ?>
<? if (isset($this->layout()->themeOptions) && count($this->layout()->themeOptions) > 1): ?> <? if (isset($this->layout()->themeOptions) && count($this->layout()->themeOptions) > 1): ?>
<li class="dropdown"> <li class="theme dropdown">
<form method="post" name="themeForm" id="themeForm"> <form method="post" name="themeForm" id="themeForm">
<input type="hidden" name="ui"/> <input type="hidden" name="ui"/>
</form> </form>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<? endif; ?> <? endif; ?>
<? if (isset($this->layout()->allLangs) && count($this->layout()->allLangs) > 1): ?> <? if (isset($this->layout()->allLangs) && count($this->layout()->allLangs) > 1): ?>
<li class="dropdown"> <li class="language dropdown">
<form method="post" name="langForm" id="langForm"> <form method="post" name="langForm" id="langForm">
<input type="hidden" name="mylang"/> <input type="hidden" name="mylang"/>
</form> </form>
......
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