Skip to content

Commit f3e9ece

Browse files
committed
AC-1228::Fixed Unit Test Issue
1 parent 4aab397 commit f3e9ece

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +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() != '' ?
97-
$config->getBuildNotationCode() : ''
96+
'data-partner-attribution-id' => ($config) ? $config->getBuildNotationCode() : ''
9897
]
9998
];
10099
}

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ class SmartButtonConfigTest extends TestCase
4848
*/
4949
protected function setUp(): void
5050
{
51-
$this->localeResolverMock = $this->getMockForAbstractClass(ResolverInterface::class);
52-
$this->configMock = $this->getMockBuilder(Config::class)
51+
$this->localeResolverMock = $this->getMockForAbstractClass(ResolverInterface::class);
52+
$this->configMock = $this->getMockBuilder(Config::class)
5353
->disableOriginalConstructor()
5454
->getMock();
55-
56-
$this->payflowproMock = $this->getMockBuilder(Payflowpro::class)
57-
->getMock();
55+
$this->payflowproMock = $this->createMock(Payflowpro::class);
5856

5957
/** @var ScopeConfigInterface|MockObject $scopeConfigMock */
6058
$scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
@@ -76,8 +74,8 @@ protected function setUp(): void
7674
$configFactoryMock,
7775
$scopeConfigMock,
7876
$sdkUrl,
79-
$this->getDefaultStyles(),
80-
$this->payflowproMock
77+
$this->payflowproMock,
78+
$this->getDefaultStyles()
8179
);
8280
}
8381

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' => ''
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' => ''
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' => ''
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' => ''
112112
]
113113
]
114114
],

0 commit comments

Comments
 (0)