diff --git a/tests/Fixture/TestKernel.php b/tests/Fixture/TestKernel.php index edb4ddfa..3322d0b2 100644 --- a/tests/Fixture/TestKernel.php +++ b/tests/Fixture/TestKernel.php @@ -35,6 +35,13 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load { parent::configureContainer($c, $loader); + $path = \sprintf('%s/config/%s.yaml', __DIR__, $this->getEnvironment()); + if (file_exists($path)) { + $loader->load($path); + } + + + $c->loadFromExtension('zenstruck_foundry', [ 'orm' => [ 'reset' => [ diff --git a/tests/Fixture/config/always_force.yaml b/tests/Fixture/config/always_force.yaml new file mode 100644 index 00000000..ab286dba --- /dev/null +++ b/tests/Fixture/config/always_force.yaml @@ -0,0 +1,3 @@ +zenstruck_foundry: + instantiator: + always_force_properties: true # always "force set" properties diff --git a/tests/Integration/Maker/MakeFactoryTest.php b/tests/Integration/Maker/MakeFactoryTest.php index 6330b9bb..1a98e885 100644 --- a/tests/Integration/Maker/MakeFactoryTest.php +++ b/tests/Integration/Maker/MakeFactoryTest.php @@ -439,6 +439,8 @@ public function does_not_initialize_non_settable(): void */ public function does_force_initialization_of_non_settable_with_always_force(): void { + self::bootKernel(['environment' => 'always_force']); + $tester = $this->makeFactoryCommandTester(); $tester->execute(['class' => ObjectWithNonWriteable::class, '--no-persistence' => true]);