public function BasicFixedBlockTest::testContentBlockCreationOnView in Fixed Block Content 8
Tests that the content block is created on view.
File
- tests/
src/ Functional/ BasicFixedBlockTest.php, line 15  
Class
- BasicFixedBlockTest
 - Tests the basic fixed block content functionality.
 
Namespace
Drupal\Tests\fixed_block_content\FunctionalCode
public function testContentBlockCreationOnView() {
  // Gets the home page.
  $this
    ->drupalGet('<front>');
  // Check that the custom block was created.
  $content_blocks = \Drupal::entityTypeManager()
    ->getStorage('block_content')
    ->loadByProperties([
    'info' => $this->fixedBlock
      ->label(),
  ]);
  $this
    ->assertTrue(!empty($content_blocks), 'Automatic block content creation failed.');
}