ToolbarTest.php in Rebuild Cache Access 8
File
tests/src/Functional/ToolbarTest.php
View source
<?php
namespace Drupal\Tests\rebuild_cache_access\Functional;
use Drupal\Tests\BrowserTestBase;
class ToolbarTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
public static $modules = [
'toolbar',
'rebuild_cache_access',
];
public function testButton() {
$editor = $this
->drupalCreateUser([
'access toolbar',
]);
$this
->drupalLogin($editor);
$this
->drupalGet('');
$this
->assertSession()
->pageTextNotContains('Rebuild Cache');
$developer = $this
->drupalCreateUser([
'access toolbar',
'rebuild cache access',
]);
$this
->drupalLogin($developer);
$this
->drupalGet('');
$this
->assertSession()
->pageTextContains('Rebuild Cache');
$this
->clickLink('Rebuild Cache');
$this
->assertSession()
->pageTextContains('All caches cleared.');
}
}
Classes
Name |
Description |
ToolbarTest |
Tests rebuild_cache_access toolbar functionality. |