X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2Fcontent%2FJsonContentTest.php;h=8546d967a60563af43a80148d54952b128c3e6e1;hb=3f1474de5d9d3980acd895c9accfe361f8a6dbaf;hp=de8e371ebf01048308a0ddb2113730f43984aab1;hpb=5fd224c00b940f75c1f83e56b99961be94bde70a;p=lhc%2Fweb%2Fwiklou.git
diff --git a/tests/phpunit/includes/content/JsonContentTest.php b/tests/phpunit/includes/content/JsonContentTest.php
index de8e371ebf..8546d967a6 100644
--- a/tests/phpunit/includes/content/JsonContentTest.php
+++ b/tests/phpunit/includes/content/JsonContentTest.php
@@ -82,18 +82,18 @@ class JsonContentTest extends MediaWikiLangTestCase {
}
private function getMockTitle() {
- return $this->getMockBuilder( 'Title' )
+ return $this->getMockBuilder( Title::class )
->disableOriginalConstructor()
->getMock();
}
private function getMockUser() {
- return $this->getMockBuilder( 'User' )
+ return $this->getMockBuilder( User::class )
->disableOriginalConstructor()
->getMock();
}
private function getMockParserOptions() {
- return $this->getMockBuilder( 'ParserOptions' )
+ return $this->getMockBuilder( ParserOptions::class )
->disableOriginalConstructor()
->getMock();
}
@@ -113,27 +113,27 @@ class JsonContentTest extends MediaWikiLangTestCase {
],
[
(object)[ 'foo' ],
- '
0 | "foo" |
' .
+ ''
],
[
(object)[ 'foo', 'bar' ],
- ''
+ ''
],
[
(object)[ 'baz' => 'foo', 'bar' ],
- ''
+ ''
],
[
(object)[ 'baz' => 1000, 'bar' ],
- ''
+ ''
],
[
(object)[ '' ],
- '0 | "' .
+ '0 | "' .
'<script>alert("evil!")</script>"' .
' |
---|
',
],
@@ -146,7 +146,7 @@ class JsonContentTest extends MediaWikiLangTestCase {
public function testFillParserOutput( $data, $expected ) {
$obj = new JsonContent( FormatJson::encode( $data ) );
$parserOutput = $obj->getParserOutput( $this->getMockTitle(), null, null, true );
- $this->assertInstanceOf( 'ParserOutput', $parserOutput );
+ $this->assertInstanceOf( ParserOutput::class, $parserOutput );
$this->assertEquals( $expected, $parserOutput->getText() );
}
}
|
---|