Category : fixtures

I have a Fixture class which depends on 2 other classes. According to documentation, for doing so I need to implement the DependentFixtureInterface, and add a method getDependencies() returning them. And I did, however I’m getting an SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘comunidad_autonoma_id’ cannot be null error. I already cleared and warmed up the ..

Read more

I can’t not generate fixtures in my symfony project. Previoucly, I had a attribute OnetoMany and i passed to ManytoMany. I think that error comes from here. I generate my fixtures with alice fixtures bundle : https://github.com/hautelook/AliceBundle I use this commande : ./bin/console hautelook:fixtures:load –no-interaction –purge-with-truncate This result : Neither the property "productType" nor one ..

Read more

I used this documentation : https://symfony.com/doc/4.4/doctrine/multiple_entity_managers.html So now I can create new databases named legacy and Project like this doctrince.yaml: doctrine: dbal: default_connection: legacy connections: legacy: driver: pdo_mysql host: "%env(database_host)%" port: "%env(database_port)%" dbname: "%env(database_name)%" user: "%env(database_user)%" password: "%env(database_password)%" charset: UTF8 project: driver: pdo_mysql host: "%env(database_host_project)%" port: "%env(database_port_project)%" dbname: "%env(database_name_project)%" user: "%env(database_user_project)%" password: "%env(database_password_project)%" charset: UTF8 ..

Read more

I have entities which are managed by two entity managers in Symfony 4 project and I would like to load fixtures from both connections for functional tests. For instance : class AdapterTest extends KernelTestCase { use FixturesTrait; … protected function setUp(): void { self::bootKernel(); // Not working, just for example $this->loadFixtures([CounterFixtures::class], false, ‘counter’); $this->loadFixtures([CountryFixtures::class]); … ..

Read more

I am trying use the Command: php bin/console do:fixtures:load to add some dummy data in my Project. When i call the command however i get the following error. Fatal error: Uncaught SymfonyComponentDebugExceptionClassNotFoundException: Attempted to load class “BaseFixture” from namespace “AppDataFixtures”. Did you forget a “use” statement for another namespace? in K:programmingdevelopmenttestProjectappsrcDataFixturesUserFixtures.php on line 9 SymfonyComponentDebugExceptionClassNotFoundException: ..

Read more