diff options
author | Daimona Eaytoy <daimona.wiki@gmail.com> | 2021-03-20 16:18:58 +0100 |
---|---|---|
committer | Daimona Eaytoy <daimona.wiki@gmail.com> | 2021-04-16 20:15:00 +0200 |
commit | 535d7abf592d671c22bfb8ba17c35ae1ff74c0a5 (patch) | |
tree | 628ec543a5c64121cdaad15a8b51a3705355e1b7 /tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php | |
parent | 592bb57b31b89a3863671da2f26df4f95011ba7c (diff) | |
download | mediawikicore-535d7abf592d671c22bfb8ba17c35ae1ff74c0a5.tar.gz mediawikicore-535d7abf592d671c22bfb8ba17c35ae1ff74c0a5.zip |
phpunit: Mass-replace setMethods with onlyMethods and adjust
Ended up using
grep -Prl '\->setMethods\(' . | xargs sed -r -i 's/setMethods\(/onlyMethods\(/g'
special-casing setMethods( null ) -> onlyMethods( [] )
and then manual fix of failing test (from PS2 onwards).
Bug: T278010
Change-Id: I012dca7ae774bb430c1c44d50991ba0b633353f1
Diffstat (limited to 'tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php')
-rw-r--r-- | tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php index 8d60486778a9..3cc22e515643 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php @@ -232,7 +232,7 @@ mw.loader.register([ 'test.fail' => [ 'factory' => function () { $mock = $this->getMockBuilder( ResourceLoaderTestModule::class ) - ->setMethods( [ 'getVersionHash' ] )->getMock(); + ->onlyMethods( [ 'getVersionHash' ] )->getMock(); $mock->method( 'getVersionHash' )->will( $this->throwException( new Exception ) ); @@ -260,7 +260,7 @@ mw.loader.state({ 'test.version' => [ 'factory' => function () { $mock = $this->getMockBuilder( ResourceLoaderTestModule::class ) - ->setMethods( [ 'getVersionHash' ] )->getMock(); + ->onlyMethods( [ 'getVersionHash' ] )->getMock(); $mock->method( 'getVersionHash' )->willReturn( '12345' ); return $mock; } @@ -283,7 +283,7 @@ mw.loader.register([ 'test.version' => [ 'factory' => function () { $mock = $this->getMockBuilder( ResourceLoaderTestModule::class ) - ->setMethods( [ 'getVersionHash' ] )->getMock(); + ->onlyMethods( [ 'getVersionHash' ] )->getMock(); $mock->method( 'getVersionHash' )->willReturn( '12345678' ); return $mock; } |