From: Aaron Schulz Date: Thu, 25 Oct 2018 04:31:58 +0000 (-0700) Subject: Clear the title cache in MutableRevisionRecordTest X-Git-Tag: 1.34.0-rc.0~3647^2 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=c4d9d515067f67ea2134b144a4548b7d02c1e238;p=lhc%2Fweb%2Fwiklou.git Clear the title cache in MutableRevisionRecordTest Also do so in various other test classes. Follows-up 170c49d61cb8. Fixes Travis CI regression: > 1) MediaWiki\Tests\Revision\MutableRevisionRecordTest::testSetGetPageId > Failed asserting that 2 is identical to 0. > tests/phpunit/includes/Revision/MutableRevisionRecordTest.php:129 Change-Id: I41c8bda8e620ebe7608a393d81f3b0f13af68ba7 --- diff --git a/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php b/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php index 060099e2ce..dbe4d4ea61 100644 --- a/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php +++ b/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php @@ -25,6 +25,11 @@ class MutableRevisionRecordTest extends MediaWikiTestCase { use RevisionRecordTests; + function setUp() { + Title::clearCaches(); + parent::setUp(); + } + /** * @param array $rowOverrides * diff --git a/tests/phpunit/includes/TitleMethodsTest.php b/tests/phpunit/includes/TitleMethodsTest.php index 715d46914a..44d440f3ec 100644 --- a/tests/phpunit/includes/TitleMethodsTest.php +++ b/tests/phpunit/includes/TitleMethodsTest.php @@ -352,4 +352,9 @@ class TitleMethodsTest extends MediaWikiLangTestCase { $this->assertNotSame( $title1, $title2, 'title cache should be empty' ); $this->assertEquals( 0, $linkCache->getGoodLinkID( 'Foo' ), 'link cache should be empty' ); } + + function tearDown() { + Title::clearCaches(); + parent::tearDown(); + } } diff --git a/tests/phpunit/includes/linker/LinkRendererTest.php b/tests/phpunit/includes/linker/LinkRendererTest.php index 8a05641778..d550dcbe26 100644 --- a/tests/phpunit/includes/linker/LinkRendererTest.php +++ b/tests/phpunit/includes/linker/LinkRendererTest.php @@ -191,4 +191,8 @@ class LinkRendererTest extends MediaWikiLangTestCase { ); } + function tearDown() { + Title::clearCaches(); + parent::tearDown(); + } } diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php index a1ad8f92bb..ad8fa78c7a 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php @@ -442,6 +442,11 @@ class ResourceLoaderWikiModuleTest extends ResourceLoaderTestCase { 'Redirect resolved by getContent' ); } + + function tearDown() { + Title::clearCaches(); + parent::tearDown(); + } } class TestResourceLoaderWikiModule extends ResourceLoaderWikiModule { diff --git a/tests/phpunit/includes/search/SearchNearMatcherTest.php b/tests/phpunit/includes/search/SearchNearMatcherTest.php index 132011aab6..9ccae8cc95 100644 --- a/tests/phpunit/includes/search/SearchNearMatcherTest.php +++ b/tests/phpunit/includes/search/SearchNearMatcherTest.php @@ -27,4 +27,9 @@ class SearchNearMatcherTest extends \PHPUnit\Framework\TestCase { $title = $matcher->getNearMatch( $searchterm ); $this->assertEquals( $expected, $title === null ? null : (string)$title ); } + + function tearDown() { + Title::clearCaches(); + parent::tearDown(); + } }