mediawiki-extensions-Discus.../tests/phpunit/ServiceWiringTest.php
Fomafix 32069364ff Use $this->getServiceContainer() in maintenance and tests
Use
	$this->getServiceContainer()
instead of
	MediaWikiServices::getInstance()
in maintenance and tests.

Change-Id: I4066d7b2029296f1edb164acc5f8c812ccfba808
2024-07-03 08:44:55 +00:00

32 lines
726 B
PHP

<?php
/**
* Copy of CentralAuth's CentralAuthServiceWiringTest.php
* used to test the ServiceWiring.php file.
*/
namespace MediaWiki\Extension\DiscussionTools\Tests;
/**
* Tests ServiceWiring.php
*
* @coversNothing PHPUnit does not support covering annotations for files
* @group DiscussionTools
*/
class ServiceWiringTest extends IntegrationTestCase {
/**
* @dataProvider provideService
*/
public function testService( string $name ) {
$this->getServiceContainer()->get( $name );
$this->addToAssertionCount( 1 );
}
public static function provideService() {
$wiring = require __DIR__ . '/../../includes/ServiceWiring.php';
foreach ( $wiring as $name => $_ ) {
yield $name => [ $name ];
}
}
}