You are here

public function NodePageDisableFunctionalTest::_testRetained in Node Page Disable 6

Test respect of variable node_page_disable_path_node_keep

File

./node_page_disable.test, line 23
Tests for node_page_disable.module.

Class

NodePageDisableFunctionalTest
Functional Tests for the node_page_disable.

Code

public function _testRetained() {
  $_control_group = 'Module Settings';
  module_enable(array(
    'node_page_disable',
  ));
  variable_set('node_page_disable_path_node_keep', FALSE);
  menu_rebuild();
  $html = $this
    ->drupalGet('node');
  $this
    ->assertRaw('No front page content has been created yet.', 'Assert /node is available when node_page_disable_path_node_keep is TRUE', $_control_group);
  variable_set('node_page_disable_path_node_keep', FALSE);
  menu_rebuild();
  $html = $this
    ->drupalGet('node');
  $this
    ->assertRaw('No front page content has been created yet.', 'Assert /node is available when node_page_disable_path_node_keep is FALSE but site_frontpage is still set to node', $_control_group);
  variable_set('site_frontpage', 'welcome');
  variable_set('node_page_disable_path_node_keep', FALSE);
  menu_rebuild();
  $html = $this
    ->drupalGet('node');
  $this
    ->assertRaw('Page not found', 'Assert /node is disabled when node_page_disable_path_node_keep is FALSE', $_control_group);
}