Drupal\Tests\BrowserTestBase::$defaultTheme is required.

Created on 8 June 2023, almost 2 years ago

Problem/Motivation

The migrate_file module's tests are failing due to a missing `$defaultTheme` property in the test classes that extend `BrowserTestBase`. This issue arose due to changes in Drupal 9.5.9 which require a default theme to be specified in all test classes. Failure to fix this issue would prevent the module from being fully compatible with Drupal 10 and might cause further issues in the future.

<!--break-->

Steps to reproduce

1. Install the migrate_file module on a Drupal 9 or 10 setup.
2. Run PHPStan analysis on the module using the command: `php vendor/bin/phpstan analyse web/modules/contrib/migrate_file --level 2`.
3. Observe the error message indicating that `$defaultTheme` is required in `LoadTest.php`.

Proposed resolution

Add the following line to all test classes extending `BrowserTestBase`:

```php
protected $defaultTheme = 'stark';

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States sandrymend

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024