Skip to content

Commit e68a686

Browse files
author
Yu Tang
committed
MAGETWO-32894: Refactor Catalog and related module to use mutable data object interface
- Fix static test failures
1 parent 54dd43b commit e68a686

File tree

15 files changed

+19
-25
lines changed

15 files changed

+19
-25
lines changed

app/code/Magento/Catalog/Api/Data/EavAttributeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function getApplyTo();
151151
/**
152152
* Set apply to value for the element
153153
*
154-
* @param string[]|string
154+
* @param string[]|string $applyTo
155155
* @return $this
156156
*/
157157
public function setApplyTo($applyTo);

app/code/Magento/Catalog/Model/Category/Attribute.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ public function getIsComparable()
215215
* @param string $isComparable
216216
* @return $this
217217
*/
218-
public function setIsComparable($isComparable) {
218+
public function setIsComparable($isComparable)
219+
{
219220
return $this->setData(self::IS_COMPARABLE, $isComparable);
220221
}
221222

app/code/Magento/Catalog/Model/Product/Gallery/GalleryManagement.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ class GalleryManagement implements \Magento\Catalog\Api\ProductAttributeMediaGal
8888
* @param \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterfaceFactory $entryFactory
8989
* @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Media $mediaGallery
9090
* @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper
91+
*
92+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
9193
*/
9294
public function __construct(
9395
\Magento\Store\Model\StoreManagerInterface $storeManager,

app/code/Magento/Catalog/Model/Product/Option.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*
2727
* @author Magento Core Team <core@magentocommerce.com>
2828
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
29+
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
2930
*/
3031
class Option extends AbstractExtensibleModel implements \Magento\Catalog\Api\Data\ProductCustomOptionInterface
3132
{

app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
*
2727
* @author Magento Core Team <core@magentocommerce.com>
2828
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
29+
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
30+
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
2931
*/
3032
class Attribute extends \Magento\Eav\Model\Entity\Attribute implements
3133
\Magento\Catalog\Api\Data\ProductAttributeInterface

app/code/Magento/CatalogInventory/Model/Stock/Item.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* Catalog Inventory Stock Item Model
1919
*
2020
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
21+
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
2122
*/
2223
class Item extends AbstractExtensibleModel implements StockItemInterface
2324
{

app/code/Magento/ConfigurableProduct/Model/LinkManagement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public function getChildren($productSku)
7979
$attributes['store_id'] = $child->getStoreId();
8080
/** @var \Magento\Catalog\Api\Data\ProductInterface $productDataObject */
8181
$productDataObject = $this->productFactory->create();
82-
$this->dataObjectHelper->populateWithArray($productDataObject,
82+
$this->dataObjectHelper->populateWithArray(
83+
$productDataObject,
8384
$attributes,
8485
'\Magento\Catalog\Api\Data\ProductInterface'
8586
);

app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
1414
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
1515
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
16+
* @SuppressWarnings(PHPMD.TooManyFields)
1617
*/
1718
abstract class AbstractAttribute extends \Magento\Framework\Model\AbstractExtensibleModel implements
1819
AttributeInterface,

dev/tests/api-functional/phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<!-- WebSerivice Type. Possible values: soap, rest -->
4141
<const name="TESTS_WEB_API_ADAPTER" value="rest"/>
4242
<!-- Webserver URL -->
43-
<const name="TESTS_BASE_URL" value="http://magento.url"/>
43+
<const name="TESTS_BASE_URL" value="http://magento2.dev/magento2ce"/>
4444
<!-- Webserver API user -->
4545
<const name="TESTS_WEBSERVICE_USER" value="admin"/>
4646
<!-- Webserver API key -->

dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Indexer/Stock/Action/RowTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ public function testProductUpdate()
3636
'Magento\Catalog\Block\Product\ListProduct'
3737
);
3838

39-
/** @var \Magento\CatalogInventory\Api\Data\StockItemInterfaceFactory $stockItemFactory */
40-
$stockItemFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
41-
'Magento\CatalogInventory\Api\Data\StockItemInterfaceFactory'
42-
);
43-
4439
/** @var \Magento\Framework\Api\DataObjectHelper $dataObjectHelper */
4540
$dataObjectHelper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
4641
'\Magento\Framework\Api\DataObjectHelper'

0 commit comments

Comments
 (0)