*/ class TestRunnerFeatures { /** * Set the default Test Runner Features for a newly created delivery * xx * @param DeliveryCreatedEvent $event */ public static function enableDefaultFeatures(DeliveryCreatedEvent $event) { $serviceManager = ServiceManager::getServiceManager(); $testRunnerFeatureService = $serviceManager->get(TestRunnerFeatureService::SERVICE_ID); $allFeatures = $testRunnerFeatureService->getAll(); $defaultFeatures = []; foreach ($allFeatures as $feature) { if ($feature->isEnabledByDefault() === true) { $defaultFeatures[] = $feature->getId(); } } $delivery = new \core_kernel_classes_Resource($event->getDeliveryUri()); $delivery->setPropertiesValues([ DeliveryContainerService::TEST_RUNNER_FEATURES_PROPERTY => implode(',', $defaultFeatures) ]); } }