Skip to content

Commit 078ad97

Browse files
author
Igor Melnikov
committed
MAGETWO-62134: Create data converter that can process nested serialized data
Resolving code review feedback
1 parent 9a66bf9 commit 078ad97

File tree

5 files changed

+14
-21
lines changed

5 files changed

+14
-21
lines changed

app/code/Magento/Tax/Model/Quote/GrandTotalDetailsPlugin.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,36 @@ class GrandTotalDetailsPlugin
1414
/**
1515
* @var \Magento\Tax\Api\Data\GrandTotalDetailsInterfaceFactory
1616
*/
17-
protected $detailsFactory;
17+
private $detailsFactory;
1818

1919
/**
2020
* @var \Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory
2121
*/
22-
protected $ratesFactory;
22+
private $ratesFactory;
2323

2424
/**
2525
* @var TotalSegmentExtensionFactory
2626
*/
27-
protected $totalSegmentExtensionFactory;
27+
private $totalSegmentExtensionFactory;
2828

2929
/**
3030
* @var \Magento\Tax\Model\Config
3131
*/
32-
protected $taxConfig;
32+
private $taxConfig;
3333

3434
/**
3535
* @var string
3636
*/
37-
protected $code;
37+
private $code;
3838

3939
/**
4040
* @var Json
4141
*/
4242
private $serializer;
4343

4444
/**
45+
* Constructor
46+
*
4547
* @param \Magento\Tax\Api\Data\GrandTotalDetailsInterfaceFactory $detailsFactory
4648
* @param \Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory $ratesFactory
4749
* @param TotalSegmentExtensionFactory $totalSegmentExtensionFactory
@@ -53,14 +55,14 @@ public function __construct(
5355
\Magento\Tax\Api\Data\GrandTotalRatesInterfaceFactory $ratesFactory,
5456
TotalSegmentExtensionFactory $totalSegmentExtensionFactory,
5557
\Magento\Tax\Model\Config $taxConfig,
56-
Json $serializer = null
58+
Json $serializer
5759
) {
5860
$this->detailsFactory = $detailsFactory;
5961
$this->ratesFactory = $ratesFactory;
6062
$this->totalSegmentExtensionFactory = $totalSegmentExtensionFactory;
6163
$this->taxConfig = $taxConfig;
64+
$this->serializer = $serializer;
6265
$this->code = 'tax';
63-
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
6466
}
6567

6668
/**
@@ -83,7 +85,6 @@ protected function getRatesData($rates)
8385
* @param \Magento\Quote\Model\Cart\TotalsConverter $subject
8486
* @param \Magento\Quote\Api\Data\TotalSegmentInterface[] $totalSegments
8587
* @param \Magento\Quote\Model\Quote\Address\Total[] $addressTotals
86-
*
8788
* @return \Magento\Quote\Api\Data\TotalSegmentInterface[]
8889
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
8990
* @SuppressWarnings(PHPMD.CyclomaticComplexity)

dev/tests/integration/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,9 @@ private function assertProductInfo($product)
8282
}
8383

8484
/**
85+
* @magentoDataFixture Magento/GroupedProduct/_files/product_grouped.php
8586
* @magentoAppIsolation enabled
8687
* @magentoDbIsolation disabled
87-
* @covers \Magento\GroupedProduct\Model\Product\Type\Grouped::_prepareProduct()
88-
* @magentoDataFixture Magento/GroupedProduct/_files/product_grouped.php
8988
*/
9089
public function testPrepareProduct()
9190
{

dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,9 @@ public function testCreateOrderExistingCustomer()
508508
}
509509

510510
/**
511-
* @magentoAppIsolation enabled
512511
* @magentoDataFixture Magento/Sales/_files/quote.php
513512
* @magentoDataFixture Magento/Customer/_files/customer.php
513+
* @magentoAppIsolation enabled
514514
*/
515515
public function testGetCustomerCartExistingCart()
516516
{
@@ -535,10 +535,9 @@ public function testGetCustomerCartExistingCart()
535535
}
536536

537537
/**
538-
* @covers \Magento\Sales\Model\AdminOrder\Create::moveQuoteItem()
539-
* @magentoAppIsolation enabled
540538
* @magentoDataFixture Magento/Sales/_files/quote.php
541539
* @magentoDataFixture Magento/Customer/_files/customer.php
540+
* @magentoAppIsolation enabled
542541
*/
543542
public function testMoveQuoteItemToCart()
544543
{

dev/tests/integration/testsuite/Magento/Sales/Model/Order/ItemTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
class ItemTest extends \PHPUnit_Framework_TestCase
1313
{
1414
/**
15-
* @covers \Magento\Sales\Model\Order\Item::getProductOptions
16-
* @dataProvider getProductOptionsDataProvider
1715
* @param string $options
1816
* @param array $expectedData
17+
* @dataProvider getProductOptionsDataProvider
1918
*/
2019
public function testGetProductOptions($options, $expectedData)
2120
{

dev/tests/integration/testsuite/Magento/Wishlist/Model/ItemTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ public function setUp()
3131
}
3232

3333
/**
34+
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
3435
* @magentoAppIsolation enabled
3536
* @magentoDbIsolation enabled
36-
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
37-
* @covers \Magento\Wishlist\Model\Item::getBuyRequest()
38-
* @covers \Magento\Wishlist\Model\Item::mergeBuyRequest()
3937
*/
4038
public function testBuyRequest()
4139
{
@@ -64,9 +62,6 @@ public function testBuyRequest()
6462
);
6563
}
6664

67-
/**
68-
* @covers \Magento\Wishlist\Model\Item::setBuyRequest()
69-
*/
7065
public function testSetBuyRequest()
7166
{
7267
$buyRequest = $this->objectManager->create(

0 commit comments

Comments
 (0)