2 namespace TYPO3\CMS\Install\Tests\Unit\Service;
17 use org\bovigo\vfs\vfsStream;
32 'first-install-file-present' => array(
34 'FIRST_INSTALL2Folder' => array(),
35 'FIRST_INSTALL' =>
'',
36 'FIRST_INStall' =>
'',
37 'FIRST_INSTALL.txt' =>
'with content',
38 'somethingelse' =>
'',
39 'dadadaFIRST_INStall' =>
'',
47 'no-first-install-file' => array(
49 'FIRST_INSTALL2Folder' => array(),
52 'ddd.txt' =>
'with content',
53 'somethingelse' =>
'',
54 'dadadaFIRST_INStall' =>
'',
65 public function getFirstInstallFilePaths($structure, $expected)
67 $vfs = vfsStream::setup(
"root");
68 vfsStream::create($structure, $vfs);
70 $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\EnableFileService::class, array(
'dummy'), array(),
'',
false);
71 $instance->_setStatic(
'sitePath',
'vfs://root/');
72 $this->assertEquals(array(), array_diff($expected, $instance->_call(
'getFirstInstallFilePaths')));
83 'first-install-file-present' => array(
85 'FIRST_INSTALL2Folder' => array(),
86 'FIRST_INSTALL' =>
'',
87 'FIRST_INStall' =>
'',
88 'FIRST_INSTALL.txt' =>
'with content',
89 'somethingelse' =>
'',
90 'dadadaFIRST_INStall' =>
'',
95 'FIRST_INSTALL2Folder',
97 'dadadaFIRST_INStall',
100 'no-first-install-file' => array(
102 'FIRST_INSTALL2Folder' => array(),
105 'ddd.txt' =>
'with content',
106 'somethingelse' =>
'',
107 'dadadaFIRST_INStall' =>
'',
112 'FIRST_INSTALL2Folder',
117 'dadadaFIRST_INStall',
127 public function removeFirstInstallFile($structure, $expected)
129 $vfs = vfsStream::setup(
"root");
130 vfsStream::create($structure, $vfs);
132 $instance = $this->getAccessibleMock(\TYPO3\CMS\Install\Service\EnableFileService::class, array(
'dummy'), array(),
'',
false);
133 $instance->_setStatic(
'sitePath',
'vfs://root/');
134 $instance->_call(
'removeFirstInstallFile');
136 $this->assertEquals(array(), array_diff($expected, scandir(
'vfs://root/')));