mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Add test for PayPal api exception friendly message
This commit is contained in:
parent
e762a17bdc
commit
b6125a59c3
1 changed files with 20 additions and 0 deletions
20
tests/PHPUnit/ApiClient/Exception/PayPalApiExceptionTest.php
Normal file
20
tests/PHPUnit/ApiClient/Exception/PayPalApiExceptionTest.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace WooCommerce\PayPalCommerce\ApiClient\Exception;
|
||||
|
||||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
|
||||
class PayPalApiExceptionTest extends TestCase
|
||||
{
|
||||
public function testFriendlyMessage()
|
||||
{
|
||||
$testee = new PayPalApiException();
|
||||
|
||||
$response = json_decode('{"details":[{"issue":"PAYMENT_DENIED"}]}');
|
||||
|
||||
$this->assertEquals(
|
||||
'PayPal rejected the payment. Please reach out to the PayPal support for more information.',
|
||||
$testee->get_customer_friendly_message($response)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue