mediawiki-extensions-Echo/tests/phpunit/ServiceWiringTest.php
Dreamy Jazz 62c9c01dde Test ServiceWiring.php
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
2023-01-25 03:56:06 +00:00

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 ];
}
}
}