From b98f7a6fc1bd2b6ffd8e2df46d4f6449e14e9227 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 20 Nov 2020 21:46:41 +0100 Subject: Extract helper classes from PageHTMLHandler This extracts two helper classes from PageHTMLHandler: * PageContentHelper for accessing page content. This replaces the LatestRevisionContentHandler mase class. * ParsoidHtmlHelper for generating HTML from wikitext using parsoid. The idea is to decouple the functionality from the REST handlers, so we can easily mix and match functionality to create a handler for the new per-revision HTML endpoint. Bug: T267981 Bug: T267982 Change-Id: I3226833d12e51c959712d642b0195de1fe1ef979 --- .../integration/includes/Rest/Handler/PageHTMLHandlerTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/phpunit/integration/includes/Rest/Handler/PageHTMLHandlerTest.php') diff --git a/tests/phpunit/integration/includes/Rest/Handler/PageHTMLHandlerTest.php b/tests/phpunit/integration/includes/Rest/Handler/PageHTMLHandlerTest.php index fecc42199f95..94bfa643999e 100644 --- a/tests/phpunit/integration/includes/Rest/Handler/PageHTMLHandlerTest.php +++ b/tests/phpunit/integration/includes/Rest/Handler/PageHTMLHandlerTest.php @@ -88,8 +88,9 @@ class PageHTMLHandlerTest extends MediaWikiIntegrationTestCase { ); if ( $parsoid !== null ) { - $wrapper = TestingAccessWrapper::newFromObject( $handler ); - $wrapper->parsoid = $parsoid; + $handlerWrapper = TestingAccessWrapper::newFromObject( $handler ); + $helperWrapper = TestingAccessWrapper::newFromObject( $handlerWrapper->htmlHelper ); + $helperWrapper->parsoid = $parsoid; } return $handler; -- cgit v1.2.3