Skip to content

Commit 49995d3

Browse files
author
Oleksii Korshenko
committed
MAGETWO-55501: Add support of queue testing in integration tests framework
1 parent 72ae4f8 commit 49995d3

File tree

3 files changed

+36
-56
lines changed

3 files changed

+36
-56
lines changed

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

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

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-
}
21+
require_once __DIR__ . '/../../integration/framework/deployFixture.php';
4922

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

dev/tests/integration/framework/bootstrap.php

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

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-
}
18+
require_once __DIR__ . '/deployFixture.php';
4619

4720
try {
4821
/* Bootstrap the application */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/** Copy test modules to app/code/Magento to make them visible for Magento instance */
8+
$pathToCommittedTestModules = __DIR__ . '/../_files/Magento';
9+
$pathToInstalledMagentoInstanceModules = __DIR__ . '/../../../../app/code/Magento';
10+
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pathToCommittedTestModules));
11+
/** @var SplFileInfo $file */
12+
foreach ($iterator as $file) {
13+
if (!$file->isDir()) {
14+
$source = $file->getPathname();
15+
$relativePath = substr($source, strlen($pathToCommittedTestModules));
16+
$destination = $pathToInstalledMagentoInstanceModules . $relativePath;
17+
$targetDir = dirname($destination);
18+
if (!is_dir($targetDir)) {
19+
mkdir($targetDir, 0755, true);
20+
}
21+
copy($source, $destination);
22+
}
23+
}
24+
unset($iterator, $file);
25+
26+
// Register the modules under '_files/'
27+
$pathPattern = $pathToInstalledMagentoInstanceModules . '/TestModule*/registration.php';
28+
$files = glob($pathPattern, GLOB_NOSORT);
29+
if ($files === false) {
30+
throw new \RuntimeException('glob() returned error while searching in \'' . $pathPattern . '\'');
31+
}
32+
foreach ($files as $file) {
33+
include $file;
34+
}

0 commit comments

Comments
 (0)