2022-12-24 00:44:29 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Copy of CentralAuth's CentralAuthServiceWiringTest.php
|
|
|
|
* used to test the ServiceWiring.php file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\Notifications\Test;
|
|
|
|
|
|
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests ServiceWiring.php
|
|
|
|
*
|
|
|
|
* @coversNothing PHPUnit does not support covering annotations for files
|
|
|
|
* @group Echo
|
2023-08-04 00:31:24 +00:00
|
|
|
* @group Database
|
2022-12-24 00:44:29 +00:00
|
|
|
*/
|
|
|
|
class ServiceWiringTest extends MediaWikiIntegrationTestCase {
|
|
|
|
/**
|
|
|
|
* @dataProvider provideService
|
|
|
|
*/
|
|
|
|
public function testService( string $name ) {
|
2023-11-09 20:16:38 +00:00
|
|
|
$this->getServiceContainer()->get( $name );
|
2022-12-24 00:44:29 +00:00
|
|
|
$this->addToAssertionCount( 1 );
|
|
|
|
}
|
|
|
|
|
2023-05-20 18:35:53 +00:00
|
|
|
public static function provideService() {
|
2022-12-24 00:44:29 +00:00
|
|
|
$wiring = require __DIR__ . '/../../ServiceWiring.php';
|
|
|
|
foreach ( $wiring as $name => $_ ) {
|
|
|
|
yield $name => [ $name ];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|