You are here

function SystemAdminTestCase::testCompactMode in Drupal 7

Test compact mode.

File

modules/system/system.test, line 2837
Tests for system.module.

Class

SystemAdminTestCase
Tests administrative overview pages.

Code

function testCompactMode() {
  $this
    ->drupalGet('admin/compact/on');
  $this
    ->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'Compact mode turns on.');
  $this
    ->drupalGet('admin/compact/on');
  $this
    ->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'Compact mode remains on after a repeat call.');
  $this
    ->drupalGet('');
  $this
    ->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'Compact mode persists on new requests.');
  $this
    ->drupalGet('admin/compact/off');
  $this
    ->assertEqual($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'deleted', 'Compact mode turns off.');
  $this
    ->drupalGet('admin/compact/off');
  $this
    ->assertEqual($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'deleted', 'Compact mode remains off after a repeat call.');
  $this
    ->drupalGet('');
  $this
    ->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'Compact mode persists on new requests.');
}