Version 1
[yaffs-website] / web / modules / contrib / admin_toolbar / src / Tests / AdminToolbarAlterTest.php
diff --git a/web/modules/contrib/admin_toolbar/src/Tests/AdminToolbarAlterTest.php b/web/modules/contrib/admin_toolbar/src/Tests/AdminToolbarAlterTest.php
new file mode 100644 (file)
index 0000000..11cdc0f
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+
+namespace Drupal\admin_toolbar\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+
+/**
+ * Test the existence of Admin Toolbar module.
+ *
+ * @group admin_toolbar
+ */
+class AdminToolbarAlterTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['toolbar', 'breakpoint', 'admin_toolbar'];
+
+  /**
+   * A test user with permission to access the administrative toolbar.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $adminUser;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    // Create and log in an administrative user.
+    $this->adminUser = $this->drupalCreateUser([
+      'access toolbar',
+      'access administration pages',
+    ]);
+    $this->drupalLogin($this->adminUser);
+  }
+
+  /**
+   * Tests for a the hover of sub menus.
+   */
+  function testAdminToolbar() {
+    // Assert that expanded links are present in the HTML.
+    $this->assertRaw('class="toolbar-icon toolbar-icon-user-admin-index"');
+  }
+}