mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-01 01:56:20 +00:00
198ae5b21c
Bug: T321681 Change-Id: Idde5511e075fcec40cad12c7369abec3ee4d096c
30 lines
695 B
PHP
30 lines
695 B
PHP
<?php
|
|
|
|
namespace Cite\Tests\Unit;
|
|
|
|
use Cite\Hooks\CiteHooks;
|
|
use MediaWiki\Title\Title;
|
|
use MediaWiki\User\StaticUserOptionsLookup;
|
|
|
|
/**
|
|
* @covers \Cite\Hooks\CiteHooks
|
|
*
|
|
* @license GPL-2.0-or-later
|
|
*/
|
|
class CiteHooksUnitTest extends \MediaWikiUnitTestCase {
|
|
|
|
public function testOnContentHandlerDefaultModelFor() {
|
|
$title = $this->createMock( Title::class );
|
|
$title->method( 'inNamespace' )
|
|
->willReturn( true );
|
|
$title->method( 'getText' )
|
|
->willReturn( 'Cite-tool-definition.json' );
|
|
|
|
$citeHooks = new CiteHooks( new StaticUserOptionsLookup( [] ) );
|
|
$citeHooks->onContentHandlerDefaultModelFor( $title, $model );
|
|
|
|
$this->assertSame( CONTENT_MODEL_JSON, $model );
|
|
}
|
|
|
|
}
|