Commit 34609f93 authored by esod's avatar esod Committed by eme

Issue #2707789 by esod: Fix Automated Tests

parent 3d180b64
......@@ -2,46 +2,46 @@
/**
* @file
* Contains \Drupal\admin_toolbar\Tests\AdminToolbarAlterTest.
* Definition of Drupal\admin_toolbar_tools\Tests\AdminToolbarToolsAlterTest.
*/
namespace Drupal\admin_toolbar_tools\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Test the existence of Admin Toolbar tools new links.
* Tests for the existence of Admin Toolbar tools new links.
*
* @group admin_toolbar_tools
* @group admin_toolbar
*/
class AdminToolbarToolsAlterTest extends WebTestBase {
/**
* A user with permission to access the administrative toolbar.
* Modules to enable.
*
* @var \Drupal\user\UserInterface
* @var array
*/
protected $adminUser;
public static $modules = ['toolbar', 'admin_toolbar', 'admin_toolbar_tools'];
/**
* Modules to enable.
* A test user with permission to access the administrative toolbar.
*
* @var array
* @var \Drupal\user\UserInterface
*/
public static $modules = array(
'toolbar',
'admin_toolbar',
'admin_toolbar_tools'
);
protected $adminUser;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
// Create an administrative user and log it in.
$this->adminUser = $this->drupalCreateUser(array(
'access toolbar',
'access administration pages'
));
// Create and log in an administrative user.
$this->adminUser = $this->drupalCreateUser([
'access toolbar',
'access administration pages',
]);
$this->drupalLogin($this->adminUser);
}
......@@ -49,10 +49,7 @@ class AdminToolbarToolsAlterTest extends WebTestBase {
* Tests for a the hover of sub menus.
*/
function testAdminToolbarTools() {
// Test for admin_toolbar_tools if special menu items are added.
$this->assertRaw('id="toolbar-link-admin_toolbar_tools-flush"');
// Assert that special menu items are present in the HTML.
$this->assertRaw('class="toolbar-icon toolbar-icon-admin-toolbar-tools-flush"');
}
}
......@@ -9,6 +9,7 @@ namespace Drupal\admin_toolbar\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Test the existence of Admin Toolbar module.
*
......@@ -17,24 +18,30 @@ use Drupal\simpletest\WebTestBase;
class AdminToolbarAlterTest extends WebTestBase {
/**
* A user with permission to access the administrative toolbar.
* Modules to enable.
*
* @var \Drupal\user\UserInterface
* @var array
*/
protected $adminUser;
public static $modules = ['toolbar', 'breakpoint', 'admin_toolbar'];
/**
* Modules to enable.
* A test user with permission to access the administrative toolbar.
*
* @var array
* @var \Drupal\user\UserInterface
*/
public static $modules = array('toolbar', 'admin_toolbar');
protected $adminUser;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
// Create an administrative user and log it in.
$this->adminUser = $this->drupalCreateUser(array('access toolbar', 'access administration pages'));
// Create and log in an administrative user.
$this->adminUser = $this->drupalCreateUser([
'access toolbar',
'access administration pages',
]);
$this->drupalLogin($this->adminUser);
}
......@@ -42,10 +49,7 @@ class AdminToolbarAlterTest extends WebTestBase {
* Tests for a the hover of sub menus.
*/
function testAdminToolbar() {
// Assert that expanded links are present in HTML.
// Test with the site configuration link that must be there whatever modules exists.
$this->assertRaw('id="toolbar-link-system-admin_config_system"');
// Assert that expanded links are present in the HTML.
$this->assertRaw('class="toolbar-icon toolbar-icon-user-admin-index"');
}
}
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