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
module-paypal
Test
Unit
Model
Payflow
Service
Response
Validator
IAVSResponseTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Paypal\Test\Unit\Model\Payflow\Service\Response\Validator
;
7
8
use
Magento\Framework\DataObject
;
9
use
Magento\Paypal\Model\Payflow\Service\Response\Validator\IAVSResponse
;
10
use
Magento\Paypal\Model\Payflow\Transparent
;
11
use
Magento\Paypal\Model\PayflowConfig
;
12
use PHPUnit_Framework_MockObject_MockObject as MockObject;
13
14
class
IAVSResponseTest
extends
\PHPUnit\Framework\TestCase
15
{
24
public
function
testValidate($configValue, $iavs, $expected)
25
{
26
$response
=
new
DataObject
([
27
'iavs'
=> $iavs
28
]);
29
31
$config
= $this->getMockBuilder(PayflowConfig::class)
32
->disableOriginalConstructor()
33
->getMock();
34
36
$model
= $this->getMockBuilder(Transparent::class)
37
->disableOriginalConstructor()
38
->getMock();
39
40
$model
->method(
'getConfig'
)
41
->willReturn(
$config
);
42
43
$config
->method(
'getValue'
)
44
->willReturn($configValue);
45
46
$validator =
new
IAVSResponse
();
47
self::assertEquals($expected, $validator->validate(
$response
,
$model
));
48
}
49
55
public
function
variationsDataProvider
()
56
{
57
return
[
58
[
'configValue'
=> 1,
'iavs'
=>
'Y'
,
'expected'
=>
false
],
59
[
'configValue'
=> 0,
'iavs'
=>
'Y'
,
'expected'
=>
true
],
60
[
'configValue'
=> 1,
'iavs'
=>
'N'
,
'expected'
=>
true
],
61
[
'configValue'
=> 1,
'iavs'
=>
'X'
,
'expected'
=>
true
],
62
[
'configValue'
=> 0,
'iavs'
=>
'X'
,
'expected'
=>
true
],
63
];
64
}
65
}
Magento\Paypal\Model\PayflowConfig
Definition:
PayflowConfig.php:14
$response
$response
Definition:
404.php:11
Magento\Paypal\Test\Unit\Model\Payflow\Service\Response\Validator
Definition:
AVSResponseTest.php:6
Magento\Paypal\Test\Unit\Model\Payflow\Service\Response\Validator\IAVSResponseTest\variationsDataProvider
variationsDataProvider()
Definition:
IAVSResponseTest.php:55
$config
$config
Definition:
fraud_order.php:17
$model
$model
Definition:
enable_catalog_product_reindex_schedule.php:9
Magento\Framework\DataObject
Definition:
DataObject.php:15
Magento\Paypal\Test\Unit\Model\Payflow\Service\Response\Validator\IAVSResponseTest
Definition:
IAVSResponseTest.php:14
Magento\Paypal\Model\Payflow\Transparent
Definition:
Transparent.php:29
Magento\Paypal\Model\Payflow\Service\Response\Validator\IAVSResponse
Definition:
IAVSResponse.php:16
Magento\Framework\DataObject
Definition:
Cache.php:6