| 1 |
<?php |
| 2 |
|
| 3 |
use MediaWiki\Actions\ActionFactory; |
| 4 |
use MediaWiki\Context\RequestContext; |
| 5 |
use MediaWiki\MediaWikiServices; |
| 6 |
use MediaWiki\Title\Title; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
class ActionFactoryIntegrationTest extends MediaWikiIntegrationTestCase { |
| 16 |
|
| 17 |
public function testActionFactoryServiceWiring() { |
| 18 |
$services = MediaWikiServices::getInstance(); |
| 19 |
$actionFactory = $services->getActionFactory(); |
| 20 |
$context = RequestContext::getMain(); |
| 21 |
$article = Article::newFromTitle( Title::makeTitle( NS_MAIN, 'ActionFactoryServiceWiringTest' ), $context ); |
| 22 |
|
| 23 |
$actionSpecs = ( new ReflectionClassConstant( ActionFactory::class, 'CORE_ACTIONS' ) )->getValue(); |
| 24 |
foreach ( $actionSpecs as $action => $_ ) { |
| 25 |
$this->assertInstanceOf( Action::class, $actionFactory->getAction( $action, $article, $context ) ); |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
} |