Skip to content
Snippets Groups Projects
Commit 6b25b91f authored by Dmytro Voskoboinikov's avatar Dmytro Voskoboinikov
Browse files

MAGETWO-47397: Fix L1

parent 228ab39d
Branches
No related merge requests found
......@@ -30,20 +30,35 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase
*/
protected $relation;
/**
* @var \Magento\Framework\Model\Entity\MetadataPool|\PHPUnit_Framework_MockObject_MockObject
*/
protected $metadataPool;
protected function setUp()
{
$connectionMock = $this->getMockBuilder('\Magento\Framework\DB\Adapter\AdapterInterface')->getMock();
$this->resource = $this->getMock('Magento\Framework\App\ResourceConnection', [], [], '', false);
$this->resource->expects($this->any())->method('getConnection')->will($this->returnValue($connectionMock));
$this->relation = $this->getMock('Magento\Catalog\Model\ResourceModel\Product\Relation', [], [], '', false);
$metadata = $this->getMock('Magento\Framework\Model\Entity\EntityMetadata', [], [], '', false);
$this->metadataPool = $this->getMock('Magento\Framework\Model\Entity\MetadataPool', [], [], '', false);
$this->metadataPool->expects($this->any())
->method('getMetadata')
->with(\Magento\Catalog\Api\Data\ProductInterface::class)
->willReturn($metadata);
$this->objectManagerHelper = new ObjectManagerHelper($this);
$this->configurable = $this->objectManagerHelper->getObject(
'Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable',
[
'resource' => $this->resource,
'catalogProductRelation' => $this->relation
'catalogProductRelation' => $this->relation,
'metadataPool' => $this->metadataPool
]
);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment