public function getPlugins(DeliveryExecution $deliveryExecution)
    {
        $serviceManager = $this->getServiceManager();

        $pluginService = $serviceManager->get(TestPluginService::SERVICE_ID);
        $testRunnerFeatureService = $serviceManager->get(TestRunnerFeatureService::SERVICE_ID);

        $allPlugins = $pluginService->getAllPlugins();

        $allTestRunnerFeatures = $testRunnerFeatureService->getAll();
        $activeTestRunnerFeaturesIds = $this->getActiveFeatures($deliveryExecution->getDelivery());

        // If test runner features are defined, we check if we need to disable some plugins accordingly
        if (count($allTestRunnerFeatures) > 0) {
            $pluginsToDisable = [];
            foreach ($allTestRunnerFeatures as $feature) {
                if (!in_array($feature->getId(), $activeTestRunnerFeaturesIds)) {
                    $pluginsToDisable = array_merge($pluginsToDisable, $feature->getPluginsIds());
                }
            }

            foreach ($allPlugins as $plugin) {
                if (!is_null($plugin) && in_array($plugin->getId(), $pluginsToDisable)) {
                    $plugin->setActive(false);
                }
            }
        }

        // return the list of active plugins
        return array_filter($allPlugins, function ($plugin) {
            return !is_null($plugin) && $plugin->isActive();
        });
    }
public function getPlugins(DeliveryExecution $deliveryExecution)
    {
        $serviceManager = $this->getServiceManager();

        $pluginService = $serviceManager->get(TestPluginService::SERVICE_ID);
        $testRunnerFeatureService = $serviceManager->get(TestRunnerFeatureService::SERVICE_ID);

        $allPlugins = $pluginService->getAllPlugins();

        $allTestRunnerFeatures = $testRunnerFeatureService->getAll();
        $activeTestRunnerFeaturesIds = $this->getActiveFeatures($deliveryExecution->getDelivery());

        // If test runner features are defined, we check if we need to disable some plugins accordingly
        if (count($allTestRunnerFeatures) > 0) {
            $pluginsToDisable = [];
            foreach ($allTestRunnerFeatures as $feature) {
                if (!in_array($feature->getId(), $activeTestRunnerFeaturesIds)) {
                    $pluginsToDisable = array_merge($pluginsToDisable, $feature->getPluginsIds());
                }
            }

            foreach ($allPlugins as $plugin) {
                if (!is_null($plugin) && in_array($plugin->getId(), $pluginsToDisable)) {
                    $plugin->setActive(false);
                }
            }
        }

        // return the list of active plugins
        return array_filter($allPlugins, function ($plugin) {
            return !is_null($plugin) && $plugin->isActive();
        });
    }
public function getPlugins ( DeliveryExecution $ deliveryExecution ) { $ serviceManager = $ this -> getServiceManager ( ) ; $ pluginService = $ serviceManager -> get ( TestPluginService :: SERVICE_ID ) ; $ testRunnerFeatureService = $ serviceManager -> get ( TestRunnerFeatureService :: SERVICE_ID ) ; $ allPlugins = $ pluginService -> getAllPlugins ( ) ; $ allTestRunnerFeatures = $ testRunnerFeatureService -> getAll ( ) ; $ activeTestRunnerFeaturesIds = $ this -> getActiveFeatures ( $ deliveryExecution -> getDelivery ( ) ) ; // If test runner features are defined, we check if we need to disable some plugins accordingly if ( count ( $ allTestRunnerFeatures ) > 0 ) { $ pluginsToDisable = [ ] ; foreach ( $ allTestRunnerFeatures as $ feature ) { if ( ! in_array ( $ feature -> getId ( ) , $ activeTestRunnerFeaturesIds ) ) { $ pluginsToDisable = array_merge ( $ pluginsToDisable , $ feature -> getPluginsIds ( ) ) ; } } foreach ( $ allPlugins as $ plugin ) { if ( ! is_null ( $ plugin ) && in_array ( $ plugin -> getId ( ) , $ pluginsToDisable ) ) { $ plugin -> setActive ( false ) ; } } } // return the list of active plugins return array_filter ( $ allPlugins , function ( $ plugin ) { return ! is_null ( $ plugin ) && $ plugin -> isActive ( ) ; } ) ; }
Get the list of active plugins for the current execution
@param DeliveryExecution $deliveryExecution
@return TestPlugin[] the list of plugins
Get the list of active plugins for the current execution