You are here

protected function FieldTest::assertSubString in Views (for Drupal 7) 8.3

Assertion helper which checks whether a string is part of another string.

Parameters

string $haystack: The value to search in.

string $needle: The value to search for.

string $message: The message to display along with the assertion.

string $group: The type of assertion - examples are "Browser", "PHP".

Return value

bool TRUE if the assertion succeeded, FALSE otherwise.

5 calls to FieldTest::assertSubString()
FieldTest::testAlterUrl in lib/Drupal/views/Tests/Handler/FieldTest.php
Tests rewriting the output to a link.
FieldTest::testExclude in lib/Drupal/views/Tests/Handler/FieldTest.php
Tests the exclude setting.
FieldTest::testFieldTokens in lib/Drupal/views/Tests/Handler/FieldTest.php
Tests the field tokens, row level and field level.
FieldTest::testRewrite in lib/Drupal/views/Tests/Handler/FieldTest.php
Tests general rewriting of the output.
FieldTest::testTextRendering in lib/Drupal/views/Tests/Handler/FieldTest.php
Tests trimming/read-more/ellipses.

File

lib/Drupal/views/Tests/Handler/FieldTest.php, line 140
Definition of Drupal\views\Tests\Handler\FieldTest.

Class

FieldTest
Tests the generic field handler.

Namespace

Drupal\views\Tests\Handler

Code

protected function assertSubString($haystack, $needle, $message = '', $group = 'Other') {
  return $this
    ->assertTrue(strpos($haystack, $needle) !== FALSE, $message, $group);
}