You are here

public function BambooTwigTestBase::assertElementContains in Bamboo Twig 8

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/BambooTwigTestBase.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigTestBase::assertElementContains()
  2. 8.2 tests/src/Functional/BambooTwigTestBase.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigTestBase::assertElementContains()
  3. 8.3 tests/src/Functional/BambooTwigTestBase.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigTestBase::assertElementContains()
  4. 8.4 tests/src/Functional/BambooTwigTestBase.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigTestBase::assertElementContains()

Asserts that the element with the given CSS selector is present.

Parameters

string $css_selector: The CSS selector identifying the element to check.

string $html: Expected text.

Throws

Behat\Mink\Exception\ElementHtmlException When the condition is not fulfilled.

See also

\Behat\Mink\WebAssert::elementContains

10 calls to BambooTwigTestBase::assertElementContains()
BambooTwigConfigsTest::testGetConfig in tests/src/Functional/BambooTwigConfigsTest.php
@covers Drupal\bamboo_twig_config\TwigExtension\Configs::getConfig
BambooTwigConfigsTest::testGetState in tests/src/Functional/BambooTwigConfigsTest.php
@covers Drupal\bamboo_twig_config\TwigExtension\Configs::getState
BambooTwigFilesTest::testExtensionGuesser in tests/src/Functional/BambooTwigFilesTest.php
@covers Drupal\bamboo_twig_files\TwigExtension\Files::extensionGuesser
BambooTwigFilesTest::testThemeUrl in tests/src/Functional/BambooTwigFilesTest.php
@covers Drupal\bamboo_twig_files\TwigExtension\Files::themeUrl
BambooTwigLoaderTest::testBlock in tests/src/Functional/BambooTwigLoadersTest.php
@covers Drupal\bamboo_twig_loaders\TwigExtension\Loader::loadBlock

... See full list

File

tests/src/Functional/BambooTwigTestBase.php, line 75

Class

BambooTwigTestBase
Has some additional helper methods to make test code more readable.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function assertElementContains($css_selector, $html) {
  $this
    ->assertSession()
    ->elementContains('css', $css_selector, $html);
}