You are here

protected function TaxonomyAccessFixTestTrait::assertNoElementByCssSelector in Taxonomy access fix 8.3

Same name and namespace in other branches
  1. 8.2 tests/src/Traits/TaxonomyAccessFixTestTrait.php \Drupal\Tests\taxonomy_access_fix\Traits\TaxonomyAccessFixTestTrait::assertNoElementByCssSelector()

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.

Throws

\PHPUnit\Framework\ExpectationFailedException When the assertion failed.

2 calls to TaxonomyAccessFixTestTrait::assertNoElementByCssSelector()
TaxonomyAccessFixTestTrait::assertNoSortableTable in tests/src/Traits/TaxonomyAccessFixTestTrait.php
Asserts that the page contains no sortable taxonomy term table.
VocabularyAccessTest::testTaxonomyVocabularyOverview in tests/src/Functional/VocabularyAccessTest.php
Tests access to Taxonomy Vocabulary overview page.

File

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

Class

TaxonomyAccessFixTestTrait
Provides common methods for functional tests of Taxonomy Access Fix module.

Namespace

Drupal\Tests\taxonomy_access_fix\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,
  ]);
  $this
    ->assertTrue(empty($elements), $message);
}