public function testGetTypeChoices() { $callable = array(new TestJob(), 'log'); $jobType = new JobType('service-id', 'JobType', $callable); $this->subject->register($jobType); $this->assertEquals(['JobType'], $this->subject->getTypeChoices()); }
private function initializeConstraints() { $this->constraints = array(); $priority = []; foreach ($this->providers as $provider) { foreach ($this->registry->getTypeChoices() as $type) { $constraints = $provider->getConstraints($type); if (is_array($constraints) && count($constraints) > 0) { if (!isset($this->constraints[$type]) || $provider->getPriority() > $priority[$type]) { $this->constraints[$type] = $constraints; $priority[$type] = $provider->getPriority(); } } } } }