Merge "Use more strict assertSame() when comparing strings"

This commit is contained in:
jenkins-bot 2021-09-04 05:19:49 +00:00 committed by Gerrit Code Review
commit 34503ed210
2 changed files with 9 additions and 9 deletions

View file

@ -20,7 +20,7 @@ class SerializationTest extends MediaWikiTestCase {
$result = TemplateDataHooks::getStatusFromParserOutput( $output );
$this->assertEquals( $status->getStatusValue(), $result->getStatusValue() );
$this->assertEquals( $status->__toString(), $result->__toString() );
$this->assertSame( (string)$status, (string)$result );
}
public function testParserOutputPersistenceBackwardCompatibility() {
@ -35,7 +35,7 @@ class SerializationTest extends MediaWikiTestCase {
$result = TemplateDataHooks::getStatusFromParserOutput( $output );
$this->assertEquals( $status->getStatusValue(), $result->getStatusValue() );
$this->assertEquals( $status->__toString(), $result->__toString() );
$this->assertSame( (string)$status, (string)$result );
}
public function provideStatus() {
@ -56,7 +56,7 @@ class SerializationTest extends MediaWikiTestCase {
TemplateDataHooks::setStatusToParserOutput( $parserOutput, $status );
$result = TemplateDataHooks::getStatusFromParserOutput( $parserOutput );
$this->assertEquals( $status->getStatusValue(), $result->getStatusValue() );
$this->assertEquals( $status->__toString(), $result->__toString() );
$this->assertSame( (string)$status, (string)$result );
}
/**
@ -68,6 +68,6 @@ class SerializationTest extends MediaWikiTestCase {
$json = TemplateDataHooks::jsonSerializeStatus( $status );
$result = TemplateDataHooks::newStatusFromJson( $json );
$this->assertEquals( $status->getStatusValue(), $result->getStatusValue() );
$this->assertEquals( $status->__toString(), $result->__toString() );
$this->assertSame( (string)$status, (string)$result );
}
}

View file

@ -613,7 +613,7 @@ class TemplateDataBlobTest extends MediaWikiIntegrationTestCase {
self::ksort( $expected );
self::ksort( $actual );
$this->assertEquals(
$this->assertSame(
FormatJson::encode( $expected, true ),
FormatJson::encode( $actual, true ),
$message
@ -646,13 +646,13 @@ class TemplateDataBlobTest extends MediaWikiIntegrationTestCase {
$actual = $t->getJSON();
$status = $t->getStatus();
if ( !$status->isGood() ) {
$this->assertEquals(
$this->assertSame(
$case['status'],
self::getStatusText( $status ),
'Status: ' . $case['msg']
);
} else {
$this->assertEquals(
$this->assertSame(
$case['status'],
$status->isGood(),
'Status: ' . $case['msg']
@ -671,7 +671,7 @@ class TemplateDataBlobTest extends MediaWikiIntegrationTestCase {
$status = $t->getStatus();
if ( !$status->isGood() ) {
$this->assertEquals(
$this->assertSame(
$case['status'],
self::getStatusText( $status ),
'Roundtrip status: ' . $case['msg']
@ -1377,6 +1377,6 @@ HTML
$linedExpected = preg_replace( '/>\s*</', ">\n<", trim( $expected ) );
$this->assertEquals( $linedExpected, $linedActual, 'html' );
$this->assertSame( $linedExpected, $linedActual, 'html' );
}
}