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
const DEFAULT_DIR = 'default ' ;
@@ -56,6 +52,13 @@ class TestGenerator
56
52
*/
57
53
private $ tests ;
58
54
55
+ /**
56
+ * Symfony output interface.
57
+ *
58
+ * @var Output
59
+ */
60
+ private $ output ;
61
+
59
62
/**
60
63
* TestGenerator constructor.
61
64
*
@@ -73,6 +76,7 @@ private function __construct($exportDir, $tests)
73
76
. DIRECTORY_SEPARATOR
74
77
. $ exportDir ;
75
78
$ this ->tests = $ tests ;
79
+ $ this ->output = new \Symfony \Component \Console \Output \ConsoleOutput ();
76
80
}
77
81
78
82
/**
@@ -140,17 +144,13 @@ private function createCestFile($testPhp, $filename)
140
144
* @param string $runConfig
141
145
* @param int $nodes
142
146
* @param bool $debug
143
- * @param OutputInterface|null $output
144
147
* @return void
145
148
* @throws TestReferenceException
146
149
* @throws \Exception
147
150
*/
148
- public function createAllTestFiles ($ runConfig = null , $ nodes = null , $ debug = false , $ output = null )
151
+ public function createAllTestFiles ($ runConfig = null , $ nodes = null , $ debug = false )
149
152
{
150
153
DirSetupUtil::createGroupDir ($ this ->exportDirectory );
151
- if ($ output !== null ) {
152
- $ this ->setOutput ($ output );
153
- }
154
154
155
155
// create our manifest file here
156
156
$ testManifest = TestManifestFactory::makeManifest (
@@ -205,9 +205,8 @@ private function assembleTestPhp($testObject)
205
205
*
206
206
* @param BaseTestManifest $testManifest
207
207
* @param int $nodes
208
+ * @param bool $debug
208
209
* @return array
209
- * @throws TestReferenceException
210
- * @throws \Exception
211
210
*/
212
211
private function assembleAllTestPhp ($ testManifest , $ nodes , $ debug = false )
213
212
{
@@ -225,7 +224,7 @@ private function assembleAllTestPhp($testManifest, $nodes, $debug = false)
225
224
$ debugInformation = $ test ->getDebugInformation ();
226
225
227
226
$ this ->debug ($ debugInformation , $ debug );
228
- $ this ->debug ('Finish creating test ' . $ test ->getCodeceptionName (), $ debug );
227
+ $ this ->debug ('Finish creating test ' . $ test ->getCodeceptionName () . PHP_EOL , $ debug );
229
228
}
230
229
231
230
$ testManifest ->generate ($ nodes );
@@ -245,7 +244,7 @@ private function debug($messages, $debug = false)
245
244
if ($ debug && $ messages ) {
246
245
$ messages = (array ) $ messages ;
247
246
foreach ($ messages as $ message ) {
248
- $ this ->say ($ message );
247
+ $ this ->output -> writeln ($ message );
249
248
}
250
249
}
251
250
}
0 commit comments