2022-12-24 01:06:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Copy of CentralAuth's CentralAuthServiceWiringTest.php
|
|
|
|
* used to test the ServiceWiring.php file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace MediaWiki\Skins\Vector\Tests\Integration;
|
|
|
|
|
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Partly Tests ServiceWiring.php by ensuring that the call to the
|
|
|
|
* service does not result in an error.
|
|
|
|
*
|
|
|
|
* @coversNothing PHPUnit does not support covering annotations for files
|
|
|
|
* @group Vector
|
|
|
|
*/
|
|
|
|
class ServiceWiringTest extends MediaWikiIntegrationTestCase {
|
|
|
|
/**
|
|
|
|
* @dataProvider provideService
|
|
|
|
*/
|
|
|
|
public function testService( string $name ) {
|
|
|
|
MediaWikiServices::getInstance()->get( $name );
|
|
|
|
$this->addToAssertionCount( 1 );
|
|
|
|
}
|
|
|
|
|
2023-05-20 09:01:16 +00:00
|
|
|
public static function provideService() {
|
2022-12-24 01:06:10 +00:00
|
|
|
$wiring = require __DIR__ . '/../../../includes/ServiceWiring.php';
|
|
|
|
foreach ( $wiring as $name => $_ ) {
|
|
|
|
yield $name => [ $name ];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|