mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-12-22 03:32:41 +00:00
9b6d34ddf2
https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:%2522Widen%2522 Change-Id: I1d2a75a7f64500b81f95d895ce065e80e336fba7
26 lines
866 B
PHP
26 lines
866 B
PHP
<?php
|
|
|
|
namespace phpunit\integration;
|
|
|
|
use MediaWiki\Revision\RevisionRecord;
|
|
use MediaWiki\Revision\SlotRecord;
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\Gadgets\Content\GadgetDefinitionContent
|
|
* @covers \MediaWiki\Extension\Gadgets\Content\GadgetDefinitionContentHandler
|
|
* @group Gadgets
|
|
* @group Database
|
|
*/
|
|
class GadgetDefinitionContentHandlerTest extends MediaWikiIntegrationTestCase {
|
|
|
|
public function testHandler() {
|
|
$status = $this->editPage( 'MediaWiki:Gadgets/X1.json', '{}' );
|
|
/** @var RevisionRecord $rev */
|
|
$rev = $status->getValue()['revision-record'];
|
|
$revText = $rev->getContent( SlotRecord::MAIN )->serialize();
|
|
$handler = $this->getServiceContainer()->getContentHandlerFactory()->getContentHandler( 'GadgetDefinition' );
|
|
$this->assertEquals( $handler->makeEmptyContent()->serialize(), $revText );
|
|
}
|
|
}
|