Mercurial > hg > isophonics-drupal-site
view core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
line wrap: on
line source
<?php namespace Drupal\Tests\toolbar\FunctionalJavascript; use Drupal\FunctionalJavascriptTests\JavascriptTestBase; /** * Tests the JavaScript functionality of the toolbar. * * @group toolbar */ class ToolbarIntegrationTest extends JavascriptTestBase { /** * {@inheritdoc} */ public static $modules = ['toolbar', 'node']; /** * Tests if the toolbar can be toggled with JavaScript. */ public function testToolbarToggling() { $admin_user = $this->drupalCreateUser([ 'access toolbar', 'administer site configuration', 'access content overview', ]); $this->drupalLogin($admin_user); $this->drupalGet('<front>'); $page = $this->getSession()->getPage(); // Test that it is possible to toggle the toolbar tray. $content = $page->findLink('Content'); $this->assertTrue($content->isVisible(), 'Toolbar tray is open by default.'); $page->clickLink('Manage'); $this->assertFalse($content->isVisible(), 'Toolbar tray is closed after clicking the "Manage" link.'); $page->clickLink('Manage'); $this->assertTrue($content->isVisible(), 'Toolbar tray is visible again after clicking the "Manage" button a second time.'); // Test toggling the toolbar tray between horizontal and vertical. $tray = $page->findById('toolbar-item-administration-tray'); $this->assertFalse($tray->hasClass('toolbar-tray-vertical'), 'Toolbar tray is not vertically oriented by default.'); $page->pressButton('Vertical orientation'); $this->assertTrue($tray->hasClass('toolbar-tray-vertical'), 'After toggling the orientation the toolbar tray is now displayed vertically.'); $page->pressButton('Horizontal orientation'); $this->assertTrue($tray->hasClass('toolbar-tray-horizontal'), 'After toggling the orientation a second time the toolbar tray is displayed horizontally again.'); } }