Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ProcessableExceptionTest.php
Go to the documentation of this file.
1 <?php
7 
9 
10 class ProcessableExceptionTest extends \PHPUnit\Framework\TestCase
11 {
12  const UNKNOWN_CODE = 10411;
13 
17  private $model;
18 
25  public function testGetUserMessage($code, $msg)
26  {
27  $this->model = new ProcessableException(__($msg), null, $code);
28  $this->assertEquals($msg, $this->model->getUserMessage());
29  }
30 
34  public function getUserMessageDataProvider()
35  {
36  return [
37  [
39  "I'm sorry - but we were not able to process your payment. "
40  . "Please try another payment method or contact us so we can assist you.",
41  ],
42  [
44  "I'm sorry - but we were not able to process your payment. "
45  . "Please try another payment method or contact us so we can assist you."
46  ],
47  [
49  "I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
50  ],
51  [
53  "I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
54  ],
55  [
57  "I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
58  ],
59  [
61  'A match of the Shipping Address City, State, and Postal Code failed.'
62  ],
63  [
65  "We can't place the order."
66  ]
67  ];
68  }
69 }
__()
Definition: __.php:13
$code
Definition: info.phtml:12