mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-27 17:20:01 +00:00
Merge "Use more strict assertSame() when comparing strings"
This commit is contained in:
commit
34503ed210
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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' );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue