Skip to content

Commit 9ebcbe3

Browse files
author
Ankur Kaneria
committed
MAGETWO-42263: Register non-composer components
- updates to make api-functional tests work from original location
1 parent 5bbd9a4 commit 9ebcbe3

File tree

10 files changed

+21
-77
lines changed

10 files changed

+21
-77
lines changed

dev/tests/api-functional/_files/Magento/TestModule1/registration.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule1', __DIR__);
8-
?>
7+
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule1', __DIR__);

dev/tests/api-functional/_files/Magento/TestModule2/registration.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule2', __DIR__);
8-
?>
7+
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule2', __DIR__);

dev/tests/api-functional/_files/Magento/TestModule3/registration.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule3', __DIR__);
8-
?>
7+
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule3', __DIR__);

dev/tests/api-functional/_files/Magento/TestModule4/registration.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule4', __DIR__);
8-
?>
7+
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule4', __DIR__);

dev/tests/api-functional/_files/Magento/TestModule5/registration.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule5', __DIR__);
8-
?>
7+
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModule5', __DIR__);

dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/registration.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleIntegrationFromConfig', __DIR__);
8-
?>
7+
Magento\Framework\Component\ComponentRegistrar::register(
8+
ComponentRegistrar::MODULE,
9+
'Magento_TestModuleIntegrationFromConfig',
10+
__DIR__
11+
);

dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/registration.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleJoinDirectives', __DIR__);
8-
?>
7+
Magento\Framework\Component\ComponentRegistrar::register(
8+
ComponentRegistrar::MODULE,
9+
'Magento_TestModuleJoinDirectives',
10+
__DIR__
11+
);

dev/tests/api-functional/_files/Magento/TestModuleMSC/registration.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleMSC', __DIR__);
8-
?>
7+
Magento\Framework\Component\ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleMSC', __DIR__);

dev/tests/api-functional/framework/autoload.php

+2-58
Original file line numberDiff line numberDiff line change
@@ -14,62 +14,6 @@
1414
$autoloadWrapper->addPsr4('Magento\\TestFramework\\', "{$integrationTestsDir}/framework/Magento/TestFramework/");
1515
$autoloadWrapper->addPsr4('Magento\\', "{$testsBaseDir}/testsuite/Magento/");
1616

