protected function NgLightboxTest::assertContains in NG Lightbox 8
Asserts a string does exist in the haystack.
Parameters
string $needle: The string to search for.
string $haystack: The string to search within.
string $message: The message to log.
Return value
bool TRUE if it was found otherwise FALSE.
1 call to NgLightboxTest::assertContains()
- NgLightboxTest::assertLightboxEnabled in src/
Tests/ NgLightboxTest.php - Asserts the lightbox was enabled for the generated link.
File
- src/
Tests/ NgLightboxTest.php, line 105 - NG Lightbox tests.
Class
- NgLightboxTest
- Test basic functionality of the lightbox.
Namespace
Drupal\ng_lightbox\TestsCode
protected function assertContains($needle, $haystack, $message = '') {
if (empty($message)) {
$message = t('%needle was found within %haystack', [
'%needle' => $needle,
'%haystack' => $haystack,
]);
}
return $this
->assertTrue(stripos($haystack, $needle) !== FALSE, $message);
}