You are here

protected function IntegrationTest::assertPageContainsNodeTeaserWithText in Views Entity Reference Filter 8

Asserts that a node teaser containing the given text is present.

Parameters

string $text: The text to look for.

Throws

\Exception

1 call to IntegrationTest::assertPageContainsNodeTeaserWithText()
IntegrationTest::testFilterWorks in tests/src/Functional/IntegrationTest.php
Tests that the Views Entity Reference Filter works.

File

tests/src/Functional/IntegrationTest.php, line 95

Class

IntegrationTest
Tests the integration between Views Entity Reference Filter and Views.

Namespace

Drupal\Tests\verf\Functional

Code

protected function assertPageContainsNodeTeaserWithText($text) {
  try {
    $this
      ->assertPageNotContainsNodeTeaserWithText($text);
  } catch (\Exception $e) {

    // Text was found, we're good.
    return;
  }
  throw new \Exception("No teaser could be found with the text: {$text}");
}