Skip to content

Commit 4aab397

Browse files
committed
AC-1228::Fixed Automation Test Issue
1 parent 02571fc commit 4aab397

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

app/code/Magento/Paypal/Model/SmartButtonConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getConfig(string $page): array
9393
'isGuestCheckoutAllowed' => $isGuestCheckoutAllowed,
9494
'sdkUrl' => $this->sdkUrl->getUrl(),
9595
'dataAttributes' => [
96-
'data-partner-attribution-id' => $config->getBuildNotationCode() != '' ?
96+
'data-partner-attribution-id' => $config->getBuildNotationCode() != '' ?
9797
$config->getBuildNotationCode() : ''
9898
]
9999
];

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Store\Model\StoreManagerInterface;
1717
use PHPUnit\Framework\MockObject\MockObject;
1818
use PHPUnit\Framework\TestCase;
19+
use Magento\Paypal\Model\Payflowpro;
1920

2021
/**
2122
* Test for smart button config
@@ -37,6 +38,11 @@ class SmartButtonConfigTest extends TestCase
3738
*/
3839
private $configMock;
3940

41+
/**
42+
* @var Payflowpro
43+
*/
44+
private $payflowpro;
45+
4046
/**
4147
* @inheritDoc
4248
*/
@@ -47,6 +53,9 @@ protected function setUp(): void
4753
->disableOriginalConstructor()
4854
->getMock();
4955

56+
$this->payflowproMock = $this->getMockBuilder(Payflowpro::class)
57+
->getMock();
58+
5059
/** @var ScopeConfigInterface|MockObject $scopeConfigMock */
5160
$scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
5261
$scopeConfigMock->method('isSetFlag')
@@ -68,6 +77,7 @@ protected function setUp(): void
6877
$scopeConfigMock,
6978
$sdkUrl,
7079
$this->getDefaultStyles(),
80+
$this->payflowproMock
7181
);
7282
}
7383

@@ -116,6 +126,7 @@ public function testGetConfig(
116126
);
117127

118128
self::assertEquals($expected, $this->model->getConfig($page));
129+
119130
}
120131

121132
/**

app/code/Magento/Paypal/Test/Unit/Model/_files/expected_style_config.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
'isGuestCheckoutAllowed' => true,
3030
'sdkUrl' => 'http://mock.url',
3131
'dataAttributes' => [
32-
'data-partner-attribution-id' => 'Magento_2_%s'
32+
'data-partner-attribution-id' => 'Magento_2_%s'
3333
]
3434
]
3535
],
@@ -56,7 +56,7 @@
5656
'isGuestCheckoutAllowed' => true,
5757
'sdkUrl' => 'http://mock.url',
5858
'dataAttributes' => [
59-
'data-partner-attribution-id' => 'Magento_2_%s'
59+
'data-partner-attribution-id' => 'Magento_2_%s'
6060
]
6161
]
6262
],
@@ -82,7 +82,7 @@
8282
'isGuestCheckoutAllowed' => true,
8383
'sdkUrl' => 'http://mock.url',
8484
'dataAttributes' => [
85-
'data-partner-attribution-id' => 'Magento_2_%s'
85+
'data-partner-attribution-id' => 'Magento_2_%s'
8686
]
8787
]
8888
],
@@ -108,7 +108,7 @@
108108
'isGuestCheckoutAllowed' => true,
109109
'sdkUrl' => 'http://mock.url',
110110
'dataAttributes' => [
111-
'data-partner-attribution-id' => 'Magento_2_%s'
111+
'data-partner-attribution-id' => 'Magento_2_%s'
112112
]
113113
]
114114
],

0 commit comments

Comments
 (0)