CustomBlockVisibilityTest.php in Block Style Plugins 8.2
File
tests/src/Functional/CustomBlockVisibilityTest.php
View source
<?php
namespace Drupal\Tests\block_style_plugins\Functional;
use Drupal\Tests\block_content\Functional\BlockContentTestBase;
class CustomBlockVisibilityTest extends BlockContentTestBase {
protected static $modules = [
'block_style_plugins',
'block_style_plugins_test',
];
protected $defaultTheme = 'stark';
protected $permissions = [
'administer blocks',
'access administration pages',
];
public function testVisibilityOfStylesOnCustomBlockTypes() {
$assert = $this
->assertSession();
$this
->drupalLogin($this->adminUser);
$block = $this
->createBlockContent('Custom Block Test');
$this
->drupalPlaceBlock('block_content:' . $block
->uuid(), [
'id' => 'customblocktest',
'region' => 'content',
]);
$this
->drupalGet('admin/structure/block/block-content/types');
$this
->drupalGet('admin/structure/block/block-content');
$this
->drupalGet('block/' . $block
->id());
$assert
->pageTextContains('Block description');
$this
->drupalGet('admin/structure/block/manage/customblocktest');
$assert
->responseContains('Add a custom class to this block');
$assert
->responseContains('Choose a style from the dropdown');
$assert
->pageTextNotContains('Check this box');
}
}