Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
integration
testsuite
Magento
Authorizenet
Controller
Directpost
Payment
BackendResponseTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Authorizenet\Controller\Directpost\Payment
;
8
9
use
Magento\TestFramework\TestCase\AbstractController
;
10
11
class
BackendResponseTest
extends
AbstractController
12
{
16
private
static
$entryPoint =
'authorizenet/directpost_payment/backendresponse'
;
17
21
public
function
testUnauthorizedRequest
()
22
{
23
$data
= [
24
'x_response_code'
=> 1,
25
'x_response_reason_code'
=> 1,
26
'x_invoice_num'
=> 1,
27
'x_amount'
=> 16,
28
'x_trans_id'
=>
'32iiw5ve'
,
29
'x_card_type'
=>
'American Express'
,
30
'x_account_number'
=>
'XXXX0002'
,
31
'x_MD5_Hash'
=>
'h6a4s2h'
32
];
33
$this->
getRequest
()->setPostValue(
$data
);
34
$this->
dispatch
(self::$entryPoint);
35
36
self::assertEquals(302, $this->
getResponse
()->getHttpResponseCode());
37
self::assertEmpty($this->
getResponse
()->getBody());
38
}
39
46
public
function
testSuccess
()
47
{
48
$data
= [
49
'x_response_code'
=> 1,
50
'x_response_reason_code'
=> 1,
51
'x_invoice_num'
=> 1,
52
'x_amount'
=> 16,
53
'x_trans_id'
=>
'32iiw5ve'
,
54
'x_card_type'
=>
'American Express'
,
55
'x_account_number'
=>
'XXXX0002'
,
56
'x_MD5_Hash'
=>
'0EAD2F65D3D879CCB0D1A6F24883AC92'
57
];
58
$this->
getRequest
()->setPostValue(
$data
);
59
$this->
dispatch
(self::$entryPoint);
60
self::assertEquals(200, $this->
getResponse
()->getHttpResponseCode());
61
self::assertContains(
'/sales/order/view'
, $this->
getResponse
()->getBody());
62
}
63
}
Magento\TestFramework\TestCase\AbstractController\getRequest
getRequest()
Definition:
AbstractController.php:124
Magento\Authorizenet\Controller\Directpost\Payment\BackendResponseTest\testUnauthorizedRequest
testUnauthorizedRequest()
Definition:
BackendResponseTest.php:21
Magento\TestFramework\TestCase\AbstractController\getResponse
getResponse()
Definition:
AbstractController.php:137
Magento\TestFramework\TestCase\AbstractController
Definition:
AbstractController.php:24
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Authorizenet\Controller\Directpost\Payment
Definition:
BackendResponseTest.php:7
Magento\Authorizenet\Controller\Directpost\Payment\BackendResponseTest
Definition:
BackendResponseTest.php:11
Magento\Framework\App\Action\Action\dispatch
dispatch(RequestInterface $request)
Definition:
Action.php:92
Magento\Authorizenet\Controller\Directpost\Payment\BackendResponseTest\testSuccess
testSuccess()
Definition:
BackendResponseTest.php:46