protected function WebTestBase::assertNoPattern

Will trigger a pass if the perl regex pattern is not present in raw content.

Parameters

$pattern: Perl regex to look for including the regex delimiters.

$message: (optional) A message to display with the assertion. Do not translate messages: use format_string() to embed variables in the message text, not t(). If left blank, a default message will be displayed.

$group: (optional) The group this message is in, which is displayed in a column in test output. Use 'Debug' to indicate this is debugging output. Do not translate this string. Defaults to 'Other'; most tests do not override this default.

Return value

TRUE on pass, FALSE on fail.

9 calls to WebTestBase::assertNoPattern()
CommentAnonymousTest::testAnonymous in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
Tests anonymous comment functionality.
ImageFieldDisplayTest::testImageFieldDefaultImage in drupal/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php
Test use of a default image with an image field.
LocaleContentTest::testContentTypeDirLang in drupal/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php
Test if a dir and lang tags exist in node's attributes.
PageCacheTest::testConditionalRequests in drupal/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
Tests support of requests with If-Modified-Since and If-None-Match headers.
RouterTest::testControllerPlaceholders in drupal/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php
Confirms that placeholders in paths work correctly.

... See full list

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 2368
Definition of Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function assertNoPattern($pattern, $message = '', $group = 'Other') {
  if (!$message) {
    $message = t('Pattern "@pattern" not found', array(
      '@pattern' => $pattern,
    ));
  }
  return $this
    ->assert(!preg_match($pattern, $this
    ->drupalGetContent()), $message, $group);
}