Skip to content

Commit

Permalink
magento#27638 Fix fatal errors in Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lbajsarowicz committed Apr 10, 2020
1 parent a73532a commit f34f8c3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions app/code/Magento/Catalog/Test/Unit/Model/Product/CopierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Magento\Catalog\Test\Unit\Model\Product;

use Magento\Catalog\Api\Data\ProductExtension;
use Magento\Catalog\Api\Data\ProductExtensionInterface;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Model\Attribute\ScopeOverriddenValue;
use Magento\Catalog\Model\Product;
Expand Down Expand Up @@ -106,9 +106,9 @@ protected function setUp()
public function testCopy(): void
{
$stockItem = $this->createMock(StockItemInterface::class);
$extensionAttributes = $this->getMockBuilder(ProductExtension::class)
$extensionAttributes = $this->getMockBuilder(ProductExtensionInterface::class)
->setMethods(['getStockItem', 'setData'])
->getMock();
->getMockForAbstractClass();
$extensionAttributes
->expects($this->once())
->method('getStockItem')
Expand Down Expand Up @@ -262,9 +262,9 @@ public function testUrlAlreadyExistsExceptionWhileCopyStoresUrl(): void
{
$stockItem = $this->getMockBuilder(StockItemInterface::class)
->getMock();
$extensionAttributes = $this->getMockBuilder(ProductExtension::class)
$extensionAttributes = $this->getMockBuilder(ProductExtensionInterface::class)
->setMethods(['getStockItem', 'setData'])
->getMock();
->getMockForAbstractClass();
$extensionAttributes
->expects($this->once())
->method('getStockItem')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Magento\Catalog\Test\Unit\Model\Product\Website;

use Magento\Catalog\Api\Data\ProductExtension;
use Magento\Catalog\Api\Data\ProductExtensionInterface;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Website\ReadHandler;
use Magento\Catalog\Model\ResourceModel\Product as ResourceModel;
Expand All @@ -27,10 +27,10 @@ public function setUp()
$this->websiteLink = $this->getMockBuilder(ResourceModel\Website\Link::class)
->disableOriginalConstructor()
->getMock();
$this->extensionAttributes = $this->getMockBuilder(ProductExtension::class)
$this->extensionAttributes = $this->getMockBuilder(ProductExtensionInterface::class)
->setMethods(['setWebsiteIds', 'getWebsiteIds'])
->disableArgumentCloning()
->getMock();
->getMockForAbstractClass();
$this->readHandler = new ReadHandler($this->websiteLink);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Magento\Catalog\Test\Unit\Model\Product\Website;

use Magento\Catalog\Api\Data\ProductExtension;
use Magento\Catalog\Api\Data\ProductExtensionInterface;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Model\ResourceModel\Product\Website\Link;
use Magento\Catalog\Model\Product\Website\SaveHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class ProductRepositoryTest extends TestCase
/**
* @var ProductExtensionInterface|MockObject
*/
private $productExtension;
private $ProductExtensionInterface;

/**
* @var Json|MockObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function testAddChild()
->disableOriginalConstructor()
->setMethods(['getId', 'getData'])
->getMock();
$extensionAttributesMock = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductExtension::class)
$extensionAttributesMock = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductExtensionInterface::class)
->disableOriginalConstructor()
->setMethods(
[
Expand All @@ -158,7 +158,7 @@ public function testAddChild()
'setConfigurableProductLinks'
]
)
->getMock();
->getMockForAbstractClass();
$optionMock = $this->getMockBuilder(\Magento\ConfigurableProduct\Api\Data\Option::class)
->disableOriginalConstructor()
->setMethods(['getProductAttribute', 'getPosition', 'getAttributeId'])
Expand Down

0 comments on commit f34f8c3

Please sign in to comment.