8000 GitHub - ch3ric/BlogTestsIsolation: Tests isolation
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ch3ric/BlogTestsIsolation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests isolation with Symfony and Doctrine

As described there by Alexandre Salomé, you might want to rollback the database changes executed during your tests.

But you'll get the following error, if you want to test a Doctrine event listener in a functional test:

Uncaught PHP Exception InvalidArgumentException: "Entity has to be managed or scheduled for removal for single computation Cheric\ExampleBundle\Entity\Article@00000000055581e0000000001ac20431" at /home/cherik/BlogIsolationTests/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 427

To fix this, you'll need to use the correct EventManager in your DBAL Connection when keeping the same connection between Symfony requests in your tests.

Releases

No releases published

Packages

No packages published
0