ToolbarTest.php in Devel 8.2
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
->pageTextContains(\Drupal::VERSION);
$assert
->pageTextContains('Configure Webprofiler');
$assert
->pageTextContains('View latest reports');
$assert
->pageTextContains('Drupal Documentation');
$assert
->pageTextContains('Get involved!');
}
public function testToolbarReportPage() {
$this
->loginForDashboard();
$this
->drupalGet('<front>');
$token = $this
->waitForToolbar();
$this
->drupalGet('admin/reports/profiler/list');
$assert = $this
->assertSession();
$assert
->pageTextContains($token);
}
public function testToolbarNotAppearsOnExcludedPath() {
$this
->loginForDashboard();
$this
->drupalGet('admin/config/development/devel');
$token = $this
->waitForToolbar();
$assert = $this
->assertSession();
$assert
->pageTextContains($token);
$assert
->pageTextContains('Configure Webprofiler');
$this
->config('webprofiler.config')
->set('exclude', '/admin/config/development/devel')
->save();
$this
->drupalGet('admin/config/development/devel');
$this
->assertSession()
->pageTextNotContains('sf-toolbar');
}
}
Classes
Name |
Description |
ToolbarTest |
Tests the JavaScript functionality of webprofiler. |