Skip to content

Commit 70eb795

Browse files
author
Mike Feijs
committed
Change return value of getRedirectType to empty array instead of null
1 parent 9e44c31 commit 70eb795

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/Message/ExpressAuthorizeResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getRedirectMethod()
3939

4040
public function getRedirectData()
4141
{
42-
return null;
42+
return [];
4343
}
4444

4545
protected function getRedirectQueryParameters()

src/Message/RestAuthorizeResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ public function getRedirectMethod()
9191
/**
9292
* Gets the redirect form data array, if the redirect method is POST.
9393
*
94-
* @return null
94+
* @return array
9595
*/
9696
public function getRedirectData()
9797
{
98-
return null;
98+
return [];
9999
}
100100
}

tests/Message/ExpressAuthorizeResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testExpressPurchaseSuccess()
2626
$this->assertFalse($response->isSuccessful());
2727
$this->assertSame('EC-42721413K79637829', $response->getTransactionReference());
2828
$this->assertNull($response->getMessage());
29-
$this->assertNull($response->getRedirectData());
29+
$this->assertEquals([], $response->getRedirectData());
3030
$this->assertSame('https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl());
3131
$this->assertSame('GET', $response->getRedirectMethod());
3232
}

tests/Message/ExpressInContextAuthorizeResponseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testExpressPurchaseSuccess()
2626
$this->assertFalse($response->isSuccessful());
2727
$this->assertSame('EC-42721413K79637829', $response->getTransactionReference());
2828
$this->assertNull($response->getMessage());
29-
$this->assertNull($response->getRedirectData());
29+
$this->assertEquals([], $response->getRedirectData());
3030
$this->assertSame('https://www.sandbox.paypal.com/checkoutnow?useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl());
3131
$this->assertSame('GET', $response->getRedirectMethod());
3232
}
@@ -42,4 +42,4 @@ public function testExpressPurchaseFailure()
4242
$this->assertNull($response->getTransactionReference());
4343
$this->assertSame('This transaction cannot be processed. The amount to be charged is zero.', $response->getMessage());
4444
}
45-
}
45+
}

tests/Message/RestAuthorizeResponseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public function testRestPurchaseWithoutCardSuccess()
1717
$this->assertSame('PAY-3TJ47806DA028052TKTQGVYI', $response->getTransactionReference());
1818
$this->assertNull($response->getMessage());
1919

20-
$this->assertNull($response->getRedirectData());
20+
$this->assertEquals([], $response->getRedirectData());
2121
$this->assertSame('GET', $response->getRedirectMethod());
2222
$this->assertSame('https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-5KV58254GL528393N', $response->getRedirectUrl());
2323
}
24-
}
24+
}

0 commit comments

Comments
 (0)