ToolbarTest.php in Devel 8.3
File
webprofiler/tests/src/FunctionalJavascript/ToolbarTest.php
View source
<?php
namespace Drupal\Tests\webprofiler\FunctionalJavascript;
class ToolbarTest extends WebprofilerTestBase {
public static $modules = [
'webprofiler',
'node',
];
public function setUp() {
parent::setUp();
\Drupal::configFactory()
->getEditable('system.site')
->set('page.front', '/node')
->save(TRUE);
}
public function testToolbarOnFrontPage() {
$this
->loginForToolbar();
$this
->drupalGet('<front>');
$this
->waitForToolbar();
$assert = $this
->assertSession();
$assert
->responseContains('Configure Webprofiler');
$assert
->responseContains('View latest reports');
$assert
->responseContains('Drupal Documentation');
$assert
->responseContains('Get involved!');
}
public function testToolbarReportPage() {
$this
->loginForDashboard();
$this
->drupalGet('<front>');
$this
->drupalGet('admin/reports/profiler/list');
}
public function testToolbarNotAppearsOnExcludedPath() {
$this
->loginForDashboard();
$this
->drupalGet('admin/config/development/devel');
$this
->waitForToolbar();
$assert = $this
->assertSession();
$assert
->responseContains('Configure Webprofiler');
$this
->config('webprofiler.config')
->set('exclude', '/admin/config/development/devel')
->save();
$this
->drupalGet('admin/config/development/devel');
$this
->assertSession()
->responseNotContains('sf-toolbar');
}
}
Classes
Name |
Description |
ToolbarTest |
Tests the JavaScript functionality of webprofiler. |