JanZerebecki has submitted this change and it was merged.
Change subject: Make tests compatible with phpunit 3.7.37
......................................................................
Make tests compatible with phpunit 3.7.37
Change-Id: I3d7c2eb026cc0999253d623068517d756c27ec37
---
M tests/phpunit/Api/GetViolationMessagesTest.php
M tests/phpunit/Html/HtmlTableBuilderTest.php
M tests/phpunit/Specials/SpecialViolationsPageTest.php
M tests/phpunit/Violations/DispatchingViolationFormatterTest.php
4 files changed, 16 insertions(+), 16 deletions(-)
Approvals:
JanZerebecki: Verified; Looks good to me, approved
diff --git a/tests/phpunit/Api/GetViolationMessagesTest.php
b/tests/phpunit/Api/GetViolationMessagesTest.php
index a6a6da7..2024e65 100755
--- a/tests/phpunit/Api/GetViolationMessagesTest.php
+++ b/tests/phpunit/Api/GetViolationMessagesTest.php
@@ -157,16 +157,16 @@
$mock->expects( $this->any() )
->method( 'getShortMessage' )
- ->willReturn( $shortMessage );
+ ->will( $this->returnValue( $shortMessage ) );
$mock->expects( $this->any() )
->method( 'getLongMessage' )
- ->willReturn( $longMessage );
+ ->will( $this->returnValue( $longMessage ) );
$mock->expects( $this->any() )
->method( 'getIconClass' )
- ->willReturn( $iconClass );
+ ->will( $this->returnValue( $iconClass ) );
$mock->expects( $this->any() )
->method( 'isFormatterFor' )
- ->willReturn( true );
+ ->will( $this->returnValue( true ) );
return $mock;
}
diff --git a/tests/phpunit/Html/HtmlTableBuilderTest.php
b/tests/phpunit/Html/HtmlTableBuilderTest.php
index 48b285c..b6c6ee4 100755
--- a/tests/phpunit/Html/HtmlTableBuilderTest.php
+++ b/tests/phpunit/Html/HtmlTableBuilderTest.php
@@ -251,7 +251,7 @@
$cellMock
->expects( $this->any() )
->method( 'toHtml' )
- ->willReturn( "<th>$content</th>" );
+ ->will( $this->returnValue( "<th>$content</th>" ) );
return $cellMock;
}
@@ -271,7 +271,7 @@
$cellMock
->expects( $this->any() )
->method( 'toHtml' )
- ->willReturn( "<td>$content</td>" );
+ ->will( $this->returnValue( "<td>$content</td>" ) );
return $cellMock;
}
diff --git a/tests/phpunit/Specials/SpecialViolationsPageTest.php
b/tests/phpunit/Specials/SpecialViolationsPageTest.php
index 641014f..56e9df2 100644
--- a/tests/phpunit/Specials/SpecialViolationsPageTest.php
+++ b/tests/phpunit/Specials/SpecialViolationsPageTest.php
@@ -513,16 +513,16 @@
$mock->expects( $this->any() )
->method( 'isFormatterFor' )
- ->willReturnCallback( function ( Violation $violation )
use ( $expectedId ) {
+ ->will( $this->returnCallback( function ( Violation
$violation ) use ( $expectedId ) {
$splitConstraintId = explode(
Violation::CONSTRAINT_ID_DELIMITER, $violation->getConstraintId() );
$prefix = $splitConstraintId[0];
return $prefix === $expectedId;
- } );
+ } ) );
$mock->expects( $this->any() )
->method( 'formatAdditionalInformation' )
- ->willReturn( $additionalInformation );
+ ->will( $this->returnValue( $additionalInformation ) );
return $mock;
}
diff --git a/tests/phpunit/Violations/DispatchingViolationFormatterTest.php
b/tests/phpunit/Violations/DispatchingViolationFormatterTest.php
index be77cc6..e032eab 100755
--- a/tests/phpunit/Violations/DispatchingViolationFormatterTest.php
+++ b/tests/phpunit/Violations/DispatchingViolationFormatterTest.php
@@ -260,7 +260,7 @@
->getMock();
$mock->expects( $this->any() )
->method( 'getConstraintId' )
- ->willReturn( $constraintId );
+ ->will( $this->returnValue( $constraintId ) );
return $mock;
}
@@ -281,31 +281,31 @@
if ( $acceptedId ) {
$mock->expects( $this->any() )
->method( 'isFormatterFor' )
- ->willReturnCallback(
+ ->will( $this->returnCallback(
function ( Violation $violation ) use (
$acceptedId ) {
return
$violation->getConstraintId() === $acceptedId;
}
- );
+ ) );
}
if ( $additionalInformation ) {
$mock->expects( $this->any() )
->method( 'formatAdditionalInformation' )
- ->willReturn( $additionalInformation );
+ ->will( $this->returnValue(
$additionalInformation ) );
}
if ( $shortMessage ) {
$mock->expects( $this->any() )
->method( 'getShortMessage' )
- ->willReturn( $shortMessage );
+ ->will( $this->returnValue( $shortMessage ) );
}
if ( $longMessage ) {
$mock->expects( $this->any() )
->method( 'getLongMessage' )
- ->willReturn( $longMessage );
+ ->will( $this->returnValue( $longMessage ) );
}
if ( $iconClass ) {
$mock->expects( $this->any() )
->method( 'getIconClass' )
- ->willReturn( $iconClass );
+ ->will( $this->returnValue( $iconClass ) );
}
return $mock;
--
To view, visit https://gerrit.wikimedia.org/r/218701
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3d7c2eb026cc0999253d623068517d756c27ec37
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikidataQuality
Gerrit-Branch: master
Gerrit-Owner: JanZerebecki <[email protected]>
Gerrit-Reviewer: JanZerebecki <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits