function BlockRebuildTest::testRebuildNoBlocks

Same name and namespace in other branches
  1. 9 core/modules/block/tests/src/Kernel/BlockRebuildTest.php \Drupal\Tests\block\Kernel\BlockRebuildTest::testRebuildNoBlocks()
  2. 8.9.x core/modules/block/tests/src/Kernel/BlockRebuildTest.php \Drupal\Tests\block\Kernel\BlockRebuildTest::testRebuildNoBlocks()
  3. 10 core/modules/block/tests/src/Kernel/BlockRebuildTest.php \Drupal\Tests\block\Kernel\BlockRebuildTest::testRebuildNoBlocks()

@covers ::block_rebuild

File

core/modules/block/tests/src/Kernel/BlockRebuildTest.php, line 50

Class

BlockRebuildTest
Tests <a href="/api/drupal/core%21modules%21block%21block.module/function/block_rebuild/11.x" title="Implements hook_rebuild()." class="local">block_rebuild</a>().

Namespace

Drupal\Tests\block\Kernel

Code

public function testRebuildNoBlocks() : void {
    block_rebuild();
    $messages = \Drupal::messenger()->all();
    \Drupal::messenger()->deleteAll();
    $this->assertEquals([], $messages);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.