mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-12-19 02:10:41 +00:00
05cc93b9be
Bug: T331222 Change-Id: I022a66267fd01efdfdc86cf0b21d3a0aaf7e5950
26 lines
861 B
PHP
26 lines
861 B
PHP
<?php
|
|
|
|
namespace phpunit\integration;
|
|
|
|
use MediaWiki\Revision\RevisionRecord;
|
|
use MediaWiki\Revision\SlotRecord;
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
/**
|
|
* @covers \MediaWiki\Extension\Gadgets\Content\GadgetDefinitionContentHandler
|
|
* @covers \MediaWiki\Extension\Gadgets\Content\GadgetDefinitionContent
|
|
* @group Gadgets
|
|
* @group Database
|
|
*/
|
|
class GadgetDefinitionContentHandlerTest extends MediaWikiIntegrationTestCase {
|
|
|
|
public function testHandler() {
|
|
$status = $this->editPage( 'Gadget definition:X1', '{}' );
|
|
/** @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 );
|
|
}
|
|
}
|