Comments (8)
your class name let me think that you are using Symfony2. In this case, you should use https://github.com/symfony/DoctrineFixturesBundle which autoloads the fixtures (in MyBundle\DataFixtures\ORM
) and integrates the command in the Symfony2 CLI.
from data-fixtures.
I'm using LiipFunctionalTestBundle
to load fixtures for functional test. And, it uses DoctrineFixturesBundle
to load fixtures.
I found it will throw exception when a fixture return by getDependencies()
but not add by addFixtures()
.
My suggestion is why not just add dependent fixtures automatically. For example, when we use apt-get
to install package, the dependent packages will also install automatically.
Thanks for your reply in advance.
from data-fixtures.
the bundles adds fixtures automatically when you put them in the good namespace: MyBundle\DataFixtures\ORM
(note it is DataFixtures
, not Fixtures
).
And adding fixtures automatically when they appear in the dependencies can cause some issues: what if the fixture class needs some arguments ?
from data-fixtures.
Maybe you are right. Don't you think that the exception message should be Fixture "MyBundle\DataFixtures\ORM\LoadUserData" was declared as a dependency, but it should be added in fixture loader first.
?
from data-fixtures.
yeah, the exception message can probably be improved
from data-fixtures.
@sliver please make a PR for this exception update. =)
from data-fixtures.
Improve exception message #32.
@stof I don't have idea why fixture class needs some arguments.
Since the exception message got improved, I think it's good enough.
from data-fixtures.
@sliver to inject some dependencies of the class.
And for instance, in the Symfony bundle, an extended loader is used to allow injecting the container in the class if the fixture class implement the needed interface. Someone using a different way to handle the dependencies could choose to use arguments when registering the fixtures in the loader
from data-fixtures.
Related Issues (20)
- Loading fixtures fails with DBAL 3
- ORMPurger bug in doctrine/dbal 3.x HOT 2
- Feature request: Pass group (or groups) that were used to call the fixture
- Not loading fixtures HOT 1
- Separate Fixtures Class Throws many types of errors HOT 3
- phpspec/prophecy is now explicitely needed for tests
- Allow to pass the class to getReference.
- Feature request: ORMPurger cache statements HOT 2
- ORMExecutor->execute expects diffrented class than Loader->getFixures() returns HOT 7
- Cant use an entity with ReferenceRepository if its name ends with Proxy HOT 6
- Psalm error for referenceRepository HOT 4
- Use of ObjectManager->getClassMetadata on the className in ReferenceRepository methods breaks expected behaviour
- Why ObjectManager instead of EntityManagerInterface? HOT 2
- PHPStan error when using AbstractFixture getReference HOT 2
- ReferenceRepository won't work with more than one EntityManager HOT 4
- Purging of tables with multiple mapped entities HOT 2
- LifecycleEventArgs::getEntity() is deprecated (used in ORMReferenceListener) HOT 3
- Problem with dot in table name when using SQLite HOT 4
- Implicit transaction commit in mysql TRUNCATE causes error "There is no active transaction."
- Persistent ReferenceRepository to be used in tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from data-fixtures.