BlockAdminThemeTest.php in MongoDB 7
File
mongodb_block_ui/src/Tests/BlockAdminThemeTest.php
View source
<?php
namespace Drupal\mongodb_block_ui\Tests;
class BlockAdminThemeTest extends \DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Admin theme block admin accessibility',
'description' => "Check whether the block administer page for a disabled theme acccessible if and only if it's the admin theme.",
'group' => 'MongoDB: Block',
);
}
public function testAdminTheme() {
$adminuser = $this
->drupalCreateUser(array(
'administer blocks',
'administer themes',
));
$this
->drupalLogin($adminuser);
$this
->drupalGet('admin/structure/block/list/stark');
$this
->assertResponse(403, t('The block admin page for a disabled theme can not be accessed'));
$edit['admin_theme'] = 'stark';
$this
->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this
->drupalGet('admin/structure/block/list/stark');
$this
->assertResponse(200, t('The block admin page for the admin theme can be accessed'));
}
}