Commit 48e5a8c0 authored by chegor's avatar chegor Committed by eme

Issue #2613378 by chegor: Add basic test

parent eda63b1b
<?php
/**
* @file
* Contains \Drupal\admin_toolbar\Tests\AdminToolbarAlterTest.
*/
namespace Drupal\admin_toolbar\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Test the existence of Admin Toolbar module.
*
* @group admin_toolbar
*/
class AdminToolbarAlterTest extends WebTestBase {
/**
* A user with permission to access the administrative toolbar.
*
* @var \Drupal\user\UserInterface
*/
protected $adminUser;
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('toolbar', 'admin_toolbar', 'admin_toolbar_tools');
protected function setUp() {
parent::setUp();
// Create an administrative user and log it in.
$this->adminUser = $this->drupalCreateUser(array('access toolbar'));
$this->drupalLogin($this->adminUser);
}
/**
* Tests for a the hover of sub menus.
*/
function testAdminToolbar() {
// Get the front page.
$this->drupalGet('<front>');
$this->assertResponse(200);
// Assert that expanded links are present in HTML.
// Test with the uninstall link that must be there whatever modules exists.
$this->assertRaw('id="toolbar-link-system-modules_uninstall"');
// Test for admin_toolbar_tools if special menu items are added.
$this->assertRaw('id="toolbar-link-admin_toolbar_tools-flush"');
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment