diff --git a/web_app/composer.json b/web_app/composer.json index 61bf1a00081f7385540bf09ab7db4a8420388e9d..8c26bcb6a2cf23d9ddddbf5c4594df3075e114f7 100644 --- a/web_app/composer.json +++ b/web_app/composer.json @@ -69,6 +69,7 @@ } }, "require-dev": { + "doctrine/doctrine-fixtures-bundle": "^4.0", "symfony/maker-bundle": "^1.62" } } diff --git a/web_app/config/bundles.php b/web_app/config/bundles.php index de8898b237f4e71035c0d29d0599b62ac4f16adc..fd50f83e80f00c4d6c2b33d44d59cb966a99da7b 100644 --- a/web_app/config/bundles.php +++ b/web_app/config/bundles.php @@ -5,4 +5,5 @@ return [ Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], + Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], ]; diff --git a/web_app/src/DataFixtures/AppFixtures.php b/web_app/src/DataFixtures/AppFixtures.php new file mode 100644 index 0000000000000000000000000000000000000000..987f6fe955c778c958d11e0929d0f2526f821bb1 --- /dev/null +++ b/web_app/src/DataFixtures/AppFixtures.php @@ -0,0 +1,17 @@ +<?php + +namespace App\DataFixtures; + +use Doctrine\Bundle\FixturesBundle\Fixture; +use Doctrine\Persistence\ObjectManager; + +class AppFixtures extends Fixture +{ + public function load(ObjectManager $manager): void + { + // $product = new Product(); + // $manager->persist($product); + + $manager->flush(); + } +} diff --git a/web_app/symfony.lock b/web_app/symfony.lock index b7d02287042f435c61f251c33fed1bebf47030e1..2886e0a553eb4c08aadf8a1eb73751e9e8e42802 100644 --- a/web_app/symfony.lock +++ b/web_app/symfony.lock @@ -13,6 +13,18 @@ "src/Repository/.gitignore" ] }, + "doctrine/doctrine-fixtures-bundle": { + "version": "4.0", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.0", + "ref": "1f5514cfa15b947298df4d771e694e578d4c204d" + }, + "files": [ + "src/DataFixtures/AppFixtures.php" + ] + }, "doctrine/doctrine-migrations-bundle": { "version": "3.4", "recipe": {