Coder Social home page Coder Social logo

Comments (5)

klodoma avatar klodoma commented on May 26, 2024 1

I think so, as I didn't followed it up. Let's close this.

from liiptestfixturesbundle.

alexislefebvre avatar alexislefebvre commented on May 26, 2024

Please share the code of your fixture.

What version of Symfony do you use ?

Do you use autowiring of services? It can work for your case: https://github.com/liip/LiipFunctionalTestBundle/issues/504#issuecomment-480640875

from liiptestfixturesbundle.

klodoma avatar klodoma commented on May 26, 2024

Please share the code of your fixture.

What version of Symfony do you use ?

Do you use autowiring of services? It can work for your case: liip/LiipFunctionalTestBundle#504 (comment)

I'm playing around with the symfony demo app, so it's Symfony 5. But with Symfony 4 I get the same issue.
Have a look here for the test and fixture:
https://github.com/klodoma/symfony-demo/tree/master/tests/DataFixtures

I have the impression that the problem comes from the fact that the fixture is not found in /src/DataFixtures because with that it works.

from liiptestfixturesbundle.

alexislefebvre avatar alexislefebvre commented on May 26, 2024

I have the impression that the problem comes from the fact that the fixture is not found in /src/DataFixtures because with that it works.

IIRC, this bundle relies on DoctrineFixturesBundle. According to its documentation:

This command looks for all services tagged with doctrine.fixture.orm. If you're using the default service configuration, any class that implements ORMFixtureInterface (for example, those extending from Fixture) will automatically be registered with this tag.

Source: https://symfony.com/doc/master/bundles/DoctrineFixturesBundle/index.html#loading-fixtures

Maybe the class should implement ORMFixtureInterface, but maybe it' not enough to declare fixtures in tests/.

Here is how they are declared in internal tests, with a service tag:

Liip\Acme\Tests\App\DataFixtures\ORM\:
resource: 'DataFixtures/ORM/*'
tags: ['doctrine.fixture.orm']

Maybe you can use a config like this in your config_test.yml in order to declare fixtures that are not in src/.

from liiptestfixturesbundle.

alexislefebvre avatar alexislefebvre commented on May 26, 2024

Did the last comment helped you?

from liiptestfixturesbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.