Remove useless ->expects( $this->any() ) or use $this->once()

Change-Id: Icfb5a6294f86a108c66c872270de0f0205596b4d
This commit is contained in:
Fomafix 2024-03-09 21:21:25 +00:00
parent 0ca85691dd
commit 916ead077f

View file

@ -57,7 +57,7 @@ class MinervaPagePermissionsTest extends MediaWikiIntegrationTestCase {
$contentHandlerFactory = $this->createMock( IContentHandlerFactory::class ); $contentHandlerFactory = $this->createMock( IContentHandlerFactory::class );
$contentHandlerFactory->expects( $this->any() ) $contentHandlerFactory->expects( $this->once() )
->method( 'getContentHandler' ) ->method( 'getContentHandler' )
->willReturn( $contentHandler ); ->willReturn( $contentHandler );
@ -210,7 +210,7 @@ class MinervaPagePermissionsTest extends MediaWikiIntegrationTestCase {
$title->expects( $this->once() ) $title->expects( $this->once() )
->method( 'isMainPage' ) ->method( 'isMainPage' )
->willReturn( false ); ->willReturn( false );
$title->expects( $this->any() ) $title->expects( $this->once() )
->method( 'getContentModel' ) ->method( 'getContentModel' )
->willReturn( CONTENT_MODEL_WIKITEXT ); ->willReturn( CONTENT_MODEL_WIKITEXT );
@ -251,7 +251,7 @@ class MinervaPagePermissionsTest extends MediaWikiIntegrationTestCase {
$title->expects( $this->once() ) $title->expects( $this->once() )
->method( 'isMainPage' ) ->method( 'isMainPage' )
->willReturn( false ); ->willReturn( false );
$title->expects( $this->any() ) $title->expects( $this->once() )
->method( 'getContentModel' ) ->method( 'getContentModel' )
->willReturn( CONTENT_MODEL_UNKNOWN ); ->willReturn( CONTENT_MODEL_UNKNOWN );
@ -280,10 +280,10 @@ class MinervaPagePermissionsTest extends MediaWikiIntegrationTestCase {
*/ */
public function testMoveAndDeleteAndProtectAllowedForUserWithPermissions() { public function testMoveAndDeleteAndProtectAllowedForUserWithPermissions() {
$title = $this->createMock( Title::class ); $title = $this->createMock( Title::class );
$title->expects( $this->any() ) $title
->method( 'exists' ) ->method( 'exists' )
->willReturn( true ); ->willReturn( true );
$title->expects( $this->any() ) $title->expects( $this->once() )
->method( 'getContentModel' ) ->method( 'getContentModel' )
->willReturn( CONTENT_MODEL_WIKITEXT ); ->willReturn( CONTENT_MODEL_WIKITEXT );