mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-04 20:28:49 +00:00
62c9c01dde
Test ServiceWiring.php using tests copied from CentralAuth. Because phpunit does not support marking a file as covered, the ServiceWiring file is ignored for code coverage as the tests should partly cover the file. Change-Id: I3ea5ae553d17e17680fcac4d92746fc7ce282eaa
35 lines
777 B
PHP
35 lines
777 B
PHP
<?php
|
|
|
|
/**
|
|
* Copy of CentralAuth's CentralAuthServiceWiringTest.php
|
|
* used to test the ServiceWiring.php file.
|
|
*/
|
|
|
|
namespace MediaWiki\Extension\Notifications\Test;
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
/**
|
|
* Tests ServiceWiring.php
|
|
*
|
|
* @coversNothing PHPUnit does not support covering annotations for files
|
|
* @group Echo
|
|
*/
|
|
class ServiceWiringTest extends MediaWikiIntegrationTestCase {
|
|
/**
|
|
* @dataProvider provideService
|
|
*/
|
|
public function testService( string $name ) {
|
|
MediaWikiServices::getInstance()->get( $name );
|
|
$this->addToAssertionCount( 1 );
|
|
}
|
|
|
|
public function provideService() {
|
|
$wiring = require __DIR__ . '/../../ServiceWiring.php';
|
|
foreach ( $wiring as $name => $_ ) {
|
|
yield $name => [ $name ];
|
|
}
|
|
}
|
|
}
|