diff --git a/module/VuFind/src/VuFindTest/Unit/MinkTestCase.php b/module/VuFind/src/VuFindTest/Unit/MinkTestCase.php index edee3660c81cd033bfe8c3f794a90e9ce0a26edf..d9d9d3b9312063c137055d432fff981754f94930 100644 --- a/module/VuFind/src/VuFindTest/Unit/MinkTestCase.php +++ b/module/VuFind/src/VuFindTest/Unit/MinkTestCase.php @@ -269,6 +269,21 @@ abstract class MinkTestCase extends DbTestCase return $result; } + /** + * Retrieve a link and assert that it exists before returning it. + * + * @param Element $page Page element + * @param string $text Link text to match + * + * @return mixed + */ + protected function findAndAssertLink(Element $page, $text) + { + $link = $page->findLink($text); + $this->assertTrue(is_object($link)); + return $link; + } + /** * Check whether an element containing the specified text exists. *