Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Jan 30, 2025
1 parent 3fd2558 commit b4c4a76
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class BasicTest extends \VuFindTest\Integration\MinkTestCase
public function testHomePage(): void
{
$page = $this->getSearchHomePage();
$this->assertTrue(false !== strstr($page->getContent(), 'VuFind'));
$this->assertStringContainsString('VuFind', $page->getContent());
}

/**
Expand Down Expand Up @@ -142,6 +142,31 @@ public function testThemeSwitcher(): void
);
}

/**
* Test graceful handling of an invalid theme.
*
* Note that HTML validation is disabled on this test because an improperly initialized
* theme will not generate a fully-formed page; but we still want to confirm that it
* at least outputs a human-readable error message.
*
* @return void
*/
#[\VuFindTest\Attribute\HtmlValidation(false)]
public function testBadThemeConfig(): void
{
$this->changeConfigs(
[
'config' => [
'Site' => [
'theme' => 'not-a-valid-theme',
],
],
]
);
$page = $this->getSearchHomePage();
$this->assertStringContainsString('An error has occurred', $page->getContent());
}

/**
* Test lightbox jump links
*
Expand Down

0 comments on commit b4c4a76

Please sign in to comment.