Debian Codegraph @

tests/phpunit/includes/actions/ActionFactoryIntegrationTest.php

raw symbols SCIP
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 * Test that runs against all core actions to make sure that
10 * creating an instance of the action works
11 *
12 * @coversNothing
13 * @group Database
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 }