setupEnv( $config, $data ); MockCommentFormatter::$data = $data; $commentFormatter = TestingAccessWrapper::newFromClass( MockCommentFormatter::class ); $actual = $commentFormatter->addDiscussionToolsInternal( $dom, RequestContext::getMain()->getLanguage() ); $mockSubStore = new MockSubscriptionStore(); $actual = MockCommentFormatter::postprocessTopicSubscription( $actual, RequestContext::getMain()->getLanguage(), $mockSubStore, self::getTestUser()->getUser() ); $actual = MockCommentFormatter::postprocessReplyTool( $actual, RequestContext::getMain()->getLanguage() ); // Optionally write updated content to the "reply HTML" files if ( getenv( 'DISCUSSIONTOOLS_OVERWRITE_TESTS' ) ) { self::overwriteTextFile( $expectedPath, $actual ); } self::assertEquals( $expected, $actual, $name ); } public function provideAddDiscussionToolsInternal() : array { return self::getJson( '../cases/formattedreply.json' ); } }