Unverified Commit 305c401f authored by alexpott's avatar alexpott
Browse files

Issue #3110874 by andypost, longwave, Berdir: Remove BC layer for TestSetupTrait

parent b449be6d
......@@ -400,6 +400,9 @@ protected function initKernel(Request $request) {
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The container.
*
* @throws \Exception
* If the test case does not initialize default theme.
*/
protected function installDefaultThemeFromClassProperty(ContainerInterface $container) {
// Use the install profile to determine the default theme if configured and
......@@ -420,11 +423,7 @@ protected function installDefaultThemeFromClassProperty(ContainerInterface $cont
// Require a default theme to be specified at this point.
if (!isset($this->defaultTheme)) {
// For backwards compatibility, tests using the 'testing' install profile
// on Drupal 8 automatically get 'classy' set, and other profiles use
// 'stark'.
@trigger_error('Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.', E_USER_DEPRECATED);
$this->defaultTheme = $profile === 'testing' ? 'classy' : 'stark';
throw new \Exception('Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.');
}
// Ensure the default theme is installed.
......
......@@ -12,6 +12,11 @@
*/
class LegacyStyleSheetsRemoveTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
......
......@@ -15,6 +15,11 @@
class NoPreExistingSchemaUpdateTest extends BrowserTestBase {
use UpdatePathTestTrait;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
protected function setUp() {
parent::setUp();
$connection = Database::getConnection();
......
......@@ -12,6 +12,11 @@ class JavascriptDeprecationTest extends WebDriverTestBase {
public static $modules = ['js_deprecation_test'];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* @expectedDeprecation Javascript Deprecation: This function is deprecated for testing purposes.
* @expectedDeprecation Javascript Deprecation: This property is deprecated for testing purposes.
......
......@@ -19,6 +19,11 @@ class AssertLegacyTraitDeprecatedTest extends BrowserTestBase {
*/
public static $modules = ['form_test'];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests getAllOptions().
*
......
......@@ -15,6 +15,11 @@ class PhpUnitBridgeTest extends BrowserTestBase {
protected static $modules = ['deprecation_test'];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* @expectedDeprecation This is the deprecation message for deprecation_test_function().
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment