You are here

protected function TestHelperTrait::assertNoFacetBlocksAppear in Facets 8

Asserts that a facet block does not appear.

3 calls to TestHelperTrait::assertNoFacetBlocksAppear()
IntegrationTest::testFacetSourceVisibility in tests/src/Functional/IntegrationTest.php
Tests the visibility of facet source.
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Tests various operations via the Facets' admin UI.
ProcessorIntegrationTest::testHideOnlyOneItemProcessor in tests/src/Functional/ProcessorIntegrationTest.php
Test HideOnlyOneItemProcessor.

File

tests/src/Functional/TestHelperTrait.php, line 64

Class

TestHelperTrait
Adds helpers for test methods.

Namespace

Drupal\Tests\facets\Functional

Code

protected function assertNoFacetBlocksAppear() {
  foreach ($this->blocks as $block) {
    $xpath = $this
      ->xpath('//div[@id = :id]/div[@class="facet-empty"]', [
      ':id' => 'block-' . $block
        ->id(),
    ]);
    if (!$xpath) {
      $this
        ->assertEmpty($xpath);
    }
    else {
      $this
        ->assertTrue($this
        ->xpath('//div[@id = :id]/div[@class="facet-empty"]', [
        ':id' => 'block-' . $block
          ->id(),
      ]));
    }
  }
}