|
11 | 11 | use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface;
|
12 | 12 | use Magento\ConfigurableProduct\Model\Product\Type\Collection\SalableProcessor;
|
13 | 13 | use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
|
| 14 | +use Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute; |
14 | 15 | use Magento\ConfigurableProduct\Model\Product\Type\Configurable\AttributeFactory;
|
15 | 16 | use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection;
|
16 | 17 | use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\CollectionFactory;
|
17 | 18 | use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\Collection as ProductCollection;
|
| 19 | +use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\CollectionFactory |
| 20 | + as ProductCollectionFactory; |
18 | 21 | use Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\ConfigurableFactory;
|
19 | 22 | use Magento\Customer\Model\Session;
|
20 | 23 | use Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend;
|
|
27 | 30 | * @SuppressWarnings(PHPMD.LongVariable)
|
28 | 31 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
29 | 32 | * @SuppressWarnings(PHPMD.TooManyFields)
|
30 |
| - * @codingStandardsIgnoreFile |
31 | 33 | */
|
32 | 34 | class ConfigurableTest extends \PHPUnit\Framework\TestCase
|
33 | 35 | {
|
@@ -154,8 +156,7 @@ protected function setUp()
|
154 | 156 | ->disableOriginalConstructor()
|
155 | 157 | ->setMethods(['create'])
|
156 | 158 | ->getMock();
|
157 |
| - $this->productCollectionFactory = $this->getMockBuilder( |
158 |
| - \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\CollectionFactory::class) |
| 159 | + $this->productCollectionFactory = $this->getMockBuilder(ProductCollectionFactory::class) |
159 | 160 | ->disableOriginalConstructor()
|
160 | 161 | ->setMethods(['create'])
|
161 | 162 | ->getMock();
|
@@ -281,8 +282,7 @@ public function testSave()
|
281 | 282 | $product->expects($this->atLeastOnce())
|
282 | 283 | ->method('getData')
|
283 | 284 | ->willReturnMap($dataMap);
|
284 |
| - $attribute = $this->getMockBuilder( |
285 |
| - \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class) |
| 285 | + $attribute = $this->getMockBuilder(Attribute::class) |
286 | 286 | ->disableOriginalConstructor()
|
287 | 287 | ->setMethods(['addData', 'setStoreId', 'setProductId', 'save', '__wakeup', '__sleep'])
|
288 | 288 | ->getMock();
|
@@ -464,8 +464,7 @@ public function testGetConfigurableAttributesAsArray($productStore)
|
464 | 464 | $eavAttribute->expects($this->once())->method('getSource')->willReturn($attributeSource);
|
465 | 465 | $eavAttribute->expects($this->atLeastOnce())->method('getStoreLabel')->willReturn('Store Label');
|
466 | 466 |
|
467 |
| - $attribute = $this->getMockBuilder( |
468 |
| - \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class) |
| 467 | + $attribute = $this->getMockBuilder(Attribute::class) |
469 | 468 | ->disableOriginalConstructor()
|
470 | 469 | ->setMethods(['getProductAttribute', '__wakeup', '__sleep'])
|
471 | 470 | ->getMock();
|
@@ -524,7 +523,7 @@ public function testGetConfigurableAttributesNewProduct()
|
524 | 523 | $this->assertEquals([], $this->model->getConfigurableAttributes($product));
|
525 | 524 | }
|
526 | 525 |
|
527 |
| - public function testGetConfigurableAttributes() |
| 526 | + public function testGetConfigurableAttributes() |
528 | 527 | {
|
529 | 528 | $configurableAttributes = '_cache_instance_configurable_attributes';
|
530 | 529 |
|
@@ -591,8 +590,7 @@ public function testHasOptionsConfigurableAttribute()
|
591 | 590 | ->setMethods(['__wakeup', 'getAttributeCode', 'getOptions', 'hasData', 'getData'])
|
592 | 591 | ->disableOriginalConstructor()
|
593 | 592 | ->getMock();
|
594 |
| - $attributeMock = $this->getMockBuilder( |
595 |
| - \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class) |
| 593 | + $attributeMock = $this->getMockBuilder(Attribute::class) |
596 | 594 | ->disableOriginalConstructor()
|
597 | 595 | ->getMock();
|
598 | 596 |
|
@@ -698,7 +696,7 @@ function ($value) {
|
698 | 696 | ->disableOriginalConstructor()
|
699 | 697 | ->getMock();
|
700 | 698 | $usedAttributeMock = $this->getMockBuilder(
|
701 |
| - \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class |
| 699 | + Attribute::class |
702 | 700 | )
|
703 | 701 | ->setMethods(['getProductAttribute'])
|
704 | 702 | ->disableOriginalConstructor()
|
|
0 commit comments