Ejemplo n.º 1
0
 public function testGetResourceStorageModel()
 {
     $dbModelMock = $this->getMockBuilder('Magento\\MediaStorage\\Model\\File\\Storage\\Database')->disableOriginalConstructor()->getMock();
     $this->dbStorageFactoryMock->expects($this->once())->method('create')->will($this->returnValue($dbModelMock));
     $resourceModelMock = $this->getMockBuilder('Magento\\Framework\\Model\\ResourceModel\\Db\\AbstractDb')->disableOriginalConstructor()->setMethods(['__wakeup'])->getMockForAbstractClass();
     $dbModelMock->expects($this->once())->method('getResource')->will($this->returnValue($resourceModelMock));
     $this->assertSame($resourceModelMock, $this->helper->getResourceStorageModel());
     $this->assertSame($resourceModelMock, $this->helper->getResourceStorageModel());
 }