public function testApply()
 {
     $this->validatorValidation->addSourceConstraint('sourceField', new Email());
     $this->validatorValidation->addTargetConstraint('targetField', new NotNull());
     $expectedSourceFilter = new ValidatorFilter($this->validatorMock);
     $expectedSourceFilter->setAllowExtraFields(true);
     $expectedSourceFilter->add('sourceField', new Email());
     $expectedTargetFilter = new ValidatorFilter($this->validatorMock);
     $expectedTargetFilter->setAllowExtraFields(true);
     $expectedTargetFilter->add('targetField', new NotNull());
     $workflow = $this->getMockBuilder('Ddeboer\\DataImport\\Workflow')->disableOriginalConstructor()->getMock();
     $workflow->expects($this->once())->method('addFilter')->with($expectedSourceFilter);
     $workflow->expects($this->once())->method('addFilterAfterConversion')->with($expectedTargetFilter);
     $this->validatorValidation->apply($workflow);
 }
 /**
  * @return array
  */
 public function getViolations()
 {
     $violations = array('source' => array(), 'target' => array());
     if ($this->sourceValidatorFilter) {
         $violations['source'] = $this->sourceValidatorFilter->getViolations();
     }
     if ($this->targetValidatorFilter) {
         $violations['target'] = $this->targetValidatorFilter->getViolations();
     }
     return $violations;
 }
 public function testPriority()
 {
     $this->assertEquals(64, $this->validatorFilter->getPriority());
 }
 public function __construct(ValidatorInterface $validator, ObjectFactoryInterface $objectFactory, EventDispatcherInterface $eventDispatcher = null)
 {
     parent::__construct($validator, array(), $eventDispatcher);
     $this->objectFactory = $objectFactory;
 }