Skip to content

Commit

Permalink
#27500 Code Review adjustments to ConfigurableProduct module
Browse files Browse the repository at this point in the history
  • Loading branch information
lbajsarowicz committed Apr 16, 2020
1 parent a7561ed commit 45c87da
Show file tree
Hide file tree
Showing 71 changed files with 222 additions and 116 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Block\Adminhtml\Product\Edit\Button;

use Magento\Catalog\Api\Data\ProductInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Block\Adminhtml\Product\Edit\Tab\Variations\Config;

use Magento\Backend\Block\Template\Context;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\ProductFactory;
use Magento\CatalogInventory\Api\Data\StockItemInterface;
use Magento\CatalogInventory\Api\StockRegistryInterface;
use Magento\Config\Block\System\Config\Form;
use Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Variations\Config\Matrix;
use Magento\Framework\Data\FormFactory;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
Expand Down Expand Up @@ -58,7 +59,6 @@ protected function setUp(): void
'stockRegistry' => $this->stockRegistryMock,
];
$helper = new ObjectManager($this);
$this->_object = $helper->getObject(Form::class, $data);
$this->_block = $helper->getObject(
Matrix::class,
$data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Block\Adminhtml\Product\Steps;

use Magento\Backend\Block\Widget\Button;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Block\Cart\Item\Renderer;

use Magento\Catalog\Helper\Image;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Block\Plugin\Product\Media;

use Magento\Catalog\Model\Product;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Block\Product\Configurable;

use Magento\ConfigurableProduct\Block\Product\Configurable\AttributeSelector;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Block\Product\View\Type;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Controller\Adminhtml\Product;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Controller\Adminhtml\Product\Attribute;

use Magento\ConfigurableProduct\Controller\Adminhtml\Product\Attribute\SuggestConfigurableAttributes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Controller\Adminhtml\Product\Builder;

use Magento\Catalog\Controller\Adminhtml\Product\Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Controller\Adminhtml\Product\Initialization\Helper\Plugin;

use Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper;
Expand All @@ -13,7 +15,7 @@
use Magento\ConfigurableProduct\Model\Product\VariationHandler;
use Magento\ConfigurableProduct\Test\Unit\Model\Product\ProductExtensionAttributes;
use Magento\Framework\App\Request\Http;
use PHPUnit\Framework\MockObject\MockObject as MockObject;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class ConfigurableTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Controller\Adminhtml\Product\Initialization\Helper\Plugin;

use Magento\Catalog\Api\ProductRepositoryInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Controller\Adminhtml\Product;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Helper;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Helper\Product\Configuration;

use Magento\Catalog\Helper\Product\Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Helper\Product\Options;

use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
Expand All @@ -14,7 +16,7 @@
use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable\AttributeFactory;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\MockObject\MockObject as MockObject;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Helper\Product\Options;

use Magento\Catalog\Model\Product;
Expand All @@ -13,7 +15,7 @@
use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute;
use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection;
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;
use PHPUnit\Framework\MockObject\MockObject as MockObject;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class LoaderTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model\Attribute;

use Magento\Catalog\Api\Data\ProductInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model;

Expand All @@ -27,7 +28,7 @@ class ConfigurableAttributeDataTest extends TestCase
protected $configurableAttributeData;

/**
* @var \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute|MockObject
* @var Attribute|MockObject
*/
protected $attributeMock;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model\Entity\Product\Attribute\Group\AttributeMapper;

use Magento\Catalog\Model\Entity\Product\Attribute\Group\AttributeMapperInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model\Order\Admin\Item\Plugin;

use Magento\Catalog\Model\Product;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model\Plugin;

Expand All @@ -12,7 +13,7 @@
use Magento\ConfigurableProduct\Model\Plugin\PriceBackend;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\MockObject\MockObject as MockObject;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class PriceBackendTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model\Plugin;

use Magento\Catalog\Api\Data\ProductAttributeInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php declare(strict_types=1);
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\ConfigurableProduct\Test\Unit\Model\Product\CartConfiguration\Plugin;

use Magento\Catalog\Model\Product;
Expand Down
Loading

0 comments on commit 45c87da

Please sign in to comment.