function BlockStorageUnitTest::loadTests

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

Tests the loading of blocks.

1 call to BlockStorageUnitTest::loadTests()
BlockStorageUnitTest::testBlockCRUD in core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php
Tests CRUD operations.

File

core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php, line 114

Class

BlockStorageUnitTest
Tests the storage of blocks.

Namespace

Drupal\Tests\block\Kernel

Code

protected function loadTests() : void {
    $entity = $this->controller
        ->load('test_block');
    $this->assertInstanceOf(Block::class, $entity);
    // Verify several properties of the block.
    $this->assertSame('content', $entity->getRegion());
    $this->assertTrue($entity->status());
    $this->assertEquals('stark', $entity->getTheme());
    $this->assertNotEmpty($entity->uuid());
}

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