You are here

protected function NgLightboxTest::assertNotContains in NG Lightbox 8

Asserts a string does not 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 not found otherwise FALSE.

1 call to NgLightboxTest::assertNotContains()
NgLightboxTest::assertLightboxNotEnabled in src/Tests/NgLightboxTest.php
Asserts the lightbox was not enabled for the generated link.

File

src/Tests/NgLightboxTest.php, line 125
NG Lightbox tests.

Class

NgLightboxTest
Test basic functionality of the lightbox.

Namespace

Drupal\ng_lightbox\Tests

Code

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