diff --git a/includes/actions/ActionFactory.php b/includes/actions/ActionFactory.php index 5937c10aa2d..d7c495b30c5 100644 --- a/includes/actions/ActionFactory.php +++ b/includes/actions/ActionFactory.php @@ -132,6 +132,7 @@ class ActionFactory { 'mcrundo' => [ 'class' => McrUndoAction::class, 'services' => [ + // Same as for McrRestoreAction 'ReadOnlyMode', 'RevisionLookup', 'RevisionRenderer', @@ -142,6 +143,7 @@ class ActionFactory { 'mcrrestore' => [ 'class' => McrRestoreAction::class, 'services' => [ + // Same as for McrUndoAction 'ReadOnlyMode', 'RevisionLookup', 'RevisionRenderer', diff --git a/tests/phpunit/includes/actions/ActionFactoryIntegrationTest.php b/tests/phpunit/includes/actions/ActionFactoryIntegrationTest.php new file mode 100644 index 00000000000..ae35d1294be --- /dev/null +++ b/tests/phpunit/includes/actions/ActionFactoryIntegrationTest.php @@ -0,0 +1,26 @@ +getActionFactory(); + $context = RequestContext::getMain(); + $article = Article::newFromTitle( Title::makeTitle( NS_MAIN, 'ActionFactoryServiceWiringTest' ), $context ); + + $actionSpecs = ( new ReflectionClassConstant( ActionFactory::class, 'CORE_ACTIONS' ) )->getValue(); + foreach ( $actionSpecs as $action => $_ ) { + $this->assertInstanceOf( Action::class, $actionFactory->getAction( $action, $article, $context ) ); + } + } + +}