aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/parser/ParserCacheTest.php
diff options
context:
space:
mode:
authorPetr Pchelko <ppchelko@wikimedia.org>2021-07-23 06:19:07 -0700
committerPetr Pchelko <ppchelko@wikimedia.org>2021-07-27 14:47:49 -0700
commit1aa68d183d4c96f890b6a5494ec2a4ccac57c3de (patch)
tree51e12dbad34bcb23e9cdda77878264702bf78abb /tests/phpunit/includes/parser/ParserCacheTest.php
parent93a1fd20bd78d49015df6411e9bf52193b424706 (diff)
downloadmediawikicore-1aa68d183d4c96f890b6a5494ec2a4ccac57c3de.tar.gz
mediawikicore-1aa68d183d4c96f890b6a5494ec2a4ccac57c3de.zip
Remove depecated ParserCache::getKey and ::getEtag
Change-Id: Idea037eaab851110d0c58f537dafcb2153cd2613
Diffstat (limited to 'tests/phpunit/includes/parser/ParserCacheTest.php')
-rw-r--r--tests/phpunit/includes/parser/ParserCacheTest.php27
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/phpunit/includes/parser/ParserCacheTest.php b/tests/phpunit/includes/parser/ParserCacheTest.php
index ae59092a7fed..0ff1e5346b40 100644
--- a/tests/phpunit/includes/parser/ParserCacheTest.php
+++ b/tests/phpunit/includes/parser/ParserCacheTest.php
@@ -120,25 +120,17 @@ class ParserCacheTest extends MediaWikiIntegrationTestCase {
/**
* @covers ParserCache::getMetadata
- * @covers ParserCache::getKey
*/
public function testGetMetadataMissing() {
- $this->hideDeprecated( 'ParserCache::getKey' );
$cache = $this->createParserCache();
-
$metadataFromCache = $cache->getMetadata( $this->page, ParserCache::USE_CURRENT_ONLY );
- $this->assertFalse( $cache->getKey( $this->page,
- ParserOptions::newCanonical( 'canonical' ), ParserCache::USE_CURRENT_ONLY ) );
- $this->assertNotFalse( $cache->getKey( $this->page, ParserOptions::newCanonical( 'canonical' ) ) );
$this->assertNull( $metadataFromCache );
}
/**
* @covers ParserCache::getMetadata
- * @covers ParserCache::getKey
*/
public function testGetMetadataAllGood() {
- $this->hideDeprecated( 'ParserCache::getKey' );
$cache = $this->createParserCache();
$parserOutput = $this->createDummyParserOutput();
@@ -146,8 +138,6 @@ class ParserCacheTest extends MediaWikiIntegrationTestCase {
$metadataFromCache = $cache->getMetadata( $this->page, ParserCache::USE_CURRENT_ONLY );
$this->assertNotNull( $metadataFromCache );
- $this->assertNotFalse( $cache->getKey( $this->page,
- ParserOptions::newCanonical( 'canonical' ), ParserCache::USE_CURRENT_ONLY ) );
$this->assertSame( $this->getDummyUsedOptions(), $metadataFromCache->getUsedOptions() );
$this->assertSame( 4242, $metadataFromCache->getCacheExpiry() );
$this->assertSame( $this->page->getLatest(), $metadataFromCache->getCacheRevisionId() );
@@ -156,21 +146,15 @@ class ParserCacheTest extends MediaWikiIntegrationTestCase {
/**
* @covers ParserCache::getMetadata
- * @covers ParserCache::getKey
*/
public function testGetMetadataExpired() {
- $this->hideDeprecated( 'ParserCache::getKey' );
$cache = $this->createParserCache();
$parserOutput = $this->createDummyParserOutput();
$cache->save( $parserOutput, $this->page, ParserOptions::newCanonical( 'canonical' ), $this->cacheTime );
$this->page = $this->createPageRecord( [ 'page_touched' => $this->time + 10000 ] );
$this->assertNull( $cache->getMetadata( $this->page, ParserCache::USE_CURRENT_ONLY ) );
- $this->assertFalse( $cache->getKey( $this->page,
- ParserOptions::newCanonical( 'canonical' ), ParserCache::USE_CURRENT_ONLY ) );
$metadataFromCache = $cache->getMetadata( $this->page, ParserCache::USE_EXPIRED );
- $this->assertNotFalse( $cache->getKey( $this->page,
- ParserOptions::newCanonical( 'canonical' ), ParserCache::USE_EXPIRED ) );
$this->assertNotNull( $metadataFromCache );
$this->assertSame( $this->getDummyUsedOptions(), $metadataFromCache->getUsedOptions() );
$this->assertSame( 4242, $metadataFromCache->getCacheExpiry() );
@@ -180,24 +164,16 @@ class ParserCacheTest extends MediaWikiIntegrationTestCase {
/**
* @covers ParserCache::getMetadata
- * @covers ParserCache::getKey
*/
public function testGetMetadataOutdated() {
- $this->hideDeprecated( 'ParserCache::getKey' );
$cache = $this->createParserCache();
$parserOutput = $this->createDummyParserOutput();
$cache->save( $parserOutput, $this->page, ParserOptions::newCanonical( 'canonical' ), $this->cacheTime );
$this->page = $this->createPageRecord( [ 'page_latest' => $this->page->getLatest() + 1 ] );
$this->assertNull( $cache->getMetadata( $this->page, ParserCache::USE_CURRENT_ONLY ) );
- $this->assertFalse( $cache->getKey( $this->page,
- ParserOptions::newCanonical( 'canonical' ), ParserCache::USE_CURRENT_ONLY ) );
$this->assertNull( $cache->getMetadata( $this->page, ParserCache::USE_EXPIRED ) );
- $this->assertFalse( $cache->getKey( $this->page,
- ParserOptions::newCanonical( 'canonical' ), ParserCache::USE_EXPIRED ) );
$metadataFromCache = $cache->getMetadata( $this->page, ParserCache::USE_OUTDATED );
- $this->assertNotFalse( $cache->getKey( $this->page,
- ParserOptions::newCanonical( 'canonical' ), ParserCache::USE_OUTDATED ) );
$this->assertSame( $this->getDummyUsedOptions(), $metadataFromCache->getUsedOptions() );
$this->assertSame( 4242, $metadataFromCache->getCacheExpiry() );
$this->assertNotSame( $this->page->getLatest(), $metadataFromCache->getCacheRevisionId() );
@@ -640,10 +616,8 @@ class ParserCacheTest extends MediaWikiIntegrationTestCase {
* back to a version of the code that doesn't know about JSON.
*
* @covers ParserCache::getMetadata
- * @covers ParserCache::getKey
*/
public function testCorruptMetadata() {
- $this->hideDeprecated( 'ParserCache::getKey' );
$cacheStorage = new HashBagOStuff();
$cache = $this->createParserCache( null, $cacheStorage );
$parserOutput = new ParserOutput( 'TEST_TEXT' );
@@ -662,7 +636,6 @@ class ParserCacheTest extends MediaWikiIntegrationTestCase {
// just make sure we don't crash and burn
$this->assertNull( $cache->getMetadata( $this->page ) );
- $this->assertFalse( $cache->getKey( $this->page, $options1, false ) );
}
/**