AdminToolbarToolsAlterTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Drupal\Tests\admin_toolbar_tools\Functional;
  3. use Drupal\Tests\BrowserTestBase;
  4. /**
  5. * Tests for the existence of Admin Toolbar tools new links.
  6. *
  7. * @group admin_toolbar
  8. */
  9. class AdminToolbarToolsAlterTest extends BrowserTestBase {
  10. /**
  11. * Modules to enable.
  12. *
  13. * @var array
  14. */
  15. protected static $modules = [
  16. 'toolbar',
  17. 'admin_toolbar',
  18. 'admin_toolbar_tools',
  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. 'administer site configuration',
  36. ]);
  37. $this->drupalLogin($this->adminUser);
  38. }
  39. /**
  40. * Tests for the hover of sub menus.
  41. */
  42. public function testAdminToolbarTools() {
  43. // Assert that special menu items are present in the HTML.
  44. $this->assertRaw('class="toolbar-icon toolbar-icon-admin-toolbar-tools-flush"');
  45. }
  46. }