protected function setUp()
 {
     parent::setUp();
     $jobManager = new Manager();
     $jobManager->setServiceManager($this->services);
     $jobManager->addFeature(new JobLoader());
     $this->services->setAllowOverride(true)->setService(ServiceFactory::SERVICE, $jobManager)->setAllowOverride(false);
 }
Example #2
0
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $jobManager = new Manager();
     $config = $serviceLocator->get(ConfigServiceFactory::SERVICE)->job;
     foreach ($config as $key => $value) {
         switch ($key) {
             case 'features':
                 foreach ($value as $name => $options) {
                     if ($options instanceof Config) {
                         $options = $options->toArray();
                     }
                     if (is_int($name)) {
                         $jobManager->addFeature($options);
                     } else {
                         $jobManager->addFeature($name, $options);
                     }
                 }
                 break;
         }
     }
     return $jobManager;
 }