/** * Setup tests * @return void */ public function setup() { $this->fileListFactoryMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\FileList\\Factory')->disableOriginalConstructor()->getMock(); $this->fileListMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\FileList')->disableOriginalConstructor()->getMock(); $this->fileListFactoryMock->expects($this->any())->method('create')->will($this->returnValue($this->fileListMock)); $this->libraryFilesMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\CollectorInterface')->getMock(); $this->baseFilesMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\CollectorInterface')->getMock(); $this->overriddenBaseFilesMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\CollectorInterface')->getMock(); $this->themeMock = $this->getMockBuilder('\\Magento\\Framework\\View\\Design\\ThemeInterface')->getMock(); }
/** * Setup tests * @return void */ public function setup() { $this->fileListFactoryMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\FileList\\Factory')->disableOriginalConstructor()->getMock(); $this->fileListMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\FileList')->disableOriginalConstructor()->getMock(); $this->fileListFactoryMock->expects($this->any())->method('create')->will($this->returnValue($this->fileListMock)); $this->fileSystemMock = $this->getMockBuilder('Magento\\Framework\\App\\Filesystem')->disableOriginalConstructor()->getMock(); $this->libraryDirectoryMock = $this->getMockBuilder('Magento\\Framework\\Filesystem\\Directory\\ReadInterface')->getMock(); $this->themesDirectoryMock = $this->getMockBuilder('Magento\\Framework\\Filesystem\\Directory\\ReadInterface')->getMock(); $this->fileSystemMock->expects($this->any())->method('getDirectoryRead')->will($this->returnValueMap([[Filesystem::LIB_WEB, $this->libraryDirectoryMock], [Filesystem::THEMES_DIR, $this->themesDirectoryMock]])); $this->fileFactoryMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\Factory')->disableOriginalConstructor()->getMock(); $this->themeMock = $this->getMockBuilder('\\Magento\\Framework\\View\\Design\\ThemeInterface')->getMock(); }
/** * Setup tests * @return void */ public function setup() { $this->fileListFactoryMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\FileList\\Factory')->disableOriginalConstructor()->getMock(); $this->fileListMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\FileList')->disableOriginalConstructor()->getMock(); $this->fileListFactoryMock->expects($this->any())->method('create')->with('Magento\\Framework\\Css\\PreProcessor\\File\\FileList\\Collator')->will($this->returnValue($this->fileListMock)); $this->readFactoryMock = $this->getMockBuilder('Magento\\Framework\\Filesystem\\Directory\\ReadFactory')->disableOriginalConstructor()->getMock(); $this->componentRegistrarMock = $this->getMockBuilder('Magento\\Framework\\Component\\ComponentRegistrarInterface')->disableOriginalConstructor()->getMock(); $this->fileSystemMock = $this->getMockBuilder('Magento\\Framework\\Filesystem')->disableOriginalConstructor()->getMock(); $this->libraryDirectoryMock = $this->getMockBuilder('Magento\\Framework\\Filesystem\\Directory\\ReadInterface')->getMock(); $this->fileSystemMock->expects($this->any())->method('getDirectoryRead')->will($this->returnValueMap([[DirectoryList::LIB_WEB, Filesystem\DriverPool::FILE, $this->libraryDirectoryMock]])); $this->fileFactoryMock = $this->getMockBuilder('Magento\\Framework\\View\\File\\Factory')->disableOriginalConstructor()->getMock(); $this->themeMock = $this->getMockBuilder('\\Magento\\Framework\\View\\Design\\ThemeInterface')->getMock(); $this->library = new Library($this->fileListFactoryMock, $this->fileSystemMock, $this->fileFactoryMock, $this->readFactoryMock, $this->componentRegistrarMock); }