mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-13 17:53:09 +00:00
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
This commit is contained in:
parent
9425bb3248
commit
2ff327df53
|
@ -7,7 +7,6 @@ use MediaWiki\ResourceLoader\Context;
|
|||
|
||||
/**
|
||||
* @covers \Cite\ResourceLoader\CiteCSSFileModule
|
||||
*
|
||||
* @license GPL-2.0-or-later
|
||||
*/
|
||||
class CiteCSSFileModuleTest extends \MediaWikiIntegrationTestCase {
|
||||
|
|
|
@ -7,7 +7,7 @@ use ParserOptions;
|
|||
|
||||
/**
|
||||
* @group Database
|
||||
*
|
||||
* @covers \Cite\ReferenceStack
|
||||
* @license GPL-2.0-or-later
|
||||
*/
|
||||
class CiteDbTest extends \MediaWikiIntegrationTestCase {
|
||||
|
@ -15,9 +15,8 @@ class CiteDbTest extends \MediaWikiIntegrationTestCase {
|
|||
protected $tablesUsed = [ 'page' ];
|
||||
|
||||
/**
|
||||
* Edge case where a parser call within `<ref>` parse clears the original parser state.
|
||||
* Parser call within `<ref>` parse clears the original parser state.
|
||||
* @see https://phabricator.wikimedia.org/T240248
|
||||
* @covers \Cite\ReferenceStack::pushRef
|
||||
*/
|
||||
public function testReferenceStackError() {
|
||||
$this->insertPage( 'Cite-tracking-category-cite-error', '{{PAGENAME}}', NS_MEDIAWIKI );
|
||||
|
|
|
@ -7,15 +7,11 @@ use Cite\Hooks\CiteHooks;
|
|||
use MediaWiki\User\Options\StaticUserOptionsLookup;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \Cite\Hooks\CiteHooks
|
||||
*
|
||||
* @covers \Cite\Hooks\CiteHooks
|
||||
* @license GPL-2.0-or-later
|
||||
*/
|
||||
class CiteHooksTest extends \MediaWikiIntegrationTestCase {
|
||||
|
||||
/**
|
||||
* @covers ::onResourceLoaderGetConfigVars
|
||||
*/
|
||||
public function testOnResourceLoaderGetConfigVars() {
|
||||
$vars = [];
|
||||
|
||||
|
@ -28,9 +24,6 @@ class CiteHooksTest extends \MediaWikiIntegrationTestCase {
|
|||
$this->assertArrayHasKey( 'wgCiteResponsiveReferences', $vars );
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::onAPIQuerySiteInfoGeneralInfo
|
||||
*/
|
||||
public function testOnAPIQuerySiteInfoGeneralInfo() {
|
||||
$api = $this->createMock( ApiQuerySiteinfo::class );
|
||||
$api->expects( $this->once() )
|
||||
|
|
|
@ -12,8 +12,7 @@ use ParserOptions;
|
|||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \Cite\Cite
|
||||
*
|
||||
* @covers \Cite\Cite
|
||||
* @license GPL-2.0-or-later
|
||||
*/
|
||||
class CiteIntegrationTest extends \MediaWikiIntegrationTestCase {
|
||||
|
@ -24,7 +23,6 @@ class CiteIntegrationTest extends \MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* @covers ::checkRefsNoReferences
|
||||
* @dataProvider provideCheckRefsNoReferences
|
||||
*/
|
||||
public function testCheckRefsNoReferences(
|
||||
|
|
|
@ -6,13 +6,10 @@ use Cite\ReferenceMessageLocalizer;
|
|||
use LanguageQqx;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \Cite\ReferenceMessageLocalizer
|
||||
* @covers \Cite\ReferenceMessageLocalizer
|
||||
*/
|
||||
class ReferenceMessageLocalizerTest extends \MediaWikiIntegrationTestCase {
|
||||
|
||||
/**
|
||||
* @covers ::msg
|
||||
*/
|
||||
public function testMsg() {
|
||||
$localizer = new ReferenceMessageLocalizer( new LanguageQqx() );
|
||||
$this->assertSame(
|
||||
|
|
Loading…
Reference in a new issue