-
-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
If running test with a Factory create in it gives me:
Error: Typed static property Zenstruck\Foundry\Persistence\Proxy\PersistedObjectsTracker::$buffer must not be accessed before initialization
/var/www/html/vendor/zenstruck/foundry/src/Persistence/Proxy/PersistedObjectsTracker.php:53
/var/www/html/vendor/zenstruck/foundry/src/Persistence/PersistenceManager.php:89
/var/www/html/vendor/zenstruck/foundry/src/Persistence/PersistentObjectFactory.php:266
/var/www/html/vendor/zenstruck/foundry/src/Factory.php:66
/var/www/html/tests/ApiResource/DemoTest.php:21
UserFactory is a default generated factory of a simple default symfony user.
DemoTest:
<?php
declare(strict_types=1);
namespace App\Tests\ApiResource;
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use App\Factory\User\UserFactory;
use Zenstruck\Foundry\Test\Factories;
use Zenstruck\Foundry\Test\ResetDatabase;
final class DemoTest extends ApiTestCase
{
use ResetDatabase;
use Factories;
protected static ?bool $alwaysBootKernel = false;
public function testDemo():void{
$user = UserFactory::createOne();
self::assertNotNull($user);
}
}Reverting to v2.7.5 Solves the issue.
I don't have the issue when I run the whole suite, only when I run the one test or test file with phpstorm.
samuelwilk, alantheo15 and siggidiel
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working