/**
  * Check translator was set into wrapped validator
  */
 public function testSetTranslator()
 {
     /** @var \Magento\Framework\Translate\AbstractAdapter $translator */
     $translator = $this->getMockBuilder('Magento\\Framework\\Translate\\AdapterInterface')->getMockForAbstractClass();
     $this->_constraint->setTranslator($translator);
     $this->assertEquals($translator, $this->_validatorMock->getTranslator());
     $this->assertEquals($translator, $this->_constraint->getTranslator());
 }
Пример #2
0
 /**
  * Constructor
  *
  * @param \Magento\Framework\Validator\ValidatorInterface $validator
  * @param string $property
  * @param string $alias
  */
 public function __construct(\Magento\Framework\Validator\ValidatorInterface $validator, $property, $alias = null)
 {
     parent::__construct($validator, $alias);
     $this->_property = $property;
 }