PHP tests: Use the . not + operator to join strings

This unbreaks the test suite in PHP 7.1+.

Bug: T206297
Change-Id: I29677e84f41da447180beb58ffbc60655640890c
This commit is contained in:
James D. Forrester 2018-10-05 15:46:27 -07:00
parent 1c3b5307e7
commit 505ddc61fa
2 changed files with 6 additions and 6 deletions

View file

@ -69,7 +69,7 @@ class PopupsContextTest extends MediaWikiTestCase {
$context = $this->getContext();
$this->assertEquals( $expected,
$context->showPreviewsOptInOnPreferencesPage(),
'The previews opt-in is ' + ( $expected ? 'shown.' : 'hidden.' ) );
'The previews opt-in is ' . ( $expected ? 'shown.' : 'hidden.' ) );
}
/**
@ -104,7 +104,7 @@ class PopupsContextTest extends MediaWikiTestCase {
$user->setOption( PopupsContext::PREVIEWS_OPTIN_PREFERENCE_NAME, $optIn );
$this->assertEquals( $expected,
$context->shouldSendModuleToUser( $user ),
( $expected ? 'A' : 'No' ) + ' module is sent to the user.' );
( $expected ? 'A' : 'No' ) . ' module is sent to the user.' );
}
/**
@ -137,7 +137,7 @@ class PopupsContextTest extends MediaWikiTestCase {
$context = $this->getContext();
$this->assertEquals( $expected,
$context->shouldSendModuleToUser( $user ),
( $expected ? 'A' : 'No' ) + ' module is sent to the user.' );
( $expected ? 'A' : 'No' ) . ' module is sent to the user.' );
}
public static function providerAnonUserHasDisabledPagePreviews() {
@ -168,7 +168,7 @@ class PopupsContextTest extends MediaWikiTestCase {
$context = $this->getContext( $mock );
$this->assertEquals( $expected,
$context->areDependenciesMet(),
'Dependencies are ' + ( $expected ? '' : 'not ' ) + 'met.' );
'Dependencies are ' . ( $expected ? '' : 'not ' ) . 'met.' );
}
/**
@ -219,7 +219,7 @@ class PopupsContextTest extends MediaWikiTestCase {
$context = $this->getContext();
$this->assertEquals( $expected,
$context->isTitleBlacklisted( $title ),
'The title is' + ( $expected ? ' ' : ' not ' ) + 'blacklisted.' );
'The title is' . ( $expected ? ' ' : ' not ' ) . 'blacklisted.' );
}
/**

View file

@ -240,7 +240,7 @@ class PopupsGadgetsIntegrationTest extends MediaWikiTestCase {
$this->getExtensionRegistryMock( true ) );
$this->assertEquals( $expected,
$integration->conflictsWithNavPopupsGadget( $user ),
( $expected ? 'A' : 'No' ) + ' conflict is identified.' );
( $expected ? 'A' : 'No' ) . ' conflict is identified.' );
GadgetRepo::setSingleton( $origGadgetsRepo );
}