コード例 #1
0
ファイル: SimpleTest.php プロジェクト: Doability/magento2dev
 protected function setUp()
 {
     $this->directoryMock = $this->getMockBuilder(\Magento\Framework\Filesystem\Directory\Read::class)->disableOriginalConstructor()->getMock();
     $this->ruleMock = $this->getMockBuilder(\Magento\Framework\View\Design\Fallback\Rule\RuleInterface::class)->getMockForAbstractClass();
     $this->rulePoolMock = $this->getMockBuilder(\Magento\Framework\View\Design\Fallback\RulePool::class)->disableOriginalConstructor()->getMock();
     $this->readFactoryMock = $this->getMockBuilder(\Magento\Framework\Filesystem\Directory\ReadFactory::class)->disableOriginalConstructor()->getMock();
     $this->directoryListMock = $this->getMockBuilder(DirectoryList::class)->disableOriginalConstructor()->getMock();
     $this->rulePoolMock->expects($this->any())->method('getRule')->with('type')->willReturn($this->ruleMock);
     $this->object = (new ObjectManager($this))->getObject(Simple::class, ['readFactory' => $this->readFactoryMock, 'rulePool' => $this->rulePoolMock]);
     (new ObjectManager($this))->setBackwardCompatibleProperty($this->object, 'directoryList', $this->directoryListMock);
 }