| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Extension\Math\Tests; |
| 4 |
|
| 5 |
use Generator; |
| 6 |
use MediaWikiUnitTestCase; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class ServiceWiringTest extends MediaWikiUnitTestCase { |
| 12 |
private const EXTENSION_PREFIX = 'Math.'; |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
public function testAllWiringsAreProperlyShaped( $name, $definition ): void { |
| 18 |
$this->assertStringStartsWith( self::EXTENSION_PREFIX, $name ); |
| 19 |
$this->assertIsCallable( $definition ); |
| 20 |
} |
| 21 |
|
| 22 |
public static function provideWiring(): Generator { |
| 23 |
$wiring = require __DIR__ . '/../../../ServiceWiring.php'; |
| 24 |
|
| 25 |
foreach ( $wiring as $name => $definition ) { |
| 26 |
yield $name => [ $name, $definition ]; |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
} |