20
20
use Magento \FunctionalTestingFramework \Test \Util \ActionObjectExtractor ;
21
21
use Magento \FunctionalTestingFramework \Test \Util \TestObjectExtractor ;
22
22
use Magento \FunctionalTestingFramework \Util \Filesystem \DirSetupUtil ;
23
- use Robo \Common \IO ;
24
- use Symfony \Component \Console \Output \OutputInterface ;
25
23
26
24
/**
27
25
* Class TestGenerator
28
26
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
29
27
*/
30
28
class TestGenerator
31
29
{
32
- use IO ;
33
-
34
30
const REQUIRED_ENTITY_REFERENCE = 'createDataKey ' ;
35
31
const GENERATED_DIR = '_generated ' ;
36
32
@@ -55,6 +51,13 @@ class TestGenerator
55
51
*/
56
52
private $ tests ;
57
53
54
+ /**
55
+ * Symfony console output interface.
56
+ *
57
+ * @var \Symfony\Component\Console\Output\ConsoleOutput
58
+ */
59
+ private $ consoleOutput ;
60
+
58
61
/**
59
62
* TestGenerator constructor.
60
63
*
@@ -70,6 +73,7 @@ private function __construct($exportDir, $tests)
70
73
DIRECTORY_SEPARATOR
71
74
);
72
75
$ this ->tests = $ tests ;
76
+ $ this ->consoleOutput = new \Symfony \Component \Console \Output \ConsoleOutput ();
73
77
}
74
78
75
79
/**
@@ -137,20 +141,19 @@ private function createCestFile($testPhp, $filename)
137
141
* @param string $runConfig
138
142
* @param int $nodes
139
143
* @param bool $debug
140
- * @param OutputInterface|null $output
141
144
* @return void
142
145
* @throws TestReferenceException
143
146
* @throws \Exception
144
147
*/
145
- public function createAllTestFiles ($ runConfig = null , $ nodes = null , $ debug = false , $ output = null )
148
+ public function createAllTestFiles ($ runConfig = null , $ nodes = null , $ debug = false )
146
149
{
147
150
DirSetupUtil::createGroupDir ($ this ->exportDirectory );
148
- if ($ output !== null ) {
149
- $ this ->setOutput ($ output );
150
- }
151
-
152
151
// create our manifest file here
153
- $ testManifest = TestManifestFactory::makeManifest ($ this ->exportDirectory , $ runConfig );
152
+ $ testManifest = TestManifestFactory::makeManifest (
153
+ dirname ($ this ->exportDirectory ),
154
+ $ this ->exportDirectory ,
155
+ $ runConfig
156
+ );
154
157
$ testPhpArray = $ this ->assembleAllTestPhp ($ testManifest , $ nodes , $ debug );
155
158
156
159
foreach ($ testPhpArray as $ testPhpFile ) {
@@ -219,7 +222,7 @@ private function assembleAllTestPhp($testManifest, $nodes, $debug = false)
219
222
$ debugInformation = $ test ->getDebugInformation ();
220
223
221
224
$ this ->debug ($ debugInformation , $ debug );
222
- $ this ->debug ('Finish creating test ' . $ test ->getCodeceptionName (), $ debug );
225
+ $ this ->debug ('Finish creating test ' . $ test ->getCodeceptionName () . PHP_EOL , $ debug );
223
226
}
224
227
225
228
$ testManifest ->generate ($ nodes );
@@ -239,7 +242,7 @@ private function debug($messages, $debug = false)
239
242
if ($ debug && $ messages ) {
240
243
$ messages = (array ) $ messages ;
241
244
foreach ($ messages as $ message ) {
242
- $ this ->say ($ message );
245
+ $ this ->consoleOutput -> writeln ($ message );
243
246
}
244
247
}
245
248
}
0 commit comments