@@ -35,22 +35,24 @@ public function generate(string $moduleName, OutputInterface $output, bool $over
3535
3636 $ classNamePrefix = $ this ->getClassNamePrefix ($ moduleName );
3737
38- $ output ->writeln ('Generating module test ' );
3938 $ testFile = $ testPath .'ModuleTest.php ' ;
40- $ testContents = $ this ->moduleTestGenerator ->generate ($ moduleName , $ classNamePrefix );
4139 if (true === $ overrideExisting || false === $ this ->getWriter ()->isExist ($ testFile )) {
40+ $ testContents = $ this ->moduleTestGenerator ->generate ($ moduleName , $ classNamePrefix );
41+ $ output ->writeln ('Generating module test ' );
4242 $ this ->getWriter ()->writeFile ($ testFile , $ testContents );
4343 }
4444
4545 $ classNames = $ this ->classCollector ->collect ($ modulePath );
4646 foreach ($ classNames as $ className ) {
47- $ output -> writeln ( ' Generating test for ' . $ className );
47+
4848 $ classStub = $ this ->classStubFactory ->create ($ moduleName , $ className );
4949 $ testClassStub = $ this ->classStubFactory ->createTest ($ classStub );
50- $ testContents = $ this ->genericTestGenerator ->generate ($ classStub , $ testClassStub );
5150 $ testFile = $ modulePath .'/ ' .$ testClassStub ->getRelativePath ();
52- $ output -> writeln ( ' Writing file ' . $ testFile , OutputInterface:: VERBOSITY_VERBOSE );
51+
5352 if (true === $ overrideExisting || false === $ this ->getWriter ()->isExist ($ testFile )) {
53+ $ testContents = $ this ->genericTestGenerator ->generate ($ classStub , $ testClassStub );
54+ $ output ->writeln ('Generating test for ' .$ className );
55+ $ output ->writeln ('Writing file ' .$ testFile , OutputInterface::VERBOSITY_VERBOSE );
5456 $ this ->getWriter ()->writeFile ($ testFile , $ testContents );
5557 }
5658 }
0 commit comments