diff --git a/src/ZenstruckFoundryBundle.php b/src/ZenstruckFoundryBundle.php index 87df05c0..e8e188be 100644 --- a/src/ZenstruckFoundryBundle.php +++ b/src/ZenstruckFoundryBundle.php @@ -261,7 +261,7 @@ public function loadExtension(array $config, ContainerConfigurator $configurator } ); - if ($resetMode === ResetDatabaseMode::MIGRATE) { + if (ResetDatabaseMode::MIGRATE === $resetMode) { $container->getDefinition(OrmResetter::class) ->replaceArgument('$configurations', $config['orm']['reset']['migrations']['configurations']) ; diff --git a/tests/Fixture/ResetDatabase/MongoResetterDecorator.php b/tests/Fixture/ResetDatabase/MongoResetterDecorator.php index 25baa539..05ab0a82 100644 --- a/tests/Fixture/ResetDatabase/MongoResetterDecorator.php +++ b/tests/Fixture/ResetDatabase/MongoResetterDecorator.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the zenstruck/foundry package. + * + * (c) Kevin Bond + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Zenstruck\Foundry\Tests\Fixture\ResetDatabase; use Symfony\Component\DependencyInjection\Attribute\AsDecorator; @@ -14,7 +23,7 @@ final class MongoResetterDecorator implements MongoResetter public static bool $calledBeforeEachTest = false; public function __construct( - private MongoResetter $decorated + private MongoResetter $decorated, ) { } diff --git a/tests/Fixture/ResetDatabase/OrmResetterDecorator.php b/tests/Fixture/ResetDatabase/OrmResetterDecorator.php index ff069737..0bd83645 100644 --- a/tests/Fixture/ResetDatabase/OrmResetterDecorator.php +++ b/tests/Fixture/ResetDatabase/OrmResetterDecorator.php @@ -2,6 +2,15 @@ declare(strict_types=1); +/* + * This file is part of the zenstruck/foundry package. + * + * (c) Kevin Bond + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Zenstruck\Foundry\Tests\Fixture\ResetDatabase; use Symfony\Component\DependencyInjection\Attribute\AsDecorator; @@ -15,8 +24,9 @@ final class OrmResetterDecorator implements OrmResetter public static bool $calledBeforeEachTest = false; public function __construct( - private OrmResetter $decorated - ) {} + private OrmResetter $decorated, + ) { + } public function resetBeforeFirstTest(KernelInterface $kernel): void { diff --git a/tests/Integration/ResetDatabase/ResetDatabaseTest.php b/tests/Integration/ResetDatabase/ResetDatabaseTest.php index e3fc34e8..304a83e0 100644 --- a/tests/Integration/ResetDatabase/ResetDatabaseTest.php +++ b/tests/Integration/ResetDatabase/ResetDatabaseTest.php @@ -16,13 +16,13 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\BufferedOutput; -use Zenstruck\Foundry\Tests\Fixture\EntityInAnotherSchema\Article; use Zenstruck\Foundry\Persistence\PersistenceManager; +use Zenstruck\Foundry\Tests\Fixture\EntityInAnotherSchema\Article; use Zenstruck\Foundry\Tests\Fixture\Factories\Document\GenericDocumentFactory; -use Zenstruck\Foundry\Tests\Fixture\ResetDatabase\MongoResetterDecorator; -use Zenstruck\Foundry\Tests\Fixture\ResetDatabase\OrmResetterDecorator; use Zenstruck\Foundry\Tests\Fixture\Factories\Entity\GenericEntityFactory; use Zenstruck\Foundry\Tests\Fixture\FoundryTestKernel; +use Zenstruck\Foundry\Tests\Fixture\ResetDatabase\MongoResetterDecorator; +use Zenstruck\Foundry\Tests\Fixture\ResetDatabase\OrmResetterDecorator; use function Zenstruck\Foundry\Persistence\persist; use function Zenstruck\Foundry\Persistence\repository;