Skip to content

Commit 62f13e0

Browse files
committed
removed soap and static test failures.
1 parent afc7ed7 commit 62f13e0

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

app/code/Magento/Catalog/Model/Plugin/SpecialPricePluginForREST/SpecialPriceStoragePlugin.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,35 @@
1414
*/
1515
class SpecialPriceStoragePlugin
1616
{
17+
/**
18+
* Constructor
19+
*
20+
* @param StoreManagerInterface $storeManager
21+
*/
1722
public function __construct(
1823
private StoreManagerInterface $storeManager
19-
) {}
24+
) {
25+
}
2026

27+
/**
28+
* Around update plugin for REST api fix
29+
*
30+
* @param SpecialPriceStorage $subject
31+
* @param callable $proceed
32+
* @param array $prices
33+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
34+
*/
2135
public function aroundUpdate(SpecialPriceStorage $subject, callable $proceed, array $prices)
2236
{
2337
$prices = $this->applyWebsitePrices($prices);
2438
return $proceed($prices);
2539
}
2640

41+
/**
42+
* Function to get website id from current store id and then find all stores and apply prices to them
43+
*
44+
* @param array $formattedPrices
45+
*/
2746
private function applyWebsitePrices(array $formattedPrices): array
2847
{
2948
$newPrices = [];
@@ -53,5 +72,4 @@ private function applyWebsitePrices(array $formattedPrices): array
5372

5473
return $newPrices;
5574
}
56-
5775
}

dev/tests/api-functional/testsuite/Magento/Catalog/Model/Plugin/SpecialPricePluginForREST/SpecialPriceStoragePluginTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ protected function setUp(): void
5555
]
5656
public function testSpecialPriceIsAppliedToAllStoresInWebsite(): void
5757
{
58+
$this->_markTestAsRestOnly();
5859
$objectManager = Bootstrap::getObjectManager();
5960
$product = $this->fixtures->get('product');
6061
$sku = $product->getSku();
@@ -72,7 +73,7 @@ public function testSpecialPriceIsAppliedToAllStoresInWebsite(): void
7273
$restrictedUser->getData('username'),
7374
\Magento\TestFramework\Bootstrap::ADMIN_PASSWORD
7475
);
75-
76+
7677
$data = [
7778
'sku' => $sku,
7879
'price' =>123.45,

0 commit comments

Comments
 (0)