mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
32069364ff
Use $this->getServiceContainer() instead of MediaWikiServices::getInstance() in maintenance and tests. Change-Id: I4066d7b2029296f1edb164acc5f8c812ccfba808
32 lines
726 B
PHP
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 ];
|
|
}
|
|
}
|
|
}
|