-
-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
Description
Hi @nikophil, I saw you made #648 and I think I have an edge case.
I'm using foundry and phpunit, I have added the extension
<bootstrap class="Zenstruck\Foundry\PHPUnit\FoundryExtension" />
When using
DeploymentFactory::createOne()->getName();
in a Dataprovider of a TestCase (I didn't try a WebTestCase, my use case is a unit test ATM) I'm getting a segmentation fault.
This occurs with the following factory
final class DeploymentFactory extends PersistentProxyObjectFactory
{
public static function class(): string
{
return Deployment::class;
}
/**
* @return array<string, mixed>
*/
protected function defaults(): array
{
$countryCode = self::faker()->countryCode();
return [
'id' => $countryCode,
'name' => self::faker()->word(),
'engineDomain' => 'api.'.$countryCode.'.weglot.com',
'frontDomain' => 'app.'.$countryCode.'.weglot.com',
];
}
}
As soon as I change the PersistentProxyObjectFactory into a PersistentObjectFactory the issue is solved.