Use PHPUnit shortcuts where possible

This makes the tests a little easier to read, I would argue.
any() is the default anyway. It doesn't add new information to the
test.

Change-Id: If4655ddea494f1054538a760802b583e17c0108e
This commit is contained in:
Thiemo Kreuz 2021-12-17 11:29:48 +01:00
parent 1cf3de024f
commit bb31754073
2 changed files with 4 additions and 5 deletions

View file

@ -32,8 +32,7 @@ class MinervaPagePermissionsTest extends MediaWikiIntegrationTestCase {
$isSuperUser = false
) {
$languageHelper = $this->createMock( LanguagesHelper::class );
$languageHelper->expects( $this->any() )
->method( 'doesTitleHasLanguagesOrVariants' )
$languageHelper->method( 'doesTitleHasLanguagesOrVariants' )
->willReturn( $hasOtherLanguagesOrVariants );
$user = $user ?? $this->getTestUser()->getUser();
@ -148,10 +147,10 @@ class MinervaPagePermissionsTest extends MediaWikiIntegrationTestCase {
->getMock();
$contentHandler->method( 'supportsDirectEditing' )
->will( $this->returnValue( $supportsDirectEditing ) );
->willReturn( $supportsDirectEditing );
$contentHandler->method( 'supportsDirectApiEditing' )
->will( $this->returnValue( $supportsDirectApiEditing ) );
->willReturn( $supportsDirectApiEditing );
$perms = $this->buildPermissionsObject( Title::newFromText( 'test' ), null, [],
$contentHandler );

View file

@ -60,7 +60,7 @@ class SkinMinervaTest extends MediaWikiIntegrationTestCase {
->getMock();
$outputPage->expects( $this->once() )
->method( 'getCategoryLinks' )
->will( $this->returnValue( $categoryLinks ) );
->willReturn( $categoryLinks );
$this->overrideSkinOptions( [ SkinOptions::CATEGORIES => true ] );