ClaroTest.php in Drupal 9
File
core/tests/Drupal/FunctionalTests/Theme/ClaroTest.php
View source
<?php
namespace Drupal\FunctionalTests\Theme;
use Drupal\Tests\BrowserTestBase;
class ClaroTest extends BrowserTestBase {
protected static $modules = [
'shortcut',
];
protected $defaultTheme = 'claro';
public function testRegressionMissingElementsCss() {
$this
->drupalGet('');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->responseContains('claro/css/base/elements.css');
}
public function testConfigSchema() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('admin/modules');
$this
->assertSession()
->elementNotExists('css', '#block-claro-help');
\Drupal::service('module_installer')
->install([
'block',
'help',
]);
$this
->rebuildAll();
$this
->drupalGet('admin/modules');
$this
->assertSession()
->elementExists('css', '#block-claro-help');
}
public function testIsUninstallable() {
$this
->drupalLogin($this
->drupalCreateUser([
'access administration pages',
'administer themes',
]));
$this
->drupalGet('admin/appearance');
$this
->cssSelect('a[title="Install Seven as default theme"]')[0]
->click();
$this
->cssSelect('a[title="Uninstall Claro theme"]')[0]
->click();
$this
->assertSession()
->pageTextContains('The Claro theme has been uninstalled.');
}
}