flex icon indicating copy to clipboard operation
flex copied to clipboard

Upgrade to PHPUnit 12

Open HypeMC opened this issue 9 months ago • 7 comments

Resolves #1051

HypeMC avatar May 29 '25 21:05 HypeMC

Let's bump to v12?

nicolas-grekas avatar Oct 15 '25 08:10 nicolas-grekas

@nicolas-grekas PHPUnit 12 requires PHP 8.3, so I had to allow older versions for lower PHP versions.

HypeMC avatar Oct 15 '25 11:10 HypeMC

I did the bump to PHP >= 8.1 in #1067 Rebase needed for any follow up here :)

nicolas-grekas avatar Oct 30 '25 17:10 nicolas-grekas

I did the bump to PHP >= 8.1 in #1067 Rebase needed for any follow up here :)

@nicolas-grekas Done

HypeMC avatar Nov 01 '25 08:11 HypeMC

I forced-pushed a rebase, then realized that while tests are green, they have things to fix (one risky, and N ones?)

nicolas-grekas avatar Nov 03 '25 19:11 nicolas-grekas

@nicolas-grekas Oh, the N test are because of PHPUnit 12.5-dev, guess that's something new, I'll have to check it out.

HypeMC avatar Nov 03 '25 19:11 HypeMC

@nicolas-grekas Should be good now, see https://github.com/symfony/flex/pull/1056/commits/4dc8127fd171072fe07b47107337f2bd212c8c39.

The main issue was:

No expectations were configured for the mock object for <class>. You should refactor your test code and use a test stub instead.

Also, using $this->any() resulted in the same error, eg:

$repository = $this->createMock(InstalledRepositoryInterface::class);
$repository->expects($this->any());

HypeMC avatar Nov 19 '25 00:11 HypeMC