diff options
-rw-r--r-- | includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php | 12 | ||||
-rw-r--r-- | tests/phpunit/integration/includes/Rest/Handler/Helper/HtmlOutputRendererHelperTest.php | 47 |
2 files changed, 0 insertions, 59 deletions
diff --git a/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php b/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php index 0f3dafe96bbb..ed4f431a0a7e 100644 --- a/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php +++ b/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php @@ -290,18 +290,6 @@ class HtmlOutputRendererHelper implements HtmlOutputHelper { } /** - * Controls how the parser cache is used. - * - * @param bool $read Whether we should look for cached output before parsing - * @param bool $write Whether we should cache output after parsing - */ - public function setUseParserCache( bool $read, bool $write ) { - $this->parserOutputAccessOptions = - ( $read ? 0 : ParserOutputAccess::OPT_FORCE_PARSE ) | - ( $write ? 0 : ParserOutputAccess::OPT_NO_UPDATE_CACHE ); - } - - /** * Determine whether stashing should be applied. * * @param bool $stash diff --git a/tests/phpunit/integration/includes/Rest/Handler/Helper/HtmlOutputRendererHelperTest.php b/tests/phpunit/integration/includes/Rest/Handler/Helper/HtmlOutputRendererHelperTest.php index 4e03f25d23a0..7a0154471ffa 100644 --- a/tests/phpunit/integration/includes/Rest/Handler/Helper/HtmlOutputRendererHelperTest.php +++ b/tests/phpunit/integration/includes/Rest/Handler/Helper/HtmlOutputRendererHelperTest.php @@ -984,53 +984,6 @@ class HtmlOutputRendererHelperTest extends MediaWikiIntegrationTestCase { $helper->getHtml(); } - public function testDisableParserCacheWrite() { - $page = $this->getExistingTestPage( __METHOD__ ); - - // NOTE: The save() method is not supported and will throw! - // The point of this test case is asserting that save() isn't called. - $parserCache = $this->createNoOpMock( ParserCache::class, [ 'get', 'getDirty', 'makeParserOutputKey' ] ); - $parserCache->method( 'get' )->willReturn( false ); - $parserCache->method( 'getDirty' )->willReturn( false ); - $parserCache->expects( $this->atLeastOnce() )->method( 'makeParserOutputKey' ); - - $this->resetServicesWithMockedParsoid(); - $access = $this->newRealParserOutputAccess( [ - 'parserCache' => $parserCache, - 'revisionCache' => $this->createNoOpMock( RevisionOutputCache::class ), - ] ); - - $helper = $this->newHelper( $access, $page, self::PARAM_DEFAULTS, $this->newAuthority() ); - - // Set read = true, write = false - $helper->setUseParserCache( true, false ); - $helper->getHtml(); - } - - public function testDisableParserCacheRead() { - $page = $this->getExistingTestPage( __METHOD__ ); - - // NOTE: The get() method is not supported and will throw! - // The point of this test case is asserting that get() isn't called. - // We also check that save() is still called. - // (Also ::getDirty() shouldn't be used on this path and will throw!) - $parserCache = $this->createNoOpMock( ParserCache::class, [ 'save', 'makeParserOutputKey' ] ); - $parserCache->expects( $this->once() )->method( 'save' ); - $parserCache->expects( $this->atLeastOnce() )->method( 'makeParserOutputKey' ); - - $this->resetServicesWithMockedParsoid(); - $access = $this->newRealParserOutputAccess( [ - 'parserCache' => $parserCache, - 'revisionCache' => $this->createNoOpMock( RevisionOutputCache::class ), - ] ); - - $helper = $this->newHelper( $access, $page, self::PARAM_DEFAULTS, $this->newAuthority() ); - - // Set read = false, write = true - $helper->setUseParserCache( false, true ); - $helper->getHtml(); - } - public function testGetParserOutputWithLanguageOverride() { [ $page, [ 'latest' => $revision ] ] = $this->getExistingPageWithRevisions( __METHOD__, '{{PAGELANGUAGE}}' ); |