protected function AssertBlockAppearsTrait::assertNoBlockAppears in Drupal 10
Same name and namespace in other branches
- 8 core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php \Drupal\Tests\block\Functional\AssertBlockAppearsTrait::assertNoBlockAppears()
 - 9 core/modules/block/tests/src/Functional/AssertBlockAppearsTrait.php \Drupal\Tests\block\Functional\AssertBlockAppearsTrait::assertNoBlockAppears()
 
Checks to see whether a block does not appears on the page.
Parameters
\Drupal\block\Entity\Block $block: The block entity to find on the page.
1 call to AssertBlockAppearsTrait::assertNoBlockAppears()
- DisplayBlockTest::testDeleteBlockDisplay in core/
modules/ block/ tests/ src/ Functional/ Views/ DisplayBlockTest.php  - Tests removing a block display.
 
File
- core/
modules/ block/ tests/ src/ Functional/ AssertBlockAppearsTrait.php, line 31  
Class
- AssertBlockAppearsTrait
 - Provides test assertions for testing block appearance.
 
Namespace
Drupal\Tests\block\FunctionalCode
protected function assertNoBlockAppears(Block $block) {
  $result = $this
    ->findBlockInstance($block);
  $this
    ->assertEmpty($result, sprintf('The block %s should not appear on the page.', $block
    ->id()));
}