I'm working on a modular project (app\Modules\*MyModule*) and my pest tests are in app\Modules\*MyModule*\Tests\Feature.
On Laravel 10.x and Pest 1.x with global datasets.
Now i'm upgrading Pest on 2.x., and my global datasets (mostly different kind of users) are broken ! (tests\Datasets\Users.php)
dataset('Super-administrator 2FA enabled', function () {
return [
'Super Administrator' => [
function () {
return User::factory()->with2faEnabled()->create(['role' => 'super-admin']);
}
],
];
});
Terminal error : Typed static property P\App\Modules\xx\Tests\Feature\XxxxTest::$__latestDescription must not be accessed before initialization.
After research and tests (fresh L10 install and Pest2), it's seem impossible !
A copy of my dataset directly in the test file works.
A dataset file in tests\Datasets.php or tests\Datasets\Users.php works for "root" tests in \tests\Feature**.php.
Never in module folder :(
Any ideas or tips ?
Thanks