mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #8552] Fix remaining warnings from the phpunit9 upgrade #11063
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/8552
State: closed
Merged: Yes
Some tests were still using deprecated assertion and mocking methods,
resulting in a long list of warnings in the phpunit output.
This commit resolves all the warnings:
Fixes a couple of test names in
@dependstags (presumably thesetests were renamed at some point for coding standards).
Changes how mocks are configured when asserting the same method
is called multiple times with a sequence of arguments / sequence
of return values. The old
->atexpectation is deprecated becauseit can be brittle and give unreliable results. Some of this
mocking could probably still be refactored further, but my focus
was on solving the deprecation with the existing setup.
Removes one use of prophecy for mocking, in favour of using
phpunit mock objects. Prophecy now requires an extra composer
dependency and a trait which seems overkill given it was only
used in one place.
Updates to the new names for assertFileExists and assertRegExp
(and their
notversions) - these are functionally equivalent.Replaces the last few references to old PHPUnit_Framework_XXX
classes with their namespaced equivalent. These were mostly in
comments, or in native php
assert()statements that were sanitychecking mocked object types. These asserts are probably redundant
(and are clearly not running in CI since the classes they referenced
no longer exist).