Beispiel #1
0
 protected function setUp()
 {
     $this->_uploader = $this->getMock('Magento\\Core\\Model\\File\\Uploader', [], [], '', false);
     $this->_uploaderFactory = $this->getMock('Magento\\Core\\Model\\File\\UploaderFactory', ['create'], [], '', false);
     $this->_uploaderFactory->expects($this->any())->method('create')->will($this->returnValue($this->_uploader));
     $this->_directoryMock = $this->getMock('Magento\\Framework\\Filesystem\\Directory\\Read', [], [], '', false);
     $this->_filesystemMock = $this->getMock('Magento\\Framework\\Filesystem', [], [], '', false);
     $this->_filesystemMock->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($this->_directoryMock));
     /** @var $service \Magento\Theme\Model\Uploader\Service */
     $this->_fileSizeMock = $this->getMockBuilder('Magento\\Framework\\File\\Size')->setMethods(['getMaxFileSize'])->disableOriginalConstructor()->getMock();
     $this->_fileSizeMock->expects($this->any())->method('getMaxFileSize')->will($this->returnValue(600 * self::MB_MULTIPLIER));
 }