Skip to content

Commit 8f05779

Browse files
committed
MAGETWO-34569: Remove Usages of 'sql' and 'data' Folders
- removing reference to sql & data folders
1 parent 85a5c33 commit 8f05779

File tree

7 files changed

+11
-26
lines changed

7 files changed

+11
-26
lines changed

dev/tests/api-functional/phpunit.xml.dist

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
<directory suffix=".php">../../app/code/Magento</directory>
2727
<exclude>
2828
<!-- Excluding installation and upgrade scripts -->
29-
<directory>../../app/code/Magento/*/sql</directory>
30-
<!-- Excluding data installation and upgrade scripts -->
31-
<directory>../../app/code/Magento/*/data</directory>
29+
<directory>../../app/code/Magento/*/Setup</directory>
3230
</exclude>
3331
</whitelist>
3432
</filter>

dev/tests/integration/phpunit.xml.dist

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
<directory suffix=".php">../../../app/code/Magento</directory>
2929
<directory suffix=".php">../../../lib/internal/Magento</directory>
3030
<exclude>
31-
<directory suffix=".php">../../../app/code/Magento/*/sql</directory>
32-
<directory suffix=".php">../../../app/code/Magento/*/data</directory>
31+
<directory suffix=".php">../../../app/code/Magento/*/Setup</directory>
3332
</exclude>
3433
</whitelist>
3534
</filter>

dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/DbRuleTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ public function getDependencyInfoDataProvider()
3535
['any', 'non-resource-file-path.php', 'any', []],
3636
[
3737
'any',
38-
'/app/some/path/sql/some-file.php',
39-
'$install->getTableName("unknown_table")',
40-
[['module' => 'Unknown', 'source' => 'unknown_table']]
41-
],
42-
[
43-
'any',
44-
'/app/some/path/data/some-file.php',
38+
'/app/some/path/Setup/some-file.php',
4539
'$install->getTableName("unknown_table")',
4640
[['module' => 'Unknown', 'source' => 'unknown_table']]
4741
],

dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,15 @@ protected function _phpClassesDataProvider()
208208
$replacements = ['', '', ''];
209209

210210
/** Convert file names into class name format */
211-
$blackList = file(__DIR__ . '/_files/blacklist.txt', FILE_IGNORE_NEW_LINES);
212211
$classes = [];
213212
foreach ($files as $file) {
214213
$file = str_replace($basePath . '/', '', $file);
215-
if (!in_array($file, $blackList)) {
216-
$file = str_replace('/', '\\', $file);
217-
$filePath = preg_replace($patterns, $replacements, $file);
218-
$className = substr($filePath, 0, -4);
219-
$phpClassFile = !preg_match('/\\\\[A-Za-z0-9_]*\\\\[A-Za-z0-9_]*\\\\(data|sql)\\\\.*/', $className);
220-
if ($phpClassFile && class_exists($className)) {
221-
$file = str_replace('\\', DIRECTORY_SEPARATOR, $file);
222-
$classes[$file] = $className;
223-
}
214+
$file = str_replace('/', '\\', $file);
215+
$filePath = preg_replace($patterns, $replacements, $file);
216+
$className = substr($filePath, 0, -4);
217+
if (class_exists($className)) {
218+
$file = str_replace('\\', DIRECTORY_SEPARATOR, $file);
219+
$classes[$file] = $className;
224220
}
225221
}
226222

dev/tests/static/testsuite/Magento/Test/Integrity/Di/_files/blacklist.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/tests/unit/phpunit.xml.dist

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
<directory suffix=".php">../../../lib/internal/Magento</directory>
2323
<directory suffix=".php">../../../setup/src/Magento</directory>
2424
<exclude>
25-
<directory suffix=".php">../../../app/code/Magento/*/sql</directory>
26-
<directory suffix=".php">../../../app/code/Magento/*/data</directory>
25+
<directory suffix=".php">../../../app/code/Magento/*/Setup</directory>
2726
</exclude>
2827
</whitelist>
2928
</filter>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getDir($moduleName, $type = '')
4747
{
4848
$path = $this->_string->upperCaseWords($moduleName, '_', '/');
4949
if ($type) {
50-
if (!in_array($type, ['etc', 'sql', 'data', 'i18n', 'view', 'Controller'])) {
50+
if (!in_array($type, ['etc', 'Setup', 'i18n', 'view', 'Controller'])) {
5151
throw new \InvalidArgumentException("Directory type '{$type}' is not recognized.");
5252
}
5353
$path .= '/' . $type;

0 commit comments

Comments
 (0)