diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php index 591e648547d61..974397226c56c 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php @@ -50,7 +50,13 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract const VALIDATOR_WEBSITE = 'validator_website'; - const VALIDATOR_TEAR_PRICE = 'validator_tear_price'; + /** + * @deprecated + * @see VALIDATOR_TIER_PRICE + */ + private const VALIDATOR_TEAR_PRICE = 'validator_tier_price'; + + private const VALIDATOR_TIER_PRICE = 'validator_tier_price'; /** * Validation failure message template definitions. @@ -221,7 +227,7 @@ public function __construct( $this->_catalogProductEntity = $this->_resourceFactory->create()->getTable('catalog_product_entity'); $this->_oldSkus = $this->retrieveOldSkus(); $this->_validators[self::VALIDATOR_WEBSITE] = $websiteValidator; - $this->_validators[self::VALIDATOR_TEAR_PRICE] = $tierPriceValidator; + $this->_validators[self::VALIDATOR_TIER_PRICE] = $tierPriceValidator; $this->errorAggregator = $errorAggregator; foreach (array_merge($this->errorMessageTemplates, $this->_messageTemplates) as $errorCode => $message) { @@ -536,7 +542,7 @@ protected function getWebSiteId($websiteCode) */ protected function getCustomerGroupId($customerGroup) { - $customerGroups = $this->_getValidator(self::VALIDATOR_TEAR_PRICE)->getCustomerGroups(); + $customerGroups = $this->_getValidator(self::VALIDATOR_TIER_PRICE)->getCustomerGroups(); return $customerGroup == self::VALUE_ALL_GROUPS ? 0 : $customerGroups[$customerGroup]; } diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php index 2aa59c1cfb758..9fac1c968dfc9 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php @@ -54,7 +54,7 @@ class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\A protected $websiteValidator; /** - * @var AdvancedPricing\Validator\TearPrice |\PHPUnit_Framework_MockObject_MockObject + * @var AdvancedPricing\Validator\TierPrice |\PHPUnit_Framework_MockObject_MockObject */ protected $tierPriceValidator; diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index dc73baef3f768..a3ad638d2dd0d 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -204,7 +204,7 @@ public function getChildFinalPrice($product, $productQty, $childProduct, $childP } /** - * Gets the 'tear_price' array from the product + * Gets the 'tier_price' array from the product * * @param Product $product * @param string $key diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/GroupPrice/AbstractTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/GroupPrice/AbstractTest.php index 3003c2f8085e4..b2e1401479301 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/GroupPrice/AbstractTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/GroupPrice/AbstractTest.php @@ -65,11 +65,11 @@ public function testGetAffectedFields() $attribute->expects($this->any())->method('getAttributeId')->will($this->returnValue($attributeId)); $attribute->expects($this->any())->method('isStatic')->will($this->returnValue(false)); $attribute->expects($this->any())->method('getBackendTable')->will($this->returnValue('table')); - $attribute->expects($this->any())->method('getName')->will($this->returnValue('tear_price')); + $attribute->expects($this->any())->method('getName')->will($this->returnValue('tier_price')); $this->_model->setAttribute($attribute); $object = new \Magento\Framework\DataObject(); - $object->setTearPrice([['price_id' => 10]]); + $object->setTierPrice([['price_id' => 10]]); $object->setId(555); $this->assertEquals( diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php index b823549391257..279c3c3ac8587 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php @@ -39,7 +39,7 @@ class BasePriceTest extends \PHPUnit\Framework\TestCase /** * @var \Magento\Catalog\Pricing\Price\TierPrice|\PHPUnit_Framework_MockObject_MockObject */ - protected $tearPriceMock; + protected $tierPriceMock; /** * @var \Magento\Catalog\Pricing\Price\SpecialPrice|\PHPUnit_Framework_MockObject_MockObject @@ -60,7 +60,7 @@ protected function setUp() $this->saleableItemMock = $this->createMock(\Magento\Catalog\Model\Product::class); $this->priceInfoMock = $this->createMock(\Magento\Framework\Pricing\PriceInfo\Base::class); $this->regularPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\RegularPrice::class); - $this->tearPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\TierPrice::class); + $this->tierPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\TierPrice::class); $this->specialPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\SpecialPrice::class); $this->calculatorMock = $this->createMock(\Magento\Framework\Pricing\Adjustment\Calculator::class); @@ -69,7 +69,7 @@ protected function setUp() ->will($this->returnValue($this->priceInfoMock)); $this->prices = [ 'regular_price' => $this->regularPriceMock, - 'tear_price' => $this->tearPriceMock, + 'tier_price' => $this->tierPriceMock, 'special_price' => $this->specialPriceMock, ]; @@ -97,7 +97,7 @@ public function testGetValue($specialPriceValue, $expectedResult) $this->regularPriceMock->expects($this->exactly(3)) ->method('getValue') ->will($this->returnValue(100)); - $this->tearPriceMock->expects($this->exactly(2)) + $this->tierPriceMock->expects($this->exactly(2)) ->method('getValue') ->will($this->returnValue(99)); $this->specialPriceMock->expects($this->any()) diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php index 920dcb8e1ede5..78668366bccdc 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php @@ -252,7 +252,7 @@ public function testUpdateCatalogRuleGroupWebsiteData() ); $resourceMock->expects($this->any()) ->method('getMainTable') - ->will($this->returnValue('catalog_product_entity_tear_price')); + ->will($this->returnValue('catalog_product_entity_tier_price')); $backendModelMock->expects($this->any()) ->method('getResource') ->will($this->returnValue($resourceMock)); diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductTierPriceManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductTierPriceManagementTest.php index d5c035733942e..8531bb8a24159 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductTierPriceManagementTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductTierPriceManagementTest.php @@ -9,6 +9,11 @@ use Magento\TestFramework\TestCase\WebapiAbstract; +/** + * Class ProductTierPriceManagementTest + * + * @package Magento\Catalog\Api + */ class ProductTierPriceManagementTest extends WebapiAbstract { const SERVICE_NAME = 'catalogProductTierPriceManagementV1'; @@ -34,15 +39,15 @@ public function testGetList($customerGroupId, $count, $value, $qty) ], ]; - $tearPriceList = $this->_webApiCall( + $tierPriceList = $this->_webApiCall( $serviceInfo, ['sku' => $productSku, 'customerGroupId' => $customerGroupId] ); - $this->assertCount($count, $tearPriceList); + $this->assertCount($count, $tierPriceList); if ($count) { - $this->assertEquals($value, $tearPriceList[0]['value']); - $this->assertEquals($qty, $tearPriceList[0]['qty']); + $this->assertEquals($value, $tierPriceList[0]['value']); + $this->assertEquals($qty, $tierPriceList[0]['qty']); } } diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php index 8b9fb9f0969ae..b5d9cb89356f6 100644 --- a/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php +++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/Pricing/Price/FinalPriceTest.php @@ -9,6 +9,11 @@ use Magento\Catalog\Api\Data\ProductTierPriceInterface; use Magento\TestFramework\Helper\Bootstrap; +/** + * Class FinalPriceTest + * + * @package Magento\GroupedProduct\Pricing\Price + */ class FinalPriceTest extends \PHPUnit\Framework\TestCase { /** @@ -29,7 +34,7 @@ public function testFinalPrice() * @magentoDataFixture Magento/GroupedProduct/_files/product_grouped.php * @magentoAppIsolation enabled */ - public function testFinalPriceWithTearPrice() + public function testFinalPriceWithTierPrice() { $productRepository = Bootstrap::getObjectManager() ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); @@ -41,9 +46,11 @@ public function testFinalPriceWithTearPrice() /** @var $simpleProduct \Magento\Catalog\Api\Data\ProductInterface */ $simpleProduct = $productRepository->get('simple'); - $simpleProduct->setTierPrices([ - $tierPrice - ]); + $simpleProduct->setTierPrices( + [ + $tierPrice + ] + ); $productRepository->save($simpleProduct); /** @var $product \Magento\Catalog\Model\Product */