Skip to content

Commit 9e0d350

Browse files
author
Viktor Tymchynskyi
committed
Merge remote-tracking branch 'origin/MAGETWO-51014' into MPI-BUGFIXES
2 parents c966ecb + 32891e4 commit 9e0d350

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

app/code/Magento/Paypal/Test/Unit/Model/Api/ProcessableExceptionTest.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@
55
*/
66
namespace Magento\Paypal\Test\Unit\Model\Api;
77

8-
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
8+
use Magento\Paypal\Model\Api\ProcessableException;
99

1010
class ProcessableExceptionTest extends \PHPUnit_Framework_TestCase
1111
{
12-
/**
13-
* @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
14-
*/
15-
protected $objectManager;
12+
const UNKNOWN_CODE = 10411;
1613

1714
/**
18-
* @var \Magento\Paypal\Model\Api\ProcessableException
15+
* @var ProcessableException
1916
*/
20-
protected $model;
17+
private $model;
2118

2219
/**
2320
* @param int $code
@@ -27,8 +24,7 @@ class ProcessableExceptionTest extends \PHPUnit_Framework_TestCase
2724
*/
2825
public function testGetUserMessage($code, $msg)
2926
{
30-
$this->objectManager = new ObjectManager($this);
31-
$this->model = new \Magento\Paypal\Model\Api\ProcessableException(__($msg), null, $code);
27+
$this->model = new ProcessableException(__($msg), null, $code);
3228
$this->assertEquals($msg, $this->model->getUserMessage());
3329
}
3430

@@ -39,28 +35,35 @@ public function getUserMessageDataProvider()
3935
{
4036
return [
4137
[
42-
10001,
38+
ProcessableException::API_INTERNAL_ERROR,
4339
"I'm sorry - but we were not able to process your payment. "
4440
. "Please try another payment method or contact us so we can assist you.",
4541
],
4642
[
47-
10417,
43+
ProcessableException::API_UNABLE_PROCESS_PAYMENT_ERROR_CODE,
4844
"I'm sorry - but we were not able to process your payment. "
4945
. "Please try another payment method or contact us so we can assist you."
5046
],
5147
[
52-
10537,
48+
ProcessableException::API_COUNTRY_FILTER_DECLINE,
5349
"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
5450
],
5551
[
56-
10538,
52+
ProcessableException::API_MAXIMUM_AMOUNT_FILTER_DECLINE,
5753
"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
5854
],
5955
[
60-
10539,
56+
ProcessableException::API_OTHER_FILTER_DECLINE,
6157
"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
6258
],
63-
[10411, "something went wrong"]
59+
[
60+
ProcessableException::API_ADDRESS_MATCH_FAIL,
61+
'A match of the Shipping Address City, State, and Postal Code failed.'
62+
],
63+
[
64+
self::UNKNOWN_CODE,
65+
"We can't place the order."
66+
]
6467
];
6568
}
6669
}

app/code/Magento/Paypal/Test/Unit/Model/ExpressTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class ExpressTest extends \PHPUnit_Framework_TestCase
2222
ApiProcessableException::API_COUNTRY_FILTER_DECLINE,
2323
ApiProcessableException::API_MAXIMUM_AMOUNT_FILTER_DECLINE,
2424
ApiProcessableException::API_OTHER_FILTER_DECLINE,
25+
ApiProcessableException::API_ADDRESS_MATCH_FAIL
2526
];
2627

2728
/**

0 commit comments

Comments
 (0)