public function testHas() { $this->assertFalse($this->subject->has(null)); $this->assertFalse($this->subject->has('foobar')); $callable = array(new TestJob(), 'log'); $jobType = new JobType('service-id', 'type', $callable); $this->subject->register($jobType); $this->assertTrue($this->subject->has('type')); }
/** * {@inheritdoc} */ public function validate($value, Constraint $constraint) { if (null === $value) { return; } if (!$this->registry->has($value)) { $this->context->buildViolation($constraint->message)->setParameter('{{string}}', $value)->addViolation(); } }