mediawiki-extensions-Cite/tests/phpunit/CiteCSSFileModuleTest.php
Timo Tijhof 2ff327df53 tests: Widen @covers annotations
> We lose useful coverage and spend valuable time keeping these tags
> accurate through refactors (or worse, forget to do so).
>
> I am not disabling the "only track coverage of specified subject"
> benefits, nor am I claiming coverage in in classes outside the
> subject under test.
>
> Tracking tiny per-method details wastes time in keeping tags
> in sync during refactors, and time to realize (and fix) when people
> inevitably don't keep them in sync, and time lost in finding
> uncovered code to write tests for only to realize it was already
> covered but "not yet claimed".

https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:%2522Widen%2522

Change-Id: Iafa241210b81ba1cbfee74e3920fb044c86d09fc
2023-12-14 01:54:48 +00:00

30 lines
701 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'] );
}
}