diff options
Diffstat (limited to 'tests/phpunit')
-rw-r--r-- | tests/phpunit/integration/includes/Rest/Handler/TransformHandlerTest.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/phpunit/integration/includes/Rest/Handler/TransformHandlerTest.php b/tests/phpunit/integration/includes/Rest/Handler/TransformHandlerTest.php index 439468f5ae07..3a5488c85c20 100644 --- a/tests/phpunit/integration/includes/Rest/Handler/TransformHandlerTest.php +++ b/tests/phpunit/integration/includes/Rest/Handler/TransformHandlerTest.php @@ -36,7 +36,6 @@ class TransformHandlerTest extends MediaWikiIntegrationTestCase { $request = new RequestData( [ 'pathParams' => [ 'from' => ParsoidFormatHelper::FORMAT_WIKITEXT, - 'format' => ParsoidFormatHelper::FORMAT_HTML, ], 'bodyContents' => json_encode( [ 'wikitext' => '== h2 ==', @@ -48,13 +47,13 @@ class TransformHandlerTest extends MediaWikiIntegrationTestCase { '>h2</h2>', 200, [ 'content-type' => $htmlContentType ], + [ 'format' => ParsoidFormatHelper::FORMAT_HTML ] ]; // Convert HTML to wikitext //////////////////////////////////////////////////////////////// $request = new RequestData( [ 'pathParams' => [ 'from' => ParsoidFormatHelper::FORMAT_HTML, - 'format' => ParsoidFormatHelper::FORMAT_WIKITEXT, ], 'bodyContents' => json_encode( [ 'html' => '<pre>hi ho</pre>', @@ -66,13 +65,13 @@ class TransformHandlerTest extends MediaWikiIntegrationTestCase { 'hi ho', 200, [ 'content-type' => "text/plain; charset=utf-8; profile=\"$wikitextProfileUri\"" ], + [ 'format' => ParsoidFormatHelper::FORMAT_WIKITEXT ] ]; // Perform language variant conversion ////////////////////////////////////////////////////// $request = new RequestData( [ 'pathParams' => [ 'from' => ParsoidFormatHelper::FORMAT_PAGEBUNDLE, - 'format' => ParsoidFormatHelper::FORMAT_PAGEBUNDLE, ], 'bodyContents' => json_encode( [ // NOTE: input for pb2pb is expected in the 'original' structure for some reason @@ -110,6 +109,7 @@ class TransformHandlerTest extends MediaWikiIntegrationTestCase { // NOTE: Parsoid returns a content-language header in the page bundle, // but that header is not applied to the HTTP response, which is JSON. [ 'content-type' => $pbContentType ], + [ 'format' => ParsoidFormatHelper::FORMAT_PAGEBUNDLE ] ]; } @@ -121,7 +121,8 @@ class TransformHandlerTest extends MediaWikiIntegrationTestCase { RequestInterface $request, $expectedText, $expectedStatus = 200, - $expectedHeaders = [] + $expectedHeaders = [], + $config = [] ) { $this->overrideConfigValue( MainConfigNames::UsePigLatinVariant, true ); @@ -136,7 +137,7 @@ class TransformHandlerTest extends MediaWikiIntegrationTestCase { $pageConfigFactory, $dataAccess ); - $response = $this->executeHandler( $handler, $request ); + $response = $this->executeHandler( $handler, $request, $config ); $response->getBody()->rewind(); $data = $response->getBody()->getContents(); |