Skip to content
Snippets Groups Projects
Commit 078ad97a authored by Igor Melnikov's avatar Igor Melnikov
Browse files

MAGETWO-62134: Create data converter that can process nested serialized data

Resolving code review feedback
parent 9a66bf9d
Branches
No related merge requests found
...@@ -14,27 +14,27 @@ class GrandTotalDetailsPlugin ...@@ -14,27 +14,27 @@ class GrandTotalDetailsPlugin
/** /**
* @var \Magento\Tax\Api\Data\GrandTotalDetailsInterfaceFactory * @var \Magento\Tax\Api\Data\GrandTotalDetailsInterfaceFactory
*/ */
protected $detailsFactory; private $detailsFactory;
/** /**
* @var \Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory * @var \Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory
*/ */
protected $ratesFactory; private $ratesFactory;
/** /**
* @var TotalSegmentExtensionFactory * @var TotalSegmentExtensionFactory
*/ */
protected $totalSegmentExtensionFactory; private $totalSegmentExtensionFactory;
/** /**
* @var \Magento\Tax\Model\Config * @var \Magento\Tax\Model\Config
*/ */
protected $taxConfig; private $taxConfig;
/** /**
* @var string * @var string
*/ */
protected $code; private $code;
/** /**
* @var Json * @var Json
...@@ -42,6 +42,8 @@ class GrandTotalDetailsPlugin ...@@ -42,6 +42,8 @@ class GrandTotalDetailsPlugin
private $serializer; private $serializer;
/** /**
* Constructor
*
* @param \Magento\Tax\Api\Data\GrandTotalDetailsInterfaceFactory $detailsFactory * @param \Magento\Tax\Api\Data\GrandTotalDetailsInterfaceFactory $detailsFactory
* @param \Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory $ratesFactory * @param \Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory $ratesFactory
* @param TotalSegmentExtensionFactory $totalSegmentExtensionFactory * @param TotalSegmentExtensionFactory $totalSegmentExtensionFactory
...@@ -53,14 +55,14 @@ class GrandTotalDetailsPlugin ...@@ -53,14 +55,14 @@ class GrandTotalDetailsPlugin
\Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory $ratesFactory, \Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory $ratesFactory,
TotalSegmentExtensionFactory $totalSegmentExtensionFactory, TotalSegmentExtensionFactory $totalSegmentExtensionFactory,
\Magento\Tax\Model\Config $taxConfig, \Magento\Tax\Model\Config $taxConfig,
Json $serializer = null Json $serializer
) { ) {
$this->detailsFactory = $detailsFactory; $this->detailsFactory = $detailsFactory;
$this->ratesFactory = $ratesFactory; $this->ratesFactory = $ratesFactory;
$this->totalSegmentExtensionFactory = $totalSegmentExtensionFactory; $this->totalSegmentExtensionFactory = $totalSegmentExtensionFactory;
$this->taxConfig = $taxConfig; $this->taxConfig = $taxConfig;
$this->serializer = $serializer;
$this->code = 'tax'; $this->code = 'tax';
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
} }
/** /**
...@@ -83,7 +85,6 @@ class GrandTotalDetailsPlugin ...@@ -83,7 +85,6 @@ class GrandTotalDetailsPlugin
* @param \Magento\Quote\Model\Cart\TotalsConverter $subject * @param \Magento\Quote\Model\Cart\TotalsConverter $subject
* @param \Magento\Quote\Api\Data\TotalSegmentInterface[] $totalSegments * @param \Magento\Quote\Api\Data\TotalSegmentInterface[] $totalSegments
* @param \Magento\Quote\Model\Quote\Address\Total[] $addressTotals * @param \Magento\Quote\Model\Quote\Address\Total[] $addressTotals
*
* @return \Magento\Quote\Api\Data\TotalSegmentInterface[] * @return \Magento\Quote\Api\Data\TotalSegmentInterface[]
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
* @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.CyclomaticComplexity)
......
...@@ -82,10 +82,9 @@ class GroupedTest extends \PHPUnit_Framework_TestCase ...@@ -82,10 +82,9 @@ class GroupedTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @magentoDataFixture Magento/GroupedProduct/_files/product_grouped.php
* @magentoAppIsolation enabled * @magentoAppIsolation enabled
* @magentoDbIsolation disabled * @magentoDbIsolation disabled
* @covers \Magento\GroupedProduct\Model\Product\Type\Grouped::_prepareProduct()
* @magentoDataFixture Magento/GroupedProduct/_files/product_grouped.php
*/ */
public function testPrepareProduct() public function testPrepareProduct()
{ {
......
...@@ -508,9 +508,9 @@ class CreateTest extends \PHPUnit_Framework_TestCase ...@@ -508,9 +508,9 @@ class CreateTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @magentoAppIsolation enabled
* @magentoDataFixture Magento/Sales/_files/quote.php * @magentoDataFixture Magento/Sales/_files/quote.php
* @magentoDataFixture Magento/Customer/_files/customer.php * @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoAppIsolation enabled
*/ */
public function testGetCustomerCartExistingCart() public function testGetCustomerCartExistingCart()
{ {
...@@ -535,10 +535,9 @@ class CreateTest extends \PHPUnit_Framework_TestCase ...@@ -535,10 +535,9 @@ class CreateTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @covers \Magento\Sales\Model\AdminOrder\Create::moveQuoteItem()
* @magentoAppIsolation enabled
* @magentoDataFixture Magento/Sales/_files/quote.php * @magentoDataFixture Magento/Sales/_files/quote.php
* @magentoDataFixture Magento/Customer/_files/customer.php * @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoAppIsolation enabled
*/ */
public function testMoveQuoteItemToCart() public function testMoveQuoteItemToCart()
{ {
......
...@@ -12,10 +12,9 @@ namespace Magento\Sales\Model\Order; ...@@ -12,10 +12,9 @@ namespace Magento\Sales\Model\Order;
class ItemTest extends \PHPUnit_Framework_TestCase class ItemTest extends \PHPUnit_Framework_TestCase
{ {
/** /**
* @covers \Magento\Sales\Model\Order\Item::getProductOptions
* @dataProvider getProductOptionsDataProvider
* @param string $options * @param string $options
* @param array $expectedData * @param array $expectedData
* @dataProvider getProductOptionsDataProvider
*/ */
public function testGetProductOptions($options, $expectedData) public function testGetProductOptions($options, $expectedData)
{ {
......
...@@ -31,11 +31,9 @@ class ItemTest extends \PHPUnit_Framework_TestCase ...@@ -31,11 +31,9 @@ class ItemTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
* @magentoAppIsolation enabled * @magentoAppIsolation enabled
* @magentoDbIsolation enabled * @magentoDbIsolation enabled
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
* @covers \Magento\Wishlist\Model\Item::getBuyRequest()
* @covers \Magento\Wishlist\Model\Item::mergeBuyRequest()
*/ */
public function testBuyRequest() public function testBuyRequest()
{ {
...@@ -64,9 +62,6 @@ class ItemTest extends \PHPUnit_Framework_TestCase ...@@ -64,9 +62,6 @@ class ItemTest extends \PHPUnit_Framework_TestCase
); );
} }
/**
* @covers \Magento\Wishlist\Model\Item::setBuyRequest()
*/
public function testSetBuyRequest() public function testSetBuyRequest()
{ {
$buyRequest = $this->objectManager->create( $buyRequest = $this->objectManager->create(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment