public function testAnnotationValidation() { $this->setExpectedException('\\Borobudur\\Validator\\Exception\\ValidationException'); $validation = new Validation(); $validation->validateWithAnnotation(new People('', null)); $validation->assertValid(); }
/** * {@inheritdoc} */ public function dispatch(MessageInterface $command) { // Instantiate queue. if (null !== $this->container && false === $this->queued && $command instanceof JobInterface) { $this->queued = true; $this->container->get('cqrs.queue'); } $this->validator->validateWithAnnotation($command); $this->validator->assertValid(); return parent::dispatch($command); }