dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ParserOutput::getCacheTime should stay the same after the first call.
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
parser
/
TagHooksTest.php
diff --git
a/tests/phpunit/includes/parser/TagHooksTest.php
b/tests/phpunit/includes/parser/TagHooksTest.php
index
2fdaa18
..
06da7a5
100644
(file)
--- a/
tests/phpunit/includes/parser/TagHooksTest.php
+++ b/
tests/phpunit/includes/parser/TagHooksTest.php
@@
-1,10
+1,13
@@
<?php
<?php
+use MediaWiki\MediaWikiServices;
+
/**
* @group Database
* @group Parser
*
* @covers Parser
/**
* @group Database
* @group Parser
*
* @covers Parser
+ * @covers BlockLevelPass
* @covers StripState
*
* @covers Preprocessor_DOM
* @covers StripState
*
* @covers Preprocessor_DOM
@@
-44,8
+47,8
@@
class TagHooksTest extends MediaWikiTestCase {
}
private function getParserOptions() {
}
private function getParserOptions() {
- global $wgContLang;
-
$popt = ParserOptions::newFromUserAndLang( new User, $wgContLang
);
+ $popt = ParserOptions::newFromUserAndLang( new User,
+
MediaWikiServices::getInstance()->getContentLanguage()
);
return $popt;
}
return $popt;
}
@@
-53,8
+56,7
@@
class TagHooksTest extends MediaWikiTestCase {
* @dataProvider provideValidNames
*/
public function testTagHooks( $tag ) {
* @dataProvider provideValidNames
*/
public function testTagHooks( $tag ) {
- global $wgParserConf;
- $parser = new Parser( $wgParserConf );
+ $parser = MediaWikiServices::getInstance()->getParserFactory()->create();
$parser->setHook( $tag, [ $this, 'tagCallback' ] );
$parserOutput = $parser->parse(
$parser->setHook( $tag, [ $this, 'tagCallback' ] );
$parserOutput = $parser->parse(
@@
-72,8
+74,7
@@
class TagHooksTest extends MediaWikiTestCase {
* @expectedException MWException
*/
public function testBadTagHooks( $tag ) {
* @expectedException MWException
*/
public function testBadTagHooks( $tag ) {
- global $wgParserConf;
- $parser = new Parser( $wgParserConf );
+ $parser = MediaWikiServices::getInstance()->getParserFactory()->create();
$parser->setHook( $tag, [ $this, 'tagCallback' ] );
$parser->parse(
$parser->setHook( $tag, [ $this, 'tagCallback' ] );
$parser->parse(
@@
-88,8
+89,7
@@
class TagHooksTest extends MediaWikiTestCase {
* @dataProvider provideValidNames
*/
public function testFunctionTagHooks( $tag ) {
* @dataProvider provideValidNames
*/
public function testFunctionTagHooks( $tag ) {
- global $wgParserConf;
- $parser = new Parser( $wgParserConf );
+ $parser = MediaWikiServices::getInstance()->getParserFactory()->create();
$parser->setFunctionTagHook( $tag, [ $this, 'functionTagCallback' ], 0 );
$parserOutput = $parser->parse(
$parser->setFunctionTagHook( $tag, [ $this, 'functionTagCallback' ], 0 );
$parserOutput = $parser->parse(
@@
-107,8
+107,7
@@
class TagHooksTest extends MediaWikiTestCase {
* @expectedException MWException
*/
public function testBadFunctionTagHooks( $tag ) {
* @expectedException MWException
*/
public function testBadFunctionTagHooks( $tag ) {
- global $wgParserConf;
- $parser = new Parser( $wgParserConf );
+ $parser = MediaWikiServices::getInstance()->getParserFactory()->create();
$parser->setFunctionTagHook(
$tag,
$parser->setFunctionTagHook(
$tag,