mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-18 17:50:43 +00:00
c7b60735fe
This seems to play well with Popups with and without Ie8fa1672b9fd . However, it's not clear to me why this still works and even gives priority to the Popups implementation when present, regardless of the order the extensions are loaded in. Happily, this is the desired behavior. Bug: T363162 Change-Id: Ic479c0a381ee16d1abcecfdd5ee48f0afccc1d3f
35 lines
928 B
PHP
35 lines
928 B
PHP
<?php
|
|
|
|
namespace Cite\Tests\Unit;
|
|
|
|
use Cite\Hooks\CiteHooks;
|
|
use Cite\ReferencePreviews\ReferencePreviewsContext;
|
|
use Cite\ReferencePreviews\ReferencePreviewsGadgetsIntegration;
|
|
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' );
|
|
|
|
( new CiteHooks(
|
|
$this->createMock( ReferencePreviewsContext::class ),
|
|
$this->createMock( ReferencePreviewsGadgetsIntegration::class ),
|
|
new StaticUserOptionsLookup( [] )
|
|
) )
|
|
->onContentHandlerDefaultModelFor( $title, $model );
|
|
|
|
$this->assertSame( CONTENT_MODEL_JSON, $model );
|
|
}
|
|
|
|
}
|