Definition at line 9 of file CcTest.php.
◆ ccExpMonthDataProvider()
ccExpMonthDataProvider |
( |
| ) |
|
◆ getCcExpDateDataProvider()
getCcExpDateDataProvider |
( |
| ) |
|
◆ getCcTypeNameDataProvider()
getCcTypeNameDataProvider |
( |
| ) |
|
- Returns
- array
Definition at line 68 of file CcTest.php.
71 [[
'VS',
'MC',
'JCB'],
'JCB',
'JCB'],
72 [[
'VS',
'MC',
'JCB'],
'BNU',
'BNU'],
73 [[
'VS',
'MC',
'JCB'],
null,
'N/A'],
◆ hasCcExpDateDataProvider()
hasCcExpDateDataProvider |
( |
| ) |
|
◆ setUp()
Definition at line 31 of file CcTest.php.
33 $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
34 $this->paymentConfig = $this->createMock(\
Magento\Payment\Model\Config::class);
35 $this->localeDate = $this->createMock(\
Magento\Framework\Stdlib\DateTime\TimezoneInterface::class);
36 $context = $this->createPartialMock(\
Magento\Framework\View\Element\Template\Context::class, [
'getLocaleDate']);
37 $context->expects($this->any())
38 ->method(
'getLocaleDate')
39 ->will($this->returnValue($this->localeDate));
40 $this->model = $this->objectManager->getObject(
41 \
Magento\Payment\Block\Info\Cc::class,
43 'paymentConfig' => $this->paymentConfig,
◆ testGetCcExpDate()
testGetCcExpDate |
( |
|
$ccExpMonth, |
|
|
|
$ccExpYear |
|
) |
| |
@dataProvider getCcExpDateDataProvider
Definition at line 132 of file CcTest.php.
134 $paymentInfo = $this->createPartialMock(\
Magento\Payment\Model\Info::class, [
'getCcExpMonth',
'getCcExpYear']);
136 ->expects($this->any())
137 ->method(
'getCcExpMonth')
140 ->expects($this->any())
141 ->method(
'getCcExpYear')
146 ->expects($this->exactly(2))
147 ->method(
'getConfigTimezone')
148 ->willReturn(
'America/Los_Angeles');
150 $this->assertEquals(
$ccExpYear, $this->model->getCcExpDate()->format(
'Y'));
151 $this->assertEquals(
$ccExpMonth, $this->model->getCcExpDate()->format(
'm'));
◆ testGetCcExpMonth()
testGetCcExpMonth |
( |
|
$ccExpMonth, |
|
|
|
$expected |
|
) |
| |
@dataProvider ccExpMonthDataProvider
Definition at line 108 of file CcTest.php.
110 $paymentInfo = $this->createPartialMock(\
Magento\Payment\Model\Info::class, [
'getCcExpMonth']);
112 ->method(
'getCcExpMonth')
115 $this->assertEquals($expected, $this->model->getCcExpMonth());
◆ testGetCcTypeName()
testGetCcTypeName |
( |
|
$configCcTypes, |
|
|
|
$ccType, |
|
|
|
$expected |
|
) |
| |
@dataProvider getCcTypeNameDataProvider
Definition at line 52 of file CcTest.php.
54 $this->paymentConfig->expects($this->any())
55 ->method(
'getCcTypes')
56 ->will($this->returnValue($configCcTypes));
60 ->will($this->returnValue(
$ccType));
62 $this->assertEquals($expected, $this->model->getCcTypeName());
◆ testHasCcExpDate()
testHasCcExpDate |
( |
|
$ccExpMonth, |
|
|
|
$ccExpYear, |
|
|
|
$expected |
|
) |
| |
@dataProvider hasCcExpDateDataProvider
Definition at line 80 of file CcTest.php.
82 $paymentInfo = $this->createPartialMock(\
Magento\Payment\Model\Info::class, [
'getCcExpMonth',
'getCcExpYear']);
84 ->method(
'getCcExpMonth')
87 ->method(
'getCcExpYear')
90 $this->assertEquals($expected, $this->model->hasCcExpDate());
◆ $localeDate
◆ $model
◆ $objectManager
◆ $paymentConfig
The documentation for this class was generated from the following file:
- vendor/magento/module-payment/Test/Unit/Block/Info/CcTest.php