<?php
-use MediaWiki\Storage\MutableRevisionRecord;
-use MediaWiki\Storage\RevisionRecord;
-use MediaWiki\Storage\SlotRecord;
+use MediaWiki\Revision\MutableRevisionRecord;
+use MediaWiki\Revision\RevisionRecord;
+use MediaWiki\Revision\SlotRecord;
use Wikimedia\TestingAccessWrapper;
/**
* @dataProvider provideGenerateContentDiffBody
*/
public function testGenerateContentDiffBody(
- Content $oldContent, Content $newContent, $expectedDiff
+ array $oldContentArgs, array $newContentArgs, $expectedDiff
) {
+ $this->mergeMwGlobalArrayValue( 'wgContentHandlers', [
+ 'testing-nontext' => DummyNonTextContentHandler::class,
+ ] );
+ $oldContent = ContentHandler::makeContent( ...$oldContentArgs );
+ $newContent = ContentHandler::makeContent( ...$newContentArgs );
+
// Set $wgExternalDiffEngine to something bogus to try to force use of
// the PHP engine rather than wikidiff2.
$this->setMwGlobals( [
$this->assertSame( $expectedDiff, $this->getPlainDiff( $diff ) );
}
- public function provideGenerateContentDiffBody() {
- $this->mergeMwGlobalArrayValue( 'wgContentHandlers', [
- 'testing-nontext' => DummyNonTextContentHandler::class,
- ] );
- $content1 = ContentHandler::makeContent( 'xxx', null, CONTENT_MODEL_TEXT );
- $content2 = ContentHandler::makeContent( 'yyy', null, CONTENT_MODEL_TEXT );
+ public static function provideGenerateContentDiffBody() {
+ $content1 = [ 'xxx', null, CONTENT_MODEL_TEXT ];
+ $content2 = [ 'yyy', null, CONTENT_MODEL_TEXT ];
return [
'self-diff' => [ $content1, $content1, '' ],
$customContentHandler->expects( $this->any() )
->method( 'createDifferenceEngine' )
->willReturn( $customDifferenceEngine );
- /** @var $customContentHandler ContentHandler */
+ /** @var ContentHandler $customContentHandler */
$customContent = $this->getMockBuilder( Content::class )
->setMethods( [ 'getContentHandler' ] )
->getMockForAbstractClass();
$customContent->expects( $this->any() )
->method( 'getContentHandler' )
->willReturn( $customContentHandler );
- /** @var $customContent Content */
+ /** @var Content $customContent */
$customContent2 = clone $customContent;
$slotDiffRenderer = $customContentHandler->getSlotDiffRenderer( RequestContext::getMain() );