Comments (4)
Maybe it will be worth having an option to choose to clear UnitOfWork
contents or not (e.g. via separate property), so library users will at least have control over this aspect? It may default to not clear to keep current behavior intact. It may also have an explanation of its meaning and reasons for its existence as a comment so it will be easier to understand.
At the very minimum, it needs to be mentioned in the documentation that the identity map in UnitOfWork
is not empty by the time of the start of the test and that it may affect the behavior of the tested application. It took me several hours to find out the reason for the test failure which was caused by current behavior, so at least knowing about this aspect is practical.
from alicebundle.
I am not sure this can be changed. IIRC there was in the past an attempt made there, but I had to revert it because it was breaking too many things.
Indeed you can get the objects from the loader in your tests in which case you want persisted objects. If you do the clear you will end up with objects you will have to persist manually
from alicebundle.
yea because with a lot of releations the entitys does not filled up correctly.
i run into this issue: the roles doesn't load into the user entity.
from alicebundle.
If you need a clear it's best to do it yourself. If it's systematic you can create a decorator service to handle this.
Otherwise you use the service to load objects and you expect those objects to be in a managed state. If not, you would need to reattach all of them.
from alicebundle.
Related Issues (20)
- Fixture directory structure HOT 4
- Clear entity manager HOT 5
- I need help with this error HOT 2
- RefreshDatabaseTrait repopulates the database on every new TestCase HOT 5
- bin/console hautelook:fixtures:load for only data base test HOT 1
- You have requested a non-existent service "hautelook_alice.loader". HOT 1
- Support for doctrine/persistence 3.0
- Fetch() method does not exist anymore with DBAL3 HOT 1
- Release 2.11.0 not available on packagist HOT 2
- Refresh Trait does not Refresh MongoDB HOT 1
- RefreshDatabaseTrait is not executed in time HOT 11
- Support fixtures in JSON format HOT 1
- Load only specific fixtures files in test HOT 2
- Getting an entity inside a test when RefreshDatabaseTrait is used, strange behaviour? HOT 1
- Non exiting service Doctrine\Common\Persistence\ManagerRegistry
- Deprecation warning "Nesting transactions without enabling savepoints is deprecated."
- There are no commands defined in the "hautelook:fixtures" namespace HOT 2
- Allow Doctrine ORM v3 HOT 2
- Complete reference to random data functions + related pre-existing entity in database HOT 1
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 alicebundle.