mediawiki-extensions-Echo/tests/phpunit/ServiceWiringTest.php
Daimona Eaytoy 713f60aaa5 Avoid DB access in non-Database tests
Use mocks when possible, and add the test to the Database group
otherwise.

Also rename 2 test files to avoid a PHPUnit deprecation of file name not
matching class name.

Change-Id: I16b2392daf01f63511c82b4ed0e67a38e35ddbe1
2023-08-04 02:31:24 +02:00

36 lines
803 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
* @group Database
*/
class ServiceWiringTest extends MediaWikiIntegrationTestCase {
/**
* @dataProvider provideService
*/
public function testService( string $name ) {
MediaWikiServices::getInstance()->get( $name );
$this->addToAssertionCount( 1 );
}
public static function provideService() {
$wiring = require __DIR__ . '/../../ServiceWiring.php';
foreach ( $wiring as $name => $_ ) {
yield $name => [ $name ];
}
}
}