Problem/Motivation

The migrate_file module's tests are failing due to a missing `$defaultTheme` property in the test classes that extend `BrowserTestBase`. BTB based tests not specifying defaultTheme has been deprecated since Drupal 8.8. Will soldily break in D10 -- see changelog.

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';

CommentFileSizeAuthor
#2 3365696-fix-default-theme.patch511 bytessandrymend

Comments

sandrymend created an issue. See original summary.

sandrymend’s picture

StatusFileSize
new511 bytes
sandrymend’s picture

Title: Drupal\Tests\BrowserTestBase::$defaultTheme is required. » BrowserTestBase::$defaultTheme is required.
nickdickinsonwilde’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community

LGTM

  • drclaw committed b404a82d on 2.1.x
    Issue #3365696 by sandrymend: BrowserTestBase::$defaultTheme is required
    
drclaw’s picture

Status: Reviewed & tested by the community » Fixed

Thank you everyone! This is in the newest 2.1.3 release 😁🙏

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.