aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/parser
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2024-09-01 14:37:01 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2024-09-01 23:24:11 +0200
commit0a69e0bc53a44057996d48e63b7f56efd229f00d (patch)
tree53cc5234d22707c1efc8a56ee0a287503bfbcac4 /tests/phpunit/includes/parser
parenta6c216ad8d3be6120bb265e10647fc5d419af231 (diff)
downloadmediawikicore-0a69e0bc53a44057996d48e63b7f56efd229f00d.tar.gz
mediawikicore-0a69e0bc53a44057996d48e63b7f56efd229f00d.zip
tests: Use const for some static data in test files
Change-Id: Id7ccd48e3bf626095e2d3929831b5d87ed0be948
Diffstat (limited to 'tests/phpunit/includes/parser')
-rw-r--r--tests/phpunit/includes/parser/PageBundleJsonTraitTest.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/phpunit/includes/parser/PageBundleJsonTraitTest.php b/tests/phpunit/includes/parser/PageBundleJsonTraitTest.php
index c0a4b623793a..e34a29b6aae5 100644
--- a/tests/phpunit/includes/parser/PageBundleJsonTraitTest.php
+++ b/tests/phpunit/includes/parser/PageBundleJsonTraitTest.php
@@ -11,7 +11,7 @@ use Wikimedia\Parsoid\Core\PageBundle;
*/
class PageBundleJsonTraitTest extends MediaWikiIntegrationTestCase {
- private $bundleData = [
+ private const BUNDLE_DATA = [
'html' => '<h1>woohoo</h1>',
'parsoid' => [ 'metadata' => 'foo' ],
'mw' => null,
@@ -26,7 +26,7 @@ class PageBundleJsonTraitTest extends MediaWikiIntegrationTestCase {
newPageBundleFromJson as public;
}
};
- $bundle = $trait->newPageBundleFromJson( $this->bundleData );
+ $bundle = $trait->newPageBundleFromJson( self::BUNDLE_DATA );
$this->assertInstanceOf( PageBundle::class, $bundle );
$this->assertEquals( '<h1>woohoo</h1>', $bundle->html );
$this->assertEquals( 'default', $bundle->contentmodel );
@@ -39,7 +39,7 @@ class PageBundleJsonTraitTest extends MediaWikiIntegrationTestCase {
jsonSerializePageBundle as public;
}
};
- $bundle = new PageBundle( ...array_values( $this->bundleData ) );
+ $bundle = new PageBundle( ...array_values( self::BUNDLE_DATA ) );
$json = $trait->jsonSerializePageBundle( $bundle );
$this->assertEquals( PageBundle::class, $json['_type_'] );
$this->assertEquals( '<h1>woohoo</h1>', $json['html'] );