/**
  * @expectedException \eBayEnterprise\RetailOrderManagement\Payload\Exception\InvalidPayload
  */
 public function testDeserializeWillFailSchemaValidation()
 {
     $this->schemaValidatorStub->expects($this->any())->method('validate')->will($this->throwException(new Payload\Exception\InvalidPayload()));
     $xml = $this->xmlInvalidTestString();
     $newPayload = new StoredValueRedeemReply($this->validatorIterator, $this->schemaValidatorStub, $this->payloadMap, new NullLogger());
     $newPayload->deserialize($xml);
 }
 /**
  * Validate the serialized data via the schema validator.
  * @param  string $serializedData
  * @return self
  */
 protected function schemaValidate($serializedData)
 {
     $this->schemaValidator->validate($serializedData, $this->getSchemaFile());
     return $this;
 }
 /**
  * @param array $payloadData
  * @dataProvider provideInvalidPayload
  * @expectedException \eBayEnterprise\RetailOrderManagement\Payload\Exception\InvalidPayload
  */
 public function testSerializeWillFailXsdValidation(array $payloadData)
 {
     $payload = $this->buildPayload($payloadData);
     $this->schemaValidatorStub->expects($this->any())->method('validate')->will($this->throwException(new Payload\Exception\InvalidPayload()));
     $payload->serialize();
 }