Skip to content

Commit c2d9ba6

Browse files
author
Oleksii Korshenko
committed
MAGETWO-55480: Queue Publisher Config Component
1 parent 6bba213 commit c2d9ba6

File tree

3 files changed

+56
-36
lines changed

3 files changed

+56
-36
lines changed

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

+28-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,34 @@
1818
$logWriter->setFormatter(new \Zend_Log_Formatter_Simple('%message%' . PHP_EOL));
1919
$logger = new \Zend_Log($logWriter);
2020

21-
require_once __DIR__ . '/../../integration/framework/deployFixture.php';
21+
/** Copy test modules to app/code/Magento to make them visible for Magento instance */
22+
$pathToCommittedTestModules = __DIR__ . '/../_files/Magento';
23+
$pathToInstalledMagentoInstanceModules = __DIR__ . '/../../../../app/code/Magento';
24+
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pathToCommittedTestModules));
25+
/** @var SplFileInfo $file */
26+
foreach ($iterator as $file) {
27+
if (!$file->isDir()) {
28+
$source = $file->getPathname();
29+
$relativePath = substr($source, strlen($pathToCommittedTestModules));
30+
$destination = $pathToInstalledMagentoInstanceModules . $relativePath;
31+
$targetDir = dirname($destination);
32+
if (!is_dir($targetDir)) {
33+
mkdir($targetDir, 0755, true);
34+
}
35+
copy($source, $destination);
36+
}
37+
}
38+
unset($iterator, $file);
39+
40+
// Register the modules under '_files/'
41+
$pathPattern = $pathToInstalledMagentoInstanceModules . '/TestModule*/registration.php';
42+
$files = glob($pathPattern, GLOB_NOSORT);
43+
if ($files === false) {
44+
throw new \RuntimeException('glob() returned error while searching in \'' . $pathPattern . '\'');
45+
}
46+
foreach ($files as $file) {
47+
include $file;
48+
}
2249

2350
/* Bootstrap the application */
2451
$settings = new \Magento\TestFramework\Bootstrap\Settings($testsBaseDir, get_defined_constants());

dev/tests/integration/framework/bootstrap.php

+28-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,34 @@
1515
define('TESTS_TEMP_DIR', $testsBaseDir . '/tmp');
1616
}
1717

18-
require_once __DIR__ . '/deployFixture.php';
18+
/** Copy test modules to app/code/Magento to make them visible for Magento instance */
19+
$pathToCommittedTestModules = __DIR__ . '/../_files/Magento';
20+
$pathToInstalledMagentoInstanceModules = __DIR__ . '/../../../../app/code/Magento';
21+
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pathToCommittedTestModules));
22+
/** @var SplFileInfo $file */
23+
foreach ($iterator as $file) {
24+
if (!$file->isDir()) {
25+
$source = $file->getPathname();
26+
$relativePath = substr($source, strlen($pathToCommittedTestModules));
27+
$destination = $pathToInstalledMagentoInstanceModules . $relativePath;
28+
$targetDir = dirname($destination);
29+
if (!is_dir($targetDir)) {
30+
mkdir($targetDir, 0755, true);
31+
}
32+
copy($source, $destination);
33+
}
34+
}
35+
unset($iterator, $file);
36+
37+
// Register the modules under '_files/'
38+
$pathPattern = $pathToInstalledMagentoInstanceModules . '/TestModule*/registration.php';
39+
$files = glob($pathPattern, GLOB_NOSORT);
40+
if ($files === false) {
41+
throw new \RuntimeException('glob() returned error while searching in \'' . $pathPattern . '\'');
42+
}
43+
foreach ($files as $file) {
44+
include $file;
45+
}
1946

2047
try {
2148
/* Bootstrap the application */

dev/tests/integration/framework/deployFixture.php

-34
This file was deleted.

0 commit comments

Comments
 (0)