From 51be0a2db0e292448f9dd8d09c5d97c43091ef5a Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Thu, 16 Jan 2025 14:40:14 +0100 Subject: [PATCH] Update tests/Integration/Maker/MakeFactoryTest.php Co-authored-by: Nicolas PHILIPPE --- tests/Integration/Maker/MakeFactoryTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/Integration/Maker/MakeFactoryTest.php b/tests/Integration/Maker/MakeFactoryTest.php index 5613eb8e..a1b636c4 100644 --- a/tests/Integration/Maker/MakeFactoryTest.php +++ b/tests/Integration/Maker/MakeFactoryTest.php @@ -129,10 +129,17 @@ public function can_create_factory_in_test_dir_with_nested_factory_already_creat } $tester = $this->makeFactoryCommandTester(); - $tester->execute(['class' => Contact::class, '--test' => true]); - $tester->execute(['class' => Address::class, '--test' => true]); + + $tester->execute(['class' => Contact::class, '--test' => true]); + $this->assertFileExists(self::tempFile('tests/Factory/ContactFactory.php')); $this->assertFileExists(self::tempFile('tests/Factory/AddressFactory.php')); + + // here, we're faking multiple calls to `bin/console make:factory` + // so it's perfectly acceptable to manually load the newly created class + require_once self::tempFile('tests/Factory/AddressFactory.php'; + + $tester->execute(['class' => Address::class, '--test' => true]); } /**