17-
// registration of name spaces under '../_files'
18-
$_filesDir = realpath("{$testsBaseDir}/_files");
19-
20-
// TestModule1
21-
$autoloadWrapper->addPsr4('Magento\\TestModule1\\Controller\\CookieTester', "{$_filesDir}/TestModule1/Controller/CookieTester/");
22-
$autoloadWrapper->addPsr4('Magento\\TestModule1\\Controller', "{$_filesDir}/TestModule1/Controller/");
23-
$autoloadWrapper->addPsr4('Magento\\TestModule1\\Service\\V1', "{$_filesDir}/TestModule1/Service/V1/");
24-
$autoloadWrapper->addPsr4('Magento\\TestModule1\\Service\\V1\\Entity', "{$_filesDir}/TestModule1/Service/V1/Entity/");
25-
$autoloadWrapper->addPsr4('Magento\\TestModule1\\Service\\V2', "{$_filesDir}/TestModule1/Service/V2/");
26-
$autoloadWrapper->addPsr4('Magento\\TestModule1\\Service\\V2\\Entity', "{$_filesDir}/TestModule1/Service/V2/Entity/");
27-
28-
// TestModule2
29-
$autoloadWrapper->addPsr4('Magento\\TestModule2\\Controller\\CookieTester', "{$_filesDir}/TestModule2/Controller/CookieTester/");
30-
$autoloadWrapper->addPsr4('Magento\\TestModule2\\Controller', "{$_filesDir}/TestModule2/Controller/");
31-
$autoloadWrapper->addPsr4('Magento\\TestModule2\\Service\\V1', "{$_filesDir}/TestModule2/Service/V1/");
32-
$autoloadWrapper->addPsr4('Magento\\TestModule2\\Service\\V1\\Entity', "{$_filesDir}/TestModule2/Service/V1/Entity/");
33-
$autoloadWrapper->addPsr4('Magento\\TestModule2\\Service\\V2', "{$_filesDir}/TestModule2/Service/V2/");
34-
$autoloadWrapper->addPsr4('Magento\\TestModule2\\Service\\V2\\Entity', "{$_filesDir}/TestModule2/Service/V2/Entity/");
35-
36-
// TestModule3
37-
$autoloadWrapper->addPsr4('Magento\\TestModule3\\Controller\\CookieTester', "{$_filesDir}/TestModule3/Controller/CookieTester/");
38-
$autoloadWrapper->addPsr4('Magento\\TestModule3\\Controller', "{$_filesDir}/TestModule3/Controller/");
39-
$autoloadWrapper->addPsr4('Magento\\TestModule3\\Service\\V1', "{$_filesDir}/TestModule3/Service/V1/");
40-
$autoloadWrapper->addPsr4('Magento\\TestModule3\\Service\\V1\\Entity', "{$_filesDir}/TestModule3/Service/V1/Entity/");
41-
$autoloadWrapper->addPsr4('Magento\\TestModule3\\Service\\V2', "{$_filesDir}/TestModule3/Service/V2/");
42-
$autoloadWrapper->addPsr4('Magento\\TestModule3\\Service\\V2\\Entity', "{$_filesDir}/TestModule3/Service/V2/Entity/");
43-
44-
// TestModule4
45-
$autoloadWrapper->addPsr4('Magento\\TestModule4\\Controller\\CookieTester', "{$_filesDir}/TestModule4/Controller/CookieTester/");
46-
$autoloadWrapper->addPsr4('Magento\\TestModule4\\Controller', "{$_filesDir}/TestModule4/Controller/");
47-
$autoloadWrapper->addPsr4('Magento\\TestModule4\\Service\\V1', "{$_filesDir}/TestModule4/Service/V1/");
48-
$autoloadWrapper->addPsr4('Magento\\TestModule4\\Service\\V1\\Entity', "{$_filesDir}/TestModule4/Service/V1/Entity/");
49-
$autoloadWrapper->addPsr4('Magento\\TestModule4\\Service\\V2', "{$_filesDir}/TestModule4/Service/V2/");
50-
$autoloadWrapper->addPsr4('Magento\\TestModule4\\Service\\V2\\Entity', "{$_filesDir}/TestModule4/Service/V2/Entity/");
51-
52-
// TestModule5
53-
$autoloadWrapper->addPsr4('Magento\\TestModule5\\Controller\\CookieTester', "{$_filesDir}/TestModule5/Controller/CookieTester/");
54-
$autoloadWrapper->addPsr4('Magento\\TestModule5\\Controller', "{$_filesDir}/TestModule5/Controller/");
55-
$autoloadWrapper->addPsr4('Magento\\TestModule5\\Service\\V1', "{$_filesDir}/TestModule5/Service/V1/");
56-
$autoloadWrapper->addPsr4('Magento\\TestModule5\\Service\\V1\\Entity', "{$_filesDir}/TestModule5/Service/V1/Entity/");
57-
$autoloadWrapper->addPsr4('Magento\\TestModule5\\Service\\V2', "{$_filesDir}/TestModule5/Service/V2/");
58-
$autoloadWrapper->addPsr4('Magento\\TestModule5\\Service\\V2\\Entity', "{$_filesDir}/TestModule5/Service/V2/Entity/");
59-
60-
// TestModuleIntegrationFromConfig
61-
$autoloadWrapper->addPsr4('Magento\TestModuleIntegrationFromConfig\Setup', "{$_filesDir}/TestModuleIntegrationFromConfig/Setup/");
62-
63-
// TestModuleJoinDirectives
64-
$autoloadWrapper->addPsr4('Magento\\TestModuleJoinDirectives\\Api', "{$_filesDir}/TestModuleJoinDirectives/Api/");
65-
$autoloadWrapper->addPsr4('Magento\\TestModuleJoinDirectives\\Model', "{$_filesDir}/TestModuleJoinDirectives/Model/");
66-
67-
// TestModuleMSC
68-
$autoloadWrapper->addPsr4('Magento\\TestModuleMSC\\Api', "{$_filesDir}/TestModuleMSC/Api/");
69-
$autoloadWrapper->addPsr4('Magento\\TestModuleMSC\\Api\\Data', "{$_filesDir}/TestModuleMSC/Api/Data/");
70-
$autoloadWrapper->addPsr4('Magento\\TestModuleMSC\\Model', "{$_filesDir}/TestModuleMSC/Model/");
71-
$autoloadWrapper->addPsr4('Magento\\TestModuleMSC\\Model\\Data', "{$_filesDir}/TestModuleMSC/Model/Data/");
72-
$autoloadWrapper->addPsr4('Magento\\TestModuleMSC\\Model\\Resource', "{$_filesDir}/TestModuleMSC/Model/Resource");
73-
74-
17+
// registration of classes under '../_files'
18+
$autoloadWrapper->addPsr4('Magento\\', "{$testsBaseDir}/_files/");
7519

dev/tests/api-functional/framework/bootstrap.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
$logger = new \Zend_Log($logWriter);
2121

2222
// Register the modules under '_files/'
23-
$path = dirname(__DIR__) . '/_files/*/*/registration.php';
24-
$files = glob($path, GLOB_NOSORT);
23+
$pathPattern = dirname(__DIR__) . '/_files/*/*/registration.php';
24+
$files = glob($pathPattern, GLOB_NOSORT);
2525
if ( $files === false ) {
26-
throw new \RuntimeException('glob() returned error while searching in \'' . $path . '\'');
26+
throw new \RuntimeException('glob() returned error while searching in \'' . $pathPattern . '\'');
2727
}
2828
foreach ($files as $file) {
2929
include $file;

0 commit comments

Comments
 (0)