mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-28 00:40:12 +00:00
3d34307f87
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here. Bug: T352284 Depends-On: I42653491c19dde5de99e0661770e2c81df5d7e84 Change-Id: I22ff2effcf9b7f2162f5d57608d8ec3651b48dd7
30 lines
703 B
PHP
30 lines
703 B
PHP
<?php
|
|
|
|
namespace Cite\Tests\Unit;
|
|
|
|
use Cite\Hooks\CiteHooks;
|
|
use MediaWiki\Title\Title;
|
|
use MediaWiki\User\Options\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 );
|
|
}
|
|
|
|
}
|