mediawiki-extensions-Math/tests/phpunit/unit/ServiceWiringTest.php
Moritz Schubotz (physikerwelt) 73c41b4626
Provide static Factory Class for Math related services
Initially we provide one service. More services will come in
the future.

Change-Id: I98a0f5f181f729e123a063dabf3597b5effa55b8
2022-07-22 18:59:11 +02:00

31 lines
660 B
PHP

<?php
namespace MediaWiki\Extension\Math\Tests;
use Generator;
use MediaWikiUnitTestCase;
/**
* @coversNothing
*/
class ServiceWiringTest extends MediaWikiUnitTestCase {
private const EXTENSION_PREFIX = 'Math.';
/**
* @dataProvider provideWiring
*/
public function testAllWiringsAreProperlyShaped( $name, $definition ): void {
$this->assertStringStartsWith( self::EXTENSION_PREFIX, $name );
$this->assertIsCallable( $definition );
}
public function provideWiring(): Generator {
$wiring = require __DIR__ . '/../../../ServiceWiring.php';
foreach ( $wiring as $name => $definition ) {
yield $name => [ $name, $definition ];
}
}
}