File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -274,9 +274,15 @@ protected function setYearParameter($key, $value)
274
274
*/
275
275
public function validate ()
276
276
{
277
- foreach (array ('number ' , 'expiryMonth ' , 'expiryYear ' ) as $ key ) {
277
+ $ requiredParameters = array (
278
+ 'number ' => 'credit card number ' ,
279
+ 'expiryMonth ' => 'expiration month ' ,
280
+ 'expiryYear ' => 'expiration year '
281
+ );
282
+
283
+ foreach ($ requiredParameters as $ key => $ val ) {
278
284
if (!$ this ->getParameter ($ key )) {
279
- throw new InvalidCreditCardException ("The $ key parameter is required " );
285
+ throw new InvalidCreditCardException ("The $ val is required " );
280
286
}
281
287
}
282
288
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function testValidateFixture()
57
57
58
58
/**
59
59
* @expectedException \Omnipay\Common\Exception\InvalidCreditCardException
60
- * @expectedExceptionMessage The number parameter is required
60
+ * @expectedExceptionMessage The credit card number is required
61
61
*/
62
62
public function testValidateNumberRequired ()
63
63
{
@@ -67,7 +67,7 @@ public function testValidateNumberRequired()
67
67
68
68
/**
69
69
* @expectedException \Omnipay\Common\Exception\InvalidCreditCardException
70
- * @expectedExceptionMessage The expiryMonth parameter is required
70
+ * @expectedExceptionMessage The expiration month is required
71
71
*/
72
72
public function testValidateExpiryMonthRequired ()
73
73
{
@@ -77,7 +77,7 @@ public function testValidateExpiryMonthRequired()
77
77
78
78
/**
79
79
* @expectedException \Omnipay\Common\Exception\InvalidCreditCardException
80
- * @expectedExceptionMessage The expiryYear parameter is required
80
+ * @expectedExceptionMessage The expiration year is required
81
81
*/
82
82
public function testValidateExpiryYearRequired ()
83
83
{
You can’t perform that action at this time.
0 commit comments