wiki.techinc.nl/tests/phpunit/includes/content/FallbackContentHandlerTest.php
DannyS712 7d398ffde6 Split FallbackContentHandlerTest into separate unit tests
Only testGetSlotDiffRenderer() requires integration
Clean up the code that is being moved, and fix
the remaining covers in the integration test

Change-Id: Ic5926b23daf6738c44d9a5aacb75276f81c51f7a
2021-03-30 14:23:00 +00:00

27 lines
712 B
PHP

<?php
/**
* See also unit tests at \MediaWiki\Tests\Unit\FallbackContentHandlerTest
*
* @group ContentHandler
*/
class FallbackContentHandlerTest extends MediaWikiLangTestCase {
/**
* @covers ContentHandler::getSlotDiffRenderer
*/
public function testGetSlotDiffRenderer() {
$context = new RequestContext();
$context->setRequest( new FauxRequest() );
$handler = new FallbackContentHandler( 'horkyporky' );
$slotDiffRenderer = $handler->getSlotDiffRenderer( $context );
$oldContent = $handler->unserializeContent( 'Foo' );
$newContent = $handler->unserializeContent( 'Foo bar' );
$diff = $slotDiffRenderer->getDiff( $oldContent, $newContent );
$this->assertNotEmpty( $diff );
}
}