Test the administration theme functionality.
function testAdministrationTheme() {
theme_enable(array(
'seven',
));
// Enable an administration theme and show it on the node admin pages.
$edit = array(
'admin_theme' => 'seven',
'node_admin_theme' => TRUE,
);
$this
->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this
->drupalGet('admin/config');
$this
->assertRaw('core/themes/seven', 'Administration theme used on an administration page.');
$this
->drupalGet('node/' . $this->node->nid);
$this
->assertRaw('core/themes/stark', 'Site default theme used on node page.');
$this
->drupalGet('node/add');
$this
->assertRaw('core/themes/seven', 'Administration theme used on the add content page.');
$this
->drupalGet('node/' . $this->node->nid . '/edit');
$this
->assertRaw('core/themes/seven', 'Administration theme used on the edit content page.');
// Disable the admin theme on the node admin pages.
$edit = array(
'node_admin_theme' => FALSE,
);
$this
->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this
->drupalGet('admin/config');
$this
->assertRaw('core/themes/seven', 'Administration theme used on an administration page.');
$this
->drupalGet('node/add');
$this
->assertRaw('core/themes/stark', 'Site default theme used on the add content page.');
// Reset to the default theme settings.
variable_set('theme_default', 'bartik');
$edit = array(
'admin_theme' => '0',
'node_admin_theme' => FALSE,
);
$this
->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this
->drupalGet('admin');
$this
->assertRaw('core/themes/bartik', 'Site default theme used on administration page.');
$this
->drupalGet('node/add');
$this
->assertRaw('core/themes/bartik', 'Site default theme used on the add content page.');
}