2023-01-13 12:01:25 +00:00
|
|
|
<?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 ) {
|
2024-07-03 08:44:55 +00:00
|
|
|
$this->getServiceContainer()->get( $name );
|
2023-01-13 12:01:25 +00:00
|
|
|
$this->addToAssertionCount( 1 );
|
|
|
|
}
|
|
|
|
|
2023-05-20 13:57:13 +00:00
|
|
|
public static function provideService() {
|
2023-01-13 12:01:25 +00:00
|
|
|
$wiring = require __DIR__ . '/../../includes/ServiceWiring.php';
|
|
|
|
foreach ( $wiring as $name => $_ ) {
|
|
|
|
yield $name => [ $name ];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|