9 use \Magento\Framework\App\State\CleanupFiles;
28 $this->filesystem = $this->createMock(\
Magento\Framework\Filesystem::class);
34 $dir1 = $this->getDirectoryCleanMock();
35 $dir2 = $this->getDirectoryCleanMock();
36 $this->filesystem->expects($this->exactly(2))
37 ->method(
'getDirectoryWrite')
39 $this->returnValueMap(
46 $this->
object->clearCodeGeneratedClasses();
51 $static = $this->getDirectoryCleanMock();
53 $this->filesystem->expects($this->exactly(2))->method(
'getDirectoryWrite')->will($this->returnValueMap([
57 $this->
object->clearMaterializedViewFiles();
66 private function getDirectoryCleanMock($subPath =
null)
68 $dir = $this->getMockForAbstractClass(\
Magento\Framework\
Filesystem\Directory\WriteInterface::class);
69 $dir->expects($this->once())->method(
'search')->with(
'*', $subPath)->willReturn([
'one',
'two']);
70 $dir->expects($this->exactly(2))->method(
'delete');
71 $dir->expects($this->once())->method(
'isExist')->will($this->returnValue(
true));
const TMP_MATERIALIZATION_DIR
testClearCodeGeneratedClasses()
testClearMaterializedViewFiles()