예제 #1
0
 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);
 }
예제 #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;
 }