46 $this->extensionKey =
'dummy';
47 $this->extensionData = array(
48 'key' => $this->extensionKey
51 'TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility',
56 'processDatabaseUpdates',
57 'processRuntimeDatabaseUpdates',
59 'processCachingFrameworkUpdates',
60 'saveDefaultConfiguration',
61 'enrichExtensionWithDetails',
62 'ensureConfiguredDirectoriesExist',
69 $dependencyUtility = $this->getMock(
'TYPO3\\CMS\\Extensionmanager\\Utility\\DependencyUtility');
70 $this->installMock->_set(
'dependencyUtility', $dependencyUtility);
71 $this->installMock->expects($this->any())
72 ->method(
'enrichExtensionWithDetails')
73 ->with($this->extensionKey)
74 ->will($this->returnCallback(array($this,
'getExtensionData')));
88 foreach ($this->fakedExtensions as $extension => $dummy) {
101 $extKey = strtolower($this->
getUniqueId(
'testing'));
102 $absExtPath = PATH_site .
'typo3temp/' . $extKey;
103 $relPath =
'typo3temp/' . $extKey .
'/';
105 $this->fakedExtensions[$extKey] = array(
106 'siteRelPath' => $relPath
115 $this->installMock->expects($this->once())
116 ->method(
'processRuntimeDatabaseUpdates')
117 ->with($this->extensionKey);
119 $cacheManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\CacheManager');
120 $cacheManagerMock->expects($this->once())->method(
'flushCachesInGroup');
121 $this->installMock->_set(
'cacheManager', $cacheManagerMock);
122 $this->installMock->install($this->extensionKey);
129 $cacheManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\CacheManager');
130 $cacheManagerMock->expects($this->once())->method(
'flushCachesInGroup');
131 $this->installMock->_set(
'cacheManager', $cacheManagerMock);
132 $this->installMock->expects($this->once())->method(
'loadExtension');
133 $this->installMock->install($this->extensionKey);
140 $this->extensionData[
'clearcacheonload'] = TRUE;
141 $cacheManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\CacheManager');
142 $cacheManagerMock->expects($this->once())->method(
'flushCaches');
143 $this->installMock->_set(
'cacheManager', $cacheManagerMock);
144 $this->installMock->install($this->extensionKey);
151 $this->extensionData[
'clearCacheOnLoad'] = TRUE;
152 $cacheManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\CacheManager');
153 $cacheManagerMock->expects($this->once())->method(
'flushCaches');
154 $this->installMock->_set(
'cacheManager', $cacheManagerMock);
155 $this->installMock->install($this->extensionKey);
162 $cacheManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\CacheManager');
163 $cacheManagerMock->expects($this->once())->method(
'flushCachesInGroup');
164 $this->installMock->_set(
'cacheManager', $cacheManagerMock);
165 $this->installMock->expects($this->once())->method(
'ensureConfiguredDirectoriesExist');
166 $this->installMock->install($this->extensionKey);
173 $cacheManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\CacheManager');
174 $cacheManagerMock->expects($this->once())->method(
'flushCachesInGroup');
175 $this->installMock->_set(
'cacheManager', $cacheManagerMock);
176 $this->installMock->expects($this->once())->method(
'reloadCaches');
177 $this->installMock->install(
'dummy');
184 $cacheManagerMock = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\CacheManager');
185 $cacheManagerMock->expects($this->once())->method(
'flushCachesInGroup');
186 $this->installMock->_set(
'cacheManager', $cacheManagerMock);
187 $this->installMock->expects($this->once())->method(
'saveDefaultConfiguration')->with(
'dummy');
188 $this->installMock->install(
'dummy');
195 $this->installMock->expects($this->once())->method(
'unloadExtension');
196 $this->installMock->uninstall($this->extensionKey);
204 $extPath = PATH_site .
'typo3temp/' . $extKey .
'/';
205 $extTablesFile = $extPath .
'ext_tables.sql';
206 $fileContent =
'DUMMY TEXT TO COMPARE';
207 file_put_contents($extTablesFile, $fileContent);
209 'TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility',
210 array(
'updateDbWithExtTablesSql',
'importStaticSqlFile',
'importT3DFile'),
215 $dependencyUtility = $this->getMock(
'TYPO3\\CMS\\Extensionmanager\\Utility\\DependencyUtility');
216 $installMock->_set(
'dependencyUtility', $dependencyUtility);
218 $installMock->expects($this->once())->method(
'updateDbWithExtTablesSql')->with($this->stringStartsWith($fileContent));
219 $installMock->processDatabaseUpdates($this->fakedExtensions[$extKey]);
227 $extRelPath =
'typo3temp/' . $extKey .
'/';
229 'TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility',
230 array(
'importStaticSqlFile',
'updateDbWithExtTablesSql',
'importT3DFile'),
235 $dependencyUtility = $this->getMock(
'TYPO3\\CMS\\Extensionmanager\\Utility\\DependencyUtility');
236 $installMock->_set(
'dependencyUtility', $dependencyUtility);
237 $installMock->expects($this->once())->method(
'importStaticSqlFile')->with($extRelPath);
238 $installMock->processDatabaseUpdates($this->fakedExtensions[$extKey]);
262 $absPath = PATH_site . $this->fakedExtensions[$extKey][
'siteRelPath'];
264 file_put_contents($absPath .
'/Initialisation/' . $fileName,
'DUMMY');
266 'TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility',
267 array(
'updateDbWithExtTablesSql',
'importStaticSqlFile',
'importT3DFile'),
272 $dependencyUtility = $this->getMock(
'TYPO3\\CMS\\Extensionmanager\\Utility\\DependencyUtility');
273 $installMock->_set(
'dependencyUtility', $dependencyUtility);
274 $installMock->expects($this->once())->method(
'importT3DFile')->with($this->fakedExtensions[$extKey][
'siteRelPath']);
275 $installMock->processDatabaseUpdates($this->fakedExtensions[$extKey]);
283 'Import T3D file when T3D was imported before extension to XML' => array(
288 'Import T3D file when a file was imported after extension to XML' => array(
293 'Import XML file when T3D was imported before extension to XML' => array(
298 'Import XML file when a file was imported after extension to XML' => array(
316 $absPath = PATH_site . $this->fakedExtensions[$extKey][
'siteRelPath'];
318 file_put_contents($absPath .
'Initialisation/' . $fileName,
'DUMMY');
319 $registryMock = $this->getMock(
'\\TYPO3\\CMS\\Core\\Registry', array(
'get',
'set'));
321 ->expects($this->any())
323 ->will($this->returnValueMap(
325 array(
'extensionDataImport', $this->fakedExtensions[$extKey][
'siteRelPath'] .
'Initialisation/' . $registryNameReturnsFalse, NULL, FALSE),
326 array(
'extensionDataImport', $this->fakedExtensions[$extKey][
'siteRelPath'] .
'Initialisation/' . $registryNameReturnsTrue, NULL, TRUE),
330 'TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility',
331 array(
'getRegistry',
'getImportExportUtility'),
336 $dependencyUtility = $this->getMock(
'TYPO3\\CMS\\Extensionmanager\\Utility\\DependencyUtility');
337 $installMock->_set(
'dependencyUtility', $dependencyUtility);
339 $installMock->expects($this->never())->method(
'getImportExportUtility');
340 $installMock->_call(
'importT3DFile', $this->fakedExtensions[$extKey][
'siteRelPath']);
installCallsFlushCachesIfClearCacheOnLoadIsSet()
installCallsFlushCachesIfClearCacheOnLoadCamelCasedIsSet()
installCallsSaveDefaultConfigurationWithExtensionKey()
installationOfAnExtensionWillCallEnsureThatDirectoriesExist()
processDatabaseUpdatesCallsImportStaticSqlFile()
static rmdir($path, $removeNonEmpty=FALSE)
installCallsProcessRuntimeDatabaseUpdates()
uninstallCallsUnloadExtension()
importT3DFileDoesNotImportFileIfAlreadyImported($fileName, $registryNameReturnsFalse, $registryNameReturnsTrue)
processDatabaseUpdatesCallsImportFileDataProvider()
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
installCallsReloadCaches()
importT3DFileDoesNotImportFileIfAlreadyImportedDataProvider()
processDatabaseUpdatesCallsImportFile($fileName)
installCallsLoadExtension()
processDatabaseUpdatesCallsUpdateDbWithExtTablesSql()