Update tests for PHPUnit 9.6

- Avoid withConsecutive()

Bug: T342110
Change-Id: I32c7d465942c55608891165d79d22ae6e31a5aaf
This commit is contained in:
Daimona Eaytoy 2024-01-17 17:21:42 +01:00
parent 380ec9d1ce
commit 1a038072b4

View file

@ -43,9 +43,15 @@ class HookTest extends MediaWikiIntegrationTestCase {
$out = $this->getMockOutputPage();
$out->method( 'getModules' )->willReturn( [] );
$isFirstCall = true;
$out->expects( $this->exactly( $expectedAddModuleCalls ) )
->method( 'addModules' )
->withConsecutive( [ $this->equalTo( $expectedFirstModule ) ] );
->willReturnCallback( function ( $modules ) use ( $expectedFirstModule, &$isFirstCall ) {
if ( $isFirstCall ) {
$this->assertSame( $expectedFirstModule, $modules );
}
$isFirstCall = false;
} );
( new Hooks( $userOptionsLookup, $this->getServiceContainer()->getMainConfig() ) )
->onBeforePageDisplay( $out, $this->createMock( Skin::class ) );