public function testAnnotationValidation()
 {
     $this->setExpectedException('\\Borobudur\\Validator\\Exception\\ValidationException');
     $validation = new Validation();
     $validation->validateWithAnnotation(new People('', null));
     $validation->assertValid();
 }
Esempio n. 2
0
 /**
  * {@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);
 }