public function NodePageDisableFunctionalTest::testEnableDisable in Node Page Disable 7
Test the enabling and disabling of the module
File
- ./
node_page_disable.test, line 47 - Tests for node_page_disable.module.
Class
- NodePageDisableFunctionalTest
- Functional Tests for the node_page_disable.
Code
public function testEnableDisable() {
$_control_group = 'Enable/Disable';
// site_frontpage: /welcome
variable_set('site_frontpage', 'welcome');
$html = $this
->drupalGet('node');
$this
->assertRaw('No front page content has been created yet.', 'Assert /node is available before module is enabled when front page is /welcome.', $_control_group);
module_enable(array(
'node_page_disable',
));
$html = $this
->drupalGet('node');
$this
->assertRaw('Page not found', 'Assert /node is disabled when module is enabled and front page is /welcome', $_control_group);
module_disable(array(
'node_page_disable',
));
$html = $this
->drupalGet('node');
$this
->assertRaw('No front page content has been created yet.', 'Assert /node is available after node_page_disable is disabled and front page is /welcome.', $_control_group);
// site_frontpage: /node
variable_set('site_frontpage', 'node');
$html = $this
->drupalGet('node');
$this
->assertRaw('No front page content has been created yet.', 'Assert /node is available before module is enabled when front page is /node.', $_control_group);
module_enable(array(
'node_page_disable',
));
$html = $this
->drupalGet('node');
$this
->assertRaw('No front page content has been created yet.', 'Assert /node is available after module is enabled when front page is /node.', $_control_group);
module_disable(array(
'node_page_disable',
));
$html = $this
->drupalGet('node');
$this
->assertRaw('No front page content has been created yet.', 'Assert /node is available after node_page_disable is disabled and front page is /node.', $_control_group);
}