BlockVisibilityGroupsUITest.php in Block Visibility Groups 8
File
src/Tests/BlockVisibilityGroupsUITest.php
View source
<?php
namespace Drupal\block_visibility_groups\Tests;
class BlockVisibilityGroupsUITest extends BlockVisibilityGroupsTestBase {
public function testBlockVisibilityCreation() {
$this
->drupalPlaceBlock('local_actions_block');
$this
->drupalPlaceBlock('local_tasks_block');
$this
->drupalGet('admin/structure/block');
$this
->assertLink('Block Visibility Groups');
$this
->clickLink('Block Visibility Groups');
$this
->assertResponse(200);
$this
->assertLink('Add Block Visibility Group');
$this
->clickLink('Add Block Visibility Group');
$this
->assertResponse(200);
$this
->assertFieldById('edit-label');
$edit = [
'label' => $this
->randomMachineName(),
'id' => 'test_block_visibility_groups',
];
$this
->drupalPostForm(NULL, $edit, t('Save'));
$this
->assertText(t('Saved the @group Block Visibility Group.', [
'@group' => $edit['label'],
]));
$this
->assertText($edit['label']);
}
}