FunctionalFixedBlockTestBase.php in Fixed Block Content 8
File
tests/src/Functional/FunctionalFixedBlockTestBase.php
View source
<?php
namespace Drupal\Tests\fixed_block_content\Functional;
use Drupal\Tests\BrowserTestBase;
abstract class FunctionalFixedBlockTestBase extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected static $modules = [
'block_content',
'hal',
'serialization',
'fixed_block_content',
];
protected $fixedBlock;
public function setUp() {
parent::setUp();
$entity_type_manager = $this->container
->get('entity_type.manager');
$type = $entity_type_manager
->getStorage('block_content_type')
->create([
'id' => 'basic',
'label' => 'Basic',
'revision' => FALSE,
]);
$type
->save();
block_content_add_body_field($type
->id());
$this->fixedBlock = $entity_type_manager
->getStorage('fixed_block_content')
->create([
'id' => 'basic_fixed',
'title' => 'Basic fixed',
'block_content_bundle' => 'basic',
]);
$this->fixedBlock
->save();
$this
->drupalPlaceBlock('fixed_block_content:basic_fixed');
}
}