By mondrake on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
11.3.x
Introduced in version:
11.3.0
Issue links:
Description:
All Kernel, Functional and FunctionalJavascript tests must be executed in process isolation.
This has always been the case; up until PHPUnit 11 it was possible to require process isolation in the abstract base classes overriding the constructor, but since PHPUnit 12 this is no longer possible, so now
each concrete test class, Kernel, Functional and FunctionalJavascript, must specifiy a #[RunTestsInSeparateProcesses] attribute on the class level.
Before:
<?php
declare(strict_types=1);
namespace Drupal\Tests\announcements_feed\Functional;
use Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber;
use Drupal\Tests\BrowserTestBase;
use PHPUnit\Framework\Attributes\Group;
/**
* Defines a class for testing pages are still cacheable with dynamic page cache.
*/
#[Group('announcements_feed')]
final class AnnouncementsCacheTest extends BrowserTestBase {
After:
<?php
declare(strict_types=1);
namespace Drupal\Tests\announcements_feed\Functional;
use Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber;
use Drupal\Tests\BrowserTestBase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
/**
* Defines a class for testing pages are still cacheable with dynamic page cache.
*/
#[Group('announcements_feed')]
#[RunTestsInSeparateProcesses]
final class AnnouncementsCacheTest extends BrowserTestBase {
Impacts:
Module developers