WebprofilerTestBase.php in Devel 4.x
File
webprofiler/tests/src/FunctionalJavascript/WebprofilerTestBase.php
View source
<?php
namespace Drupal\Tests\webprofiler\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
abstract class WebprofilerTestBase extends WebDriverTestBase {
protected $defaultTheme = 'stark';
protected function waitForToolbar() {
$assert_session = $this
->assertSession();
$assert_session
->waitForText(\Drupal::VERSION);
}
protected function loginForToolbar() {
$admin_user = $this
->drupalCreateUser([
'view webprofiler toolbar',
]);
$this
->drupalLogin($admin_user);
}
protected function loginForDashboard() {
$admin_user = $this
->drupalCreateUser([
'view webprofiler toolbar',
'access webprofiler',
]);
$this
->drupalLogin($admin_user);
}
protected function flushCache() {
$module_handler = \Drupal::moduleHandler();
$module_handler
->invokeAll('cache_flush');
}
}