@@ -34,8 +34,8 @@ class MakerTestCase extends TestCase
3434 public static function setupPaths ()
3535 {
3636 self ::$ currentRootDir = __DIR__ .'/../../tests/tmp/current_project ' ;
37- self ::$ flexProjectPath = __DIR__ .'/../../tests/tmp/template_project ' ;
3837 self ::$ fixturesCachePath = __DIR__ .'/../../tests/tmp/cache ' ;
38+ self ::$ flexProjectPath = self ::$ fixturesCachePath .'/flex_project ' ;
3939 }
4040
4141 protected function executeMakerCommand (MakerTestDetails $ testDetails )
@@ -133,7 +133,7 @@ protected function executeMakerCommand(MakerTestDetails $testDetails)
133133 // execute the tests that were moved into the project!
134134 $ process = $ this ->createProcess (
135135 // using OUR simple-phpunit for speed (to avoid downloading more deps)
136- ' .. /../../vendor/bin/simple-phpunit ' ,
136+ __DIR__ . ' /../../vendor/bin/simple-phpunit ' ,
137137 self ::$ currentRootDir
138138 );
139139 $ process ->run ();
@@ -155,7 +155,11 @@ protected function assertContainsCount(string $needle, string $haystack, int $co
155155
156156 private function buildFlexProject ()
157157 {
158- $ process = $ this ->createProcess ('composer create-project symfony/skeleton template_project ' , dirname (self ::$ flexProjectPath ));
158+ $ targetFlexDir = dirname (self ::$ flexProjectPath );
159+ if (!file_exists ($ targetFlexDir )) {
160+ self ::$ fs ->mkdir ($ targetFlexDir );
161+ }
162+ $ process = $ this ->createProcess ('composer create-project symfony/skeleton flex_project ' , $ targetFlexDir );
159163 $ this ->runProcess ($ process );
160164
161165 // processes any changes needed to the Flex project
@@ -168,7 +172,7 @@ private function buildFlexProject()
168172 [
169173 'filename ' => 'composer.json ' ,
170174 'find ' => '"App \\\Tests \\\": "tests/" ' ,
171- 'replace ' => sprintf ('"App \\\Tests \\\": "tests/", ' ."\n" .' "Symfony \\\Bundle \\\MakerBundle \\\": "%s/src/" ' , __DIR__ .'../../../ ' ),
175+ 'replace ' => sprintf ('"App \\\Tests \\\": "tests/", ' ."\n" .' "Symfony \\\Bundle \\\MakerBundle \\\": "%s/src/" ' , str_replace ( '\\' , '\\\\' , __DIR__ .'../../.. ' ) ),
172176 ],
173177 ];
174178 $ this ->processReplacements ($ replacements , self ::$ flexProjectPath );
0 commit comments