summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/parser
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/parser')
-rw-r--r--tests/phpunit/includes/parser/MagicVariableTest.php2
-rw-r--r--tests/phpunit/includes/parser/MediaWikiParserTest.php2
-rw-r--r--tests/phpunit/includes/parser/NewParserTest.php10
-rw-r--r--tests/phpunit/includes/parser/ParserMethodsTest.php4
-rw-r--r--tests/phpunit/includes/parser/TagHooksTest.php7
-rw-r--r--tests/phpunit/includes/parser/TidyTest.php3
6 files changed, 15 insertions, 13 deletions
diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php
index 17226113..cd54a9e3 100644
--- a/tests/phpunit/includes/parser/MagicVariableTest.php
+++ b/tests/phpunit/includes/parser/MagicVariableTest.php
@@ -10,6 +10,8 @@
* @copyright Copyright © 2011, Antoine Musso
* @file
* @todo covers tags
+ *
+ * @group Database
*/
class MagicVariableTest extends MediaWikiTestCase {
diff --git a/tests/phpunit/includes/parser/MediaWikiParserTest.php b/tests/phpunit/includes/parser/MediaWikiParserTest.php
index e6dbfc30..210c17c5 100644
--- a/tests/phpunit/includes/parser/MediaWikiParserTest.php
+++ b/tests/phpunit/includes/parser/MediaWikiParserTest.php
@@ -92,7 +92,7 @@ class MediaWikiParserTest {
// enough to cause there to be separate names for different
// things, which is good enough for our purposes.
$extensionName = basename( dirname( $fileName ) );
- $testsName = $extensionName . '⁄' . basename( $fileName, '.txt' );
+ $testsName = $extensionName . '__' . basename( $fileName, '.txt' );
$escapedFileName = strtr( $fileName, array( "'" => "\\'", '\\' => '\\\\' ) );
$parserTestClassName = ucfirst( $testsName );
// Official spec for class names: http://php.net/manual/en/language.oop5.basic.php
diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php
index 7d21c4f7..d95e9225 100644
--- a/tests/phpunit/includes/parser/NewParserTest.php
+++ b/tests/phpunit/includes/parser/NewParserTest.php
@@ -91,7 +91,7 @@ class NewParserTest extends MediaWikiTestCase {
);
$tmpGlobals['wgForeignFileRepos'] = array();
$tmpGlobals['wgDefaultExternalStore'] = array();
- $tmpGlobals['wgEnableParserCache'] = false;
+ $tmpGlobals['wgParserCacheType'] = CACHE_NONE;
$tmpGlobals['wgCapitalLinks'] = true;
$tmpGlobals['wgNoFollowLinks'] = true;
$tmpGlobals['wgNoFollowDomainExceptions'] = array();
@@ -106,7 +106,6 @@ class NewParserTest extends MediaWikiTestCase {
$tmpGlobals['wgAdaptiveMessageCache'] = true;
$tmpGlobals['wgUseDatabaseMessages'] = true;
$tmpGlobals['wgLocaltimezone'] = 'UTC';
- $tmpGlobals['wgDeferredUpdateList'] = array();
$tmpGlobals['wgGroupPermissions'] = array(
'*' => array(
'createaccount' => true,
@@ -160,10 +159,10 @@ class NewParserTest extends MediaWikiTestCase {
$this->djVuSupport = new DjVuSupport();
// Tidy support
$this->tidySupport = new TidySupport();
+ $tmpGlobals['wgTidyConfig'] = null;
$tmpGlobals['wgUseTidy'] = false;
- $tmpGlobals['wgAlwaysUseTidy'] = false;
$tmpGlobals['wgDebugTidy'] = false;
- $tmpGlobals['wgTidyConf'] = $IP . '/includes/tidy.conf';
+ $tmpGlobals['wgTidyConf'] = $IP . '/includes/tidy/tidy.conf';
$tmpGlobals['wgTidyOpts'] = '';
$tmpGlobals['wgTidyInternal'] = $this->tidySupport->isInternal();
@@ -185,6 +184,8 @@ class NewParserTest extends MediaWikiTestCase {
$wgNamespaceAliases['Image'] = $this->savedWeirdGlobals['image_alias'];
$wgNamespaceAliases['Image_talk'] = $this->savedWeirdGlobals['image_talk_alias'];
+ MWTidy::destroySingleton();
+
// Restore backends
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
@@ -454,6 +455,7 @@ class NewParserTest extends MediaWikiTestCase {
$GLOBALS[$var] = $val;
}
+ MWTidy::destroySingleton();
MagicWord::clearCache();
# The entries saved into RepoGroup cache with previous globals will be wrong.
diff --git a/tests/phpunit/includes/parser/ParserMethodsTest.php b/tests/phpunit/includes/parser/ParserMethodsTest.php
index 1790086a..af143caa 100644
--- a/tests/phpunit/includes/parser/ParserMethodsTest.php
+++ b/tests/phpunit/includes/parser/ParserMethodsTest.php
@@ -1,5 +1,9 @@
<?php
+/**
+ * @group Database
+ */
+
class ParserMethodsTest extends MediaWikiLangTestCase {
public static function providePreSaveTransform() {
diff --git a/tests/phpunit/includes/parser/TagHooksTest.php b/tests/phpunit/includes/parser/TagHooksTest.php
index 251da471..4af38985 100644
--- a/tests/phpunit/includes/parser/TagHooksTest.php
+++ b/tests/phpunit/includes/parser/TagHooksTest.php
@@ -1,6 +1,7 @@
<?php
/**
+ * @group Database
* @group Parser
*/
class TagHookTest extends MediaWikiTestCase {
@@ -18,12 +19,6 @@ class TagHookTest extends MediaWikiTestCase {
return array( array( "foo<bar" ), array( "foo>bar" ), array( "foo\nbar" ), array( "foo\rbar" ) );
}
- protected function setUp() {
- parent::setUp();
-
- $this->setMwGlobals( 'wgAlwaysUseTidy', false );
- }
-
/**
* @dataProvider provideValidNames
* @covers Parser::setHook
diff --git a/tests/phpunit/includes/parser/TidyTest.php b/tests/phpunit/includes/parser/TidyTest.php
index f656a74d..5db29080 100644
--- a/tests/phpunit/includes/parser/TidyTest.php
+++ b/tests/phpunit/includes/parser/TidyTest.php
@@ -7,8 +7,7 @@ class TidyTest extends MediaWikiTestCase {
protected function setUp() {
parent::setUp();
- $check = MWTidy::tidy( '' );
- if ( strpos( $check, '<!--' ) !== false ) {
+ if ( !MWTidy::isEnabled() ) {
$this->markTestSkipped( 'Tidy not found' );
}
}