Problem/Motivation
EntityManagerTest is infamously brittle and hard to wrangle, due to the unnecessary expectations set up on the mocks.
Proposed resolution
Rewrite using phpspec/prophecy (which is included in PHPUnit now)
Remaining tasks
N/A
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Beta eval:
Unfrozen because it will only touch tests.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2544746-entity-4.patch | 89.68 KB | tim.plunkett |
Comments
Comment #1
dawehnerEveryone will agree that this increase the developer experience of working on the entity manager.
Comment #2
tim.plunkettThere are 3 different usages I couldn't figure out.
Comment #3
tim.plunkettSo so sweet.
Comment #4
tim.plunkettOkay so prophecy doesn't have a mechanism like getMockClass() or getMockForAbstractClass(), just switching get_class($this->getMock()) to $this->getMockClass().
Comment #5
dawehnerThis is sooooo much better.
Comment #6
jibran33 use statments
Comment #7
tim.plunkettSee #2337191: Split up EntityManager into many services for a way to fix that :)
Comment #8
alexpottI've confirmed that 51 test methods are run before and after this change and that the provider have not changed. Looks good and yes anything to make changing this test easier will be nice.
Committed bf8723f and pushed to 8.0.x. Thanks!