Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
bbd0ad5 to
9538859
Compare
|
|
||
| protected function tearDown(): void | ||
| { | ||
| if (! class_exists(PersistentObject::class)) { |
There was a problem hiding this comment.
Is this really required?
orm/tests/Tests/OrmFunctionalTestCase.php
Lines 542 to 545 in 31e6a1d
There was a problem hiding this comment.
Ah I didn't see this. But no, it no longer handles this gracefully when running the whole test suite, so maybe sharedConn now persists between tests.
There was a problem hiding this comment.
@xabbuh I debugged it, and sharedConn is always set.
Moreover, using this code:
protected function tearDown(): void
{
try {
parent::tearDown();
} catch (\Throwable $e) {
var_dump($e->getMessage());
}
}
With PHPUnit 10
prints this:
string(41) "Call to a member function clear() on null"
So the same issue exists with both versions of PHPUnit, it's just that for some reason, PHPUnit 10 swallows the exception.
There was a problem hiding this comment.
I replaced the commit that introduce this change with another that acts at the OrmFunctionalTestCase level, by also checking $this->_em.
There was a problem hiding this comment.
Ah that explains it probably: sebastianbergmann/phpunit#6281
It has been deprecated.
self::returnValue() and self::onConsecutiveCalls() has been deprecated.
It has been deprecated.
It seems that this could happen with PHPUnit 10, then tearDown() would crash when calling `clear()` on null, but then PHPUnit 10 did not show that exception.
This upgrades to PHPUnit 11 and addresses all newly emitted deprecations.