Skip to content

Commit e8ce9a9

Browse files
author
Sergii Kovalenko
committed
MAGETWO-88054: Move declarative setup from setup to framework
1 parent 90c4c37 commit e8ce9a9

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

dev/tests/setup-integration/framework/Magento/TestFramework/Annotation/CopyModules.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,14 @@ public function endTest(\PHPUnit\Framework\TestCase $test)
6767
$annotations = $test->getAnnotations();
6868
//This annotation can be declared only on method level
6969
if (isset($annotations['method']['moduleName'])) {
70-
$path = MAGENTO_MODULES_PATH .
71-
//Take only module name from Magento_ModuleName
72-
explode("_", $annotations['method']['moduleName'][0])[1];
70+
foreach ($annotations['method']['moduleName'] as $moduleName) {
71+
$path = MAGENTO_MODULES_PATH .
72+
//Take only module name from Magento_ModuleName
73+
explode("_", $moduleName)[1];
74+
75+
File::rmdirRecursive($path);
76+
}
7377

74-
File::rmdirRecursive($path);
7578
$reflection = new \ReflectionClass(ComponentRegistrar::class);
7679
$reflectionProperty = $reflection->getProperty('paths');
7780
$reflectionProperty->setAccessible(true);

lib/internal/Magento/Framework/Module/Dir/Reader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ public function getComposerJsonFiles()
105105
*/
106106
private function getFilesIterator($filename, $subDir = '')
107107
{
108-
if (!isset($this->fileIterators[$subDir][$filename])) {
108+
#if (!isset($this->fileIterators[$subDir][$filename])) {
109109
$this->fileIterators[$subDir][$filename] = $this->fileIteratorFactory->create(
110110
$this->getFiles($filename, $subDir)
111111
);
112-
}
112+
#}
113113
return $this->fileIterators[$subDir][$filename];
114114
}
115115

lib/internal/Magento/Framework/Module/ModuleResource.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public function setDataVersion($moduleName, $version)
141141
/**
142142
* Flush all class cache
143143
*
144+
* @deprecated This method was added as temporary solution, to increase modularity:
145+
* Because before new modules appears in resource only on next bootstrap
144146
* @return void
145147
*/
146148
public static function flush()

0 commit comments

Comments
 (0)