Closed IonBazan closed 7 months ago
I'll have a look at this 😉
@hunomina I've merged your PR up to 2.5.x
branch - would you like to change all remaining calls there? We had few features added to 2.5.x that were not present on 2.4.x.
Oh! Sure, I can have a look 😉
@hunomina I think you missed a few hidden spots where we still call them non-statically: https://github.com/doctrine/mongodb-odm/blob/5fcca6cc7e5e93bd6d2f3ee4a2f08ca9e1689939/tests/Doctrine/ODM/MongoDB/Tests/Events/PreUpdateEventArgsTest.php#L74-L110
and
There are quite camouflaged so it's really hard to spot them but we will be able to remove the $phpunit
property completely there.
Can you submit a PR fixing those for 2.4.x
?
BTW these listeners could perhaps be potentially replaced by anonymous classes.
I searched for occurrences using \$this->.*assert
this time.
I could only find two of them. PR coming right up 😄
There you go. I'll create another PR to fix 2.5.x 😉
I think we can close it here
Improvement
Currently
assert*()
calls are inconsistent between tests:self::assert*()
(preferred)static::assert*()
- good alternative for above, but tests should usually befinal
and overriding core methods is not expected$this->assert*()
- this one is invalid as assertion methods are usually staticThis should be enforced by static analysis/code style.