Skip to content

Commit db809f1

Browse files
#39169: Special Price To Date is wrongly validated on applySpecialPrice
- moving SpecialPriceService to different namespace to pass static tests,changing SpecialPriceService property visibility to private
1 parent 706ee4c commit db809f1

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

app/code/Magento/Bundle/Model/Product/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Framework\Pricing\PriceCurrencyInterface;
1010
use Magento\Framework\App\ObjectManager;
1111
use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory;
12-
use Magento\Catalog\Service\SpecialPriceService;
12+
use Magento\Catalog\Model\Pricing\SpecialPriceService;
1313

1414
/**
1515
* Bundle product type price model

app/code/Magento/Bundle/Test/Unit/Model/Product/PriceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory;
1515
use Magento\Catalog\Helper\Data;
1616
use Magento\Catalog\Model\Product;
17-
use Magento\Catalog\Service\SpecialPriceService;
17+
use Magento\Catalog\Model\Pricing\SpecialPriceService;
1818
use Magento\CatalogRule\Model\ResourceModel\RuleFactory;
1919
use Magento\Customer\Api\GroupManagementInterface;
2020
use Magento\Customer\Model\Session;

app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Bundle\Pricing\Price\SpecialPrice;
1212
use Magento\Catalog\Model\Product;
1313
use Magento\Catalog\Pricing\Price\RegularPrice;
14-
use Magento\Catalog\Service\SpecialPriceService;
14+
use Magento\Catalog\Model\Pricing\SpecialPriceService;
1515
use Magento\Framework\Pricing\Price\PriceInterface;
1616
use Magento\Framework\Pricing\PriceCurrencyInterface;
1717
use Magento\Framework\Pricing\PriceInfo\Base;

app/code/Magento/Catalog/Service/SpecialPriceService.php renamed to app/code/Magento/Catalog/Model/Pricing/SpecialPriceService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\Catalog\Service;
8+
namespace Magento\Catalog\Model\Pricing;
99

1010
/**
1111
* This class provides functionality to normalize the end date/time of special prices

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory;
1616
use Magento\Framework\App\ObjectManager;
1717
use Magento\Store\Api\Data\WebsiteInterface;
18-
use Magento\Catalog\Service\SpecialPriceService;
18+
use Magento\Catalog\Model\Pricing\SpecialPriceService;
1919

2020
/**
2121
* Product type price model

app/code/Magento/Catalog/Pricing/Price/SpecialPrice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Framework\Pricing\Price\BasePriceProviderInterface;
1414
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1515
use Magento\Store\Api\Data\WebsiteInterface;
16-
use Magento\Catalog\Service\SpecialPriceService;
16+
use Magento\Catalog\Model\Pricing\SpecialPriceService;
1717

1818
/**
1919
* Special price model
@@ -33,7 +33,7 @@ class SpecialPrice extends AbstractPrice implements SpecialPriceInterface, BaseP
3333
/**
3434
* @var SpecialPriceService
3535
*/
36-
protected SpecialPriceService $specialPriceService;
36+
private SpecialPriceService $specialPriceService;
3737

3838
/**
3939
* @param Product $saleableItem

app/code/Magento/Catalog/Test/Unit/Service/SpecialPriceServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\Catalog\Test\Unit\Service;
99

10-
use Magento\Catalog\Service\SpecialPriceService;
10+
use Magento\Catalog\Model\Pricing\SpecialPriceService;
1111
use PHPUnit\Framework\TestCase;
1212

1313
/**

0 commit comments

Comments
 (0)