Skip to content

Commit 1e48bd5

Browse files
committed
MQE-904: Deliver changes from Magento Contribution Day
1 parent 97c307e commit 1e48bd5

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MAGENTO_ADMIN_PASSWORD=123123q
1919
#SELENIUM_PROTOCOL=http
2020
#SELENIUM_PATH=/wd/hub
2121

22-
#*** Browser for running tests, default chrome. Uncomment and change if you want to run tests on another browser (ex. firefox).
22+
#*** Browser for running tests, default chrome. Please change if you want to run tests on another browser (ex. firefox).
2323
BROWSER=chrome
2424

2525
#*** Uncomment and set host & port if your dev environment needs different value other than MAGENTO_BASE_URL for Rest API Requests ***#

RoboFile.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function buildProject()
4343
*
4444
* @param array $opts
4545
* @return void
46+
* @throws Exception
4647
*/
4748
function generateTests($opts = ['config' => null, 'force' => true, 'nodes' => null, 'debug' => false])
4849
{
@@ -60,7 +61,7 @@ function generateTests($opts = ['config' => null, 'force' => true, 'nodes' => nu
6061
}
6162

6263
\Magento\FunctionalTestingFramework\Util\TestGenerator::getInstance()
63-
->createAllTestFiles($opts['config'], $opts['nodes'], $opts['debug'], $this->getOutput());
64+
->createAllTestFiles($opts['config'], $opts['nodes'], $opts['debug']);
6465
$this->say("Generate Tests Command Run");
6566
}
6667

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,13 @@
2020
use Magento\FunctionalTestingFramework\Test\Util\ActionObjectExtractor;
2121
use Magento\FunctionalTestingFramework\Test\Util\TestObjectExtractor;
2222
use Magento\FunctionalTestingFramework\Util\Filesystem\DirSetupUtil;
23-
use Robo\Common\IO;
24-
use Symfony\Component\Console\Output\OutputInterface;
2523

2624
/**
2725
* Class TestGenerator
2826
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
2927
*/
3028
class TestGenerator
3129
{
32-
use IO;
33-
3430
const REQUIRED_ENTITY_REFERENCE = 'createDataKey';
3531
const GENERATED_DIR = '_generated';
3632
const DEFAULT_DIR = 'default';
@@ -56,6 +52,13 @@ class TestGenerator
5652
*/
5753
private $tests;
5854

55+
/**
56+
* Symfony output interface.
57+
*
58+
* @var Output
59+
*/
60+
private $output;
61+
5962
/**
6063
* TestGenerator constructor.
6164
*
@@ -73,6 +76,7 @@ private function __construct($exportDir, $tests)
7376
. DIRECTORY_SEPARATOR
7477
. $exportDir;
7578
$this->tests = $tests;
79+
$this->output = new \Symfony\Component\Console\Output\ConsoleOutput();
7680
}
7781

7882
/**
@@ -140,17 +144,13 @@ private function createCestFile($testPhp, $filename)
140144
* @param string $runConfig
141145
* @param int $nodes
142146
* @param bool $debug
143-
* @param OutputInterface|null $output
144147
* @return void
145148
* @throws TestReferenceException
146149
* @throws \Exception
147150
*/
148-
public function createAllTestFiles($runConfig = null, $nodes = null, $debug = false, $output = null)
151+
public function createAllTestFiles($runConfig = null, $nodes = null, $debug = false)
149152
{
150153
DirSetupUtil::createGroupDir($this->exportDirectory);
151-
if ($output !== null) {
152-
$this->setOutput($output);
153-
}
154154

155155
// create our manifest file here
156156
$testManifest = TestManifestFactory::makeManifest(
@@ -205,9 +205,8 @@ private function assembleTestPhp($testObject)
205205
*
206206
* @param BaseTestManifest $testManifest
207207
* @param int $nodes
208+
* @param bool $debug
208209
* @return array
209-
* @throws TestReferenceException
210-
* @throws \Exception
211210
*/
212211
private function assembleAllTestPhp($testManifest, $nodes, $debug = false)
213212
{
@@ -225,7 +224,7 @@ private function assembleAllTestPhp($testManifest, $nodes, $debug = false)
225224
$debugInformation = $test->getDebugInformation();
226225

227226
$this->debug($debugInformation, $debug);
228-
$this->debug('Finish creating test ' . $test->getCodeceptionName(), $debug);
227+
$this->debug('Finish creating test ' . $test->getCodeceptionName() . PHP_EOL, $debug);
229228
}
230229

231230
$testManifest->generate($nodes);
@@ -245,7 +244,7 @@ private function debug($messages, $debug = false)
245244
if ($debug && $messages) {
246245
$messages = (array) $messages;
247246
foreach ($messages as $message) {
248-
$this->say($message);
247+
$this->output->writeln($message);
249248
}
250249
}
251250
}

0 commit comments

Comments
 (0)