From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001
From: Pierre Schmitz <pierre@archlinux.de>
Date: Thu, 4 Jun 2015 07:31:04 +0200
Subject: Update to MediaWiki 1.25.1

---
 tests/phpunit/includes/content/ContentHandlerTest.php | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'tests/phpunit/includes/content/ContentHandlerTest.php')

diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php
index f7449734..988a59ee 100644
--- a/tests/phpunit/includes/content/ContentHandlerTest.php
+++ b/tests/phpunit/includes/content/ContentHandlerTest.php
@@ -2,11 +2,6 @@
 
 /**
  * @group ContentHandler
- * @group Database
- *
- * @note Declare that we are using the database, because otherwise we'll fail in
- * the "databaseless" test run. This is because the LinkHolderArray used by the
- * parser needs database access.
  */
 class ContentHandlerTest extends MediaWikiTestCase {
 
@@ -36,6 +31,8 @@ class ContentHandlerTest extends MediaWikiTestCase {
 		// Reset namespace cache
 		MWNamespace::getCanonicalNamespaces( true );
 		$wgContLang->resetNamespaces();
+		// And LinkCache
+		LinkCache::destroySingleton();
 	}
 
 	protected function tearDown() {
@@ -44,6 +41,8 @@ class ContentHandlerTest extends MediaWikiTestCase {
 		// Reset namespace cache
 		MWNamespace::getCanonicalNamespaces( true );
 		$wgContLang->resetNamespaces();
+		// And LinkCache
+		LinkCache::destroySingleton();
 
 		parent::tearDown();
 	}
@@ -83,6 +82,7 @@ class ContentHandlerTest extends MediaWikiTestCase {
 	 */
 	public function testGetForTitle( $title, $expectedContentModel ) {
 		$title = Title::newFromText( $title );
+		LinkCache::singleton()->addBadLinkObj( $title );
 		$handler = ContentHandler::getForTitle( $title );
 		$this->assertEquals( $expectedContentModel, $handler->getModelID() );
 	}
@@ -139,6 +139,7 @@ class ContentHandlerTest extends MediaWikiTestCase {
 	public function testGetPageLanguage( $title, $expected ) {
 		if ( is_string( $title ) ) {
 			$title = Title::newFromText( $title );
+			LinkCache::singleton()->addBadLinkObj( $title );
 		}
 
 		$expected = wfGetLangObj( $expected );
@@ -292,7 +293,7 @@ class ContentHandlerTest extends MediaWikiTestCase {
 		$expectedModelId, $expectedNativeData, $shouldFail
 	) {
 		$title = Title::newFromText( $title );
-
+		LinkCache::singleton()->addBadLinkObj( $title );
 		try {
 			$content = ContentHandler::makeContent( $data, $title, $modelId, $format );
 
@@ -317,6 +318,8 @@ class ContentHandlerTest extends MediaWikiTestCase {
 	 * page.
 	 */
 	public function testGetAutosummary() {
+		$this->setMwGlobals( 'wgContLang', Language::factory( 'en' ) );
+
 		$content = new DummyContentHandlerForTesting( CONTENT_MODEL_WIKITEXT );
 		$title = Title::newFromText( 'Help:Test' );
 		// Create a new content object with no content
-- 
cgit v1.2.3-54-g00ecf