Skip to content

Calling a fixtures load inside of a class #336

@geoff-maddock

Description

@geoff-maddock

If I run a fixtures load command from the command line, it works as expected:

/srv/api # php bin/console doctrine:fixtures:load

 Careful, database "powerdns" will be purged. Do you want to continue? (yes/no) [no]:
 > yes

   > purging database
   > loading App\DataFixtures\AppFixtures

But if I set up and call the load method, no data is loaded:

        $fixture = new AppFixtures();
        $fixture->load($this->entityManager);

Is there a way to manually load fixtures data like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions