AdminToolbarAlterTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Drupal\Tests\admin_toolbar\Functional;
  3. use Drupal\Tests\BrowserTestBase;
  4. /**
  5. * Test the existence of Admin Toolbar module.
  6. *
  7. * @group admin_toolbar
  8. */
  9. class AdminToolbarAlterTest extends BrowserTestBase {
  10. /**
  11. * Modules to enable.
  12. *
  13. * @var array
  14. */
  15. protected static $modules = [
  16. 'toolbar',
  17. 'breakpoint',
  18. 'admin_toolbar',
  19. ];
  20. /**
  21. * A test user with permission to access the administrative toolbar.
  22. *
  23. * @var \Drupal\user\UserInterface
  24. */
  25. protected $adminUser;
  26. /**
  27. * {@inheritdoc}
  28. */
  29. protected function setUp() {
  30. parent::setUp();
  31. // Create and log in an administrative user.
  32. $this->adminUser = $this->drupalCreateUser([
  33. 'access toolbar',
  34. 'access administration pages',
  35. ]);
  36. $this->drupalLogin($this->adminUser);
  37. }
  38. /**
  39. * Tests for a the hover of sub menus.
  40. */
  41. public function testAdminToolbar() {
  42. // Assert that expanded links are present in the HTML.
  43. $this->assertRaw('class="toolbar-icon toolbar-icon-user-admin-index"');
  44. }
  45. }