Example #1
0
 /**
  * Testing Magento_Validator_Entity_Properties::isValid with changed data and invoked setter
  */
 public function testIsValidFailed()
 {
     $this->_object->expects($this->once())->method('hasDataChanges')->will($this->returnValue(true));
     $this->_object->expects($this->once())->method('getData')->with('attr1')->will($this->returnValue(1));
     $this->_object->expects($this->once())->method('getOrigData')->with('attr1')->will($this->returnValue(2));
     $validator = new Magento_Validator_Entity_Properties();
     $validator->setReadOnlyProperties(array('attr1'));
     $this->assertFalse($validator->isValid($this->_object));
 }