valid ? (Random::value($array)) : Random::value(array( null, '', Random::str(RefundReceiptResponse::LENGTH_REFUND_ID))); return $options; } /** * @dataProvider validDataProvider * @param array $options */ public function testSpecificProperties($options) { $instance = $this->getTestInstance($options); self::assertEquals($options['refund_id'], $instance->getRefundId()); } /** * @dataProvider invalidDataProvider * @param array $options */ public function testInvalidSpecificProperties($options) { $this->valid = false; $catch = false; try { $instance = $this->getTestInstance($options); $instance->setRefundId($options['refund_id']); } catch (InvalidPropertyValueException $e) { $catch = true; } catch (InvalidPropertyValueTypeException $e) { $catch = true; } self::assertTrue($catch); $catch = false; try { $refundId = $options['refund_id']; $options['refund_id'] = Random::str(RefundReceiptResponse::LENGTH_REFUND_ID); $instance = $this->getTestInstance($options); $instance->setRefundId($refundId); } catch (InvalidPropertyValueException $e) { $catch = true; } catch (InvalidPropertyValueTypeException $e) { $catch = true; } self::assertTrue($catch); } }