示例#1
0
 protected function setUp()
 {
     $this->link = $this->getMock('Magento\\Catalog\\Model\\ResourceModel\\Product\\Link', [], [], '', false);
     $this->connection = $this->getMock('Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql', [], [], '', false);
     $this->resource = $this->getMock('Magento\\Framework\\App\\ResourceConnection', [], [], '', false);
     $this->resource->expects($this->once())->method('getConnection')->will($this->returnValue($this->connection));
     $this->import = $this->getMock('Magento\\ImportExport\\Model\\Import', [], [], '', false);
     $this->importFactory = $this->getMock('Magento\\ImportExport\\Model\\ImportFactory', ['create'], [], '', false);
     $this->importFactory->expects($this->any())->method('create')->will($this->returnValue($this->import));
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->links = $this->objectManagerHelper->getObject('Magento\\GroupedImportExport\\Model\\Import\\Product\\Type\\Grouped\\Links', ['productLink' => $this->link, 'resource' => $this->resource, 'importFactory' => $this->importFactory]);
 }