You are here

protected function NgLightboxTest::assertContains in NG Lightbox 7

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.

3 calls to NgLightboxTest::assertContains()
NgLightboxTest::testAdminPathSetting in tests/ng_lightbox.test
Test that the lightbox is disabled on admin paths.
NgLightboxTest::testNgLightbox in tests/ng_lightbox.test
Test the basic usage and settings.
NgLightboxTest::testPatternMatching in tests/ng_lightbox.test
Test the pattern matching for link paths.

File

tests/ng_lightbox.test, line 189
NG Lightbox tests.

Class

NgLightboxTest
@file NG Lightbox tests.

Code

protected function assertContains($needle, $haystack, $message = '') {
  if (empty($message)) {
    $message = t('%needle was found within %haystack', array(
      '%needle' => $needle,
      '%haystack' => $haystack,
    ));
  }
  return $this
    ->assertTrue(stripos($haystack, $needle) !== FALSE, $message);
}