2020use Magento \FunctionalTestingFramework \Test \Util \ActionObjectExtractor ;
2121use Magento \FunctionalTestingFramework \Test \Util \TestObjectExtractor ;
2222use 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 */
3028class TestGenerator
3129{
32- use IO ;
33-
3430 const REQUIRED_ENTITY_REFERENCE = 'createDataKey ' ;
3531 const GENERATED_DIR = '_generated ' ;
3632
@@ -55,6 +51,13 @@ class TestGenerator
5551 */
5652 private $ tests ;
5753
54+ /**
55+ * Symfony console output interface.
56+ *
57+ * @var \Symfony\Component\Console\Output\ConsoleOutput
58+ */
59+ private $ consoleOutput ;
60+
5861 /**
5962 * TestGenerator constructor.
6063 *
@@ -70,6 +73,7 @@ private function __construct($exportDir, $tests)
7073 DIRECTORY_SEPARATOR
7174 );
7275 $ this ->tests = $ tests ;
76+ $ this ->consoleOutput = new \Symfony \Component \Console \Output \ConsoleOutput ();
7377 }
7478
7579 /**
@@ -137,20 +141,19 @@ private function createCestFile($testPhp, $filename)
137141 * @param string $runConfig
138142 * @param int $nodes
139143 * @param bool $debug
140- * @param OutputInterface|null $output
141144 * @return void
142145 * @throws TestReferenceException
143146 * @throws \Exception
144147 */
145- public function createAllTestFiles ($ runConfig = null , $ nodes = null , $ debug = false , $ output = null )
148+ public function createAllTestFiles ($ runConfig = null , $ nodes = null , $ debug = false )
146149 {
147150 DirSetupUtil::createGroupDir ($ this ->exportDirectory );
148- if ($ output !== null ) {
149- $ this ->setOutput ($ output );
150- }
151-
152151 // 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+ );
154157 $ testPhpArray = $ this ->assembleAllTestPhp ($ testManifest , $ nodes , $ debug );
155158
156159 foreach ($ testPhpArray as $ testPhpFile ) {
@@ -219,7 +222,7 @@ private function assembleAllTestPhp($testManifest, $nodes, $debug = false)
219222 $ debugInformation = $ test ->getDebugInformation ();
220223
221224 $ this ->debug ($ debugInformation , $ debug );
222- $ this ->debug ('Finish creating test ' . $ test ->getCodeceptionName (), $ debug );
225+ $ this ->debug ('Finish creating test ' . $ test ->getCodeceptionName () . PHP_EOL , $ debug );
223226 }
224227
225228 $ testManifest ->generate ($ nodes );
@@ -239,7 +242,7 @@ private function debug($messages, $debug = false)
239242 if ($ debug && $ messages ) {
240243 $ messages = (array ) $ messages ;
241244 foreach ($ messages as $ message ) {
242- $ this ->say ($ message );
245+ $ this ->consoleOutput -> writeln ($ message );
243246 }
244247 }
245248 }
0 commit comments