Skip to content

Loading…

DDC-1641: [Tests] Wrong tearDown() in UnitOfWorkTest #2283

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user zerkms:

root@ubuntu-server-1110:/home/zerkms/src/doctrine2# phpunit
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /home/zerkms/src/doctrine2/phpunit.xml.dist

.SSSSSS.........................EEEEEEEEEEEEEEEEEEEEEEEEEEEEE 61 / 1472 ( 4%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.EEESE...SSSEEEEEEEEEEEEEE 122 / 1472 ( 8%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 183 / 1472 ( 12%)
.EEEEEEESSESESEESESEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFEEEEE 244 / 1472 ( 16%)
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESE 305 / 1472 ( 20%)
SSSEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFEEEEEEEEEEEEEEEEEE 366 / 1472 ( 24%)
EEEEEEEEEEESSSEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSS 427 / 1472 ( 29%)
SSSS...........SEEEEEEEEEEEEEEEEEEEEEEEEEESEEESEEEEEEEEEEEEEE 488 / 1472 ( 33%)
EEEEEEEEEEEEEEEEEEEEEEEEESEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 549 / 1472 ( 37%)
EEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEEEEEE.EEEEEEEEEEESSEEEEEEEEEEE 610 / 1472 ( 41%)
EEEEEEEEEEEEEEEEEEEEEEEEEE................................... 671 / 1472 ( 45%)
............................................................. 732 / 1472 ( 49%)
............................................................. 793 / 1472 ( 53%)
.............................................S............... 854 / 1472 ( 58%)
......S...................................................... 915 / 1472 ( 62%)
............................................................. 976 / 1472 ( 66%)
............................................................. 1037 / 1472 ( 70%)
............................................................. 1098 / 1472 ( 74%)
............................................................. 1159 / 1472 ( 78%)
............................................................. 1220 / 1472 ( 82%)
............................................................. 1281 / 1472 ( 87%)
............................................................. 1342 / 1472 ( 91%)
...........................S............S.................... 1403 / 1472 ( 95%)
.................................SSSSSSSS.PHP Fatal error: Class 'Doctrine\Tests\Mocks\EntityPersisterMock' not found in /home/zerkms/src/doctrine2/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php on line 55

This (the fatal error) happens because of in ORM/Tools/SetupTest there is a condition in setUp() that marks test as skipped, but tearDown() is being invoked anyway (that is how phpunit works).

So tearDown() should run only in case if setUp() hasn't skipped the test, otherwise tearDown() deletes registered autoloaders

PS: other tests failed because I haven't set up any database

@doctrinebot

Comment created by @beberlei:

Fixed.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.