You are here

protected function PatchInfoTestTrait::assertNoElementByCssSelector in PatchInfo 8.2

Passes if an element matching the specified CSS selector is not found.

An optional element index may be passed.

Parameters

string $selector: CSS selector of element.

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

Return value

bool TRUE if the assertion succeeded, FALSE otherwise.

File

tests/src/Traits/PatchInfoTestTrait.php, line 52

Class

PatchInfoTestTrait
Provides common methods for functional tests of PatchInfo module.

Namespace

Drupal\Tests\patchinfo\Traits

Code

protected function assertNoElementByCssSelector($selector, $message = '') {
  $elements = $this
    ->cssSelect($selector);
  $message = $message ? $message : new FormattableMarkup('Element with CSS selector %selector not found.', [
    '%selector' => $selector,
  ]);
  return $this
    ->assertTrue(empty($elements), $message);
}