class LegacyStyleSheetsRemoveTest
Same name and namespace in other branches
- 8.9.x core/modules/system/tests/src/Functional/Theme/LegacyStyleSheetsRemoveTest.php \Drupal\Tests\system\Functional\Theme\LegacyStyleSheetsRemoveTest
Tests the legacy stylesheets-remove key.
@group system @group legacy
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\Theme\LegacyStyleSheetsRemoveTest implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of LegacyStyleSheetsRemoveTest
File
-
core/
modules/ system/ tests/ src/ Functional/ Theme/ LegacyStyleSheetsRemoveTest.php, line 13
Namespace
Drupal\Tests\system\Functional\ThemeView source
class LegacyStyleSheetsRemoveTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
\Drupal::service('theme_installer')->install([
'test_legacy_stylesheets_remove',
]);
}
/**
* Tests the stylesheets-remove key.
*
* @throws \Behat\Mink\Exception\ExpectationException
*/
public function testStyleSheetsRemove() {
$this->expectDeprecation('The theme info key stylesheets-remove implemented by theme test_legacy_stylesheets_remove is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/2497313');
\Drupal::configFactory()->getEditable('system.theme')
->set('default', 'classy')
->save();
$this->drupalGet('<front>');
$this->assertSession()
->responseContains('css/components/action-links.css?');
$this->assertSession()
->responseContains('css/components/breadcrumb.css?');
\Drupal::configFactory()->getEditable('system.theme')
->set('default', 'test_legacy_stylesheets_remove')
->save();
$this->drupalGet('<front>');
$this->assertSession()
->responseNotContains('css/components/action-links.css?');
$this->assertSession()
->responseContains('css/components/breadcrumb.css?');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.