You are here

toolbar_admin_menu.test in Hide the Toolbar 7

File

toolbar_admin_menu.test
View source
<?php

class ToolbarAdminMenuTestCase extends DrupalWebTestCase {

  /**
   * @var \stdClass
   */
  private $account;

  /**
   * @return array
   */
  public static function getInfo() {
    return array(
      'name' => 'Hide the Toolbar',
      'description' => 'Tests that the core toolbar is hidden with the administration menu is present.',
      'group' => 'Hide the Toolbar',
    );
  }

  /**
   * {@inheritdoc}
   */
  public function setup() {
    parent::setUp(array(
      'admin_menu',
      'toolbar',
      'toolbar_admin_menu',
    ));
    $this
      ->drupalLogin($this
      ->drupalCreateUser(array(
      'access toolbar',
      'access administration menu',
    )));
  }
  public function testToolbarAndAdminMenu() {

    // The admin menu is visible.
    $this
      ->assertRaw('<div id="admin-menu-wrapper">', t('The admin menu is visible.'));

    // The toolbar is not visible.
    $this
      ->assertNoRaw('<div id="toolbar" class="toolbar overlay-displace-top clearfix">', t('Toolbar is not visible.'));
  }

}

Classes