mediawiki-extensions-Cite/tests/phpunit/CiteCSSFileModuleTest.php
Fomafix 96fad3ea99 tests: Use $this->getServiceContainer()
Use
	$this->getServiceContainer()
instead of
	MediaWikiServices::getInstance()
in tests.

Change-Id: I5e56524b85ba6e34cecffba2f24fb44b3f66ec8f
2023-10-26 19:59:14 +00:00

31 lines
704 B
PHP

<?php
namespace Cite\Tests;
use Cite\ResourceLoader\CiteCSSFileModule;
use MediaWiki\ResourceLoader\Context;
/**
* @covers \Cite\ResourceLoader\CiteCSSFileModule
*
* @license GPL-2.0-or-later
*/
class CiteCSSFileModuleTest extends \MediaWikiIntegrationTestCase {
protected function setUp(): void {
parent::setUp();
$this->setService(
'ContentLanguage',
$this->getServiceContainer()->getLanguageFactory()->getLanguage( 'fa' )
);
}
public function testModule() {
$module = new CiteCSSFileModule( [], __DIR__ . '/../../modules' );
$styles = $module->getStyleFiles( $this->createMock( Context::class ) );
$this->assertSame( [ 'ext.cite.style.fa.css' ], $styles['all'] );
}
}