From d1be0a802ef5324f79f959c6a419fe96fb8522e2 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 7 Nov 2012 23:08:56 +0100 Subject: [PATCH] Define $wgAlwaysUseTidy to false where needed in unit tests Tidy changes some whitespaces in the HTML which breaks the tests if enabled. Change-Id: Ib44f60c0d4b595c76c258b41962c3c45ca21ac3e --- tests/phpunit/includes/content/TextContentTest.php | 3 ++- tests/phpunit/includes/parser/TagHooksTest.php | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/content/TextContentTest.php b/tests/phpunit/includes/content/TextContentTest.php index 337945db53..52e168b3ff 100644 --- a/tests/phpunit/includes/content/TextContentTest.php +++ b/tests/phpunit/includes/content/TextContentTest.php @@ -21,7 +21,8 @@ class TextContentTest extends MediaWikiTestCase { CONTENT_MODEL_WIKITEXT, CONTENT_MODEL_CSS, CONTENT_MODEL_JAVASCRIPT, - ) + ), + 'wgAlwaysUseTidy' => false, ) ); $this->context = new RequestContext( new FauxRequest() ); diff --git a/tests/phpunit/includes/parser/TagHooksTest.php b/tests/phpunit/includes/parser/TagHooksTest.php index d089affced..292f13ad1a 100644 --- a/tests/phpunit/includes/parser/TagHooksTest.php +++ b/tests/phpunit/includes/parser/TagHooksTest.php @@ -12,7 +12,13 @@ class TagHookTest extends MediaWikiTestCase { public static function provideBadNames() { return array( array( "foobar" ), array( "foo\nbar" ), array( "foo\rbar" ) ); } - + + protected function setUp() { + parent::setUp(); + + $this->setMwGlobals( 'wgAlwaysUseTidy', false ); + } + /** * @dataProvider provideValidNames */ -- 2.20.1