@@ -78,11 +78,6 @@ public function testDumpWrongSortAndClean()
7878
7979 public function testDumpMessagesAndCleanInRootDirectory ()
8080 {
81- $ this ->fs ->remove ($ this ->translationDir );
82- $ this ->translationDir = sys_get_temp_dir ().'/ ' .uniqid ('sf_translation ' , true );
83- $ this ->fs ->mkdir ($ this ->translationDir .'/translations ' );
84- $ this ->fs ->mkdir ($ this ->translationDir .'/templates ' );
85-
8681 $ tester = $ this ->createCommandTester (['messages ' => ['foo ' => 'foo ' ]], [], null , [$ this ->translationDir .'/trans ' ], [$ this ->translationDir .'/views ' ]);
8782 $ tester ->execute (['command ' => 'translation:extract ' , 'locale ' => 'en ' , '--dump-messages ' => true , '--clean ' => true ]);
8883 $ this ->assertMatchesRegularExpression ('/foo/ ' , $ tester ->getDisplay ());
@@ -115,11 +110,6 @@ public function testWriteMessages()
115110
116111 public function testWriteMessagesInRootDirectory ()
117112 {
118- $ this ->fs ->remove ($ this ->translationDir );
119- $ this ->translationDir = sys_get_temp_dir ().'/ ' .uniqid ('sf_translation ' , true );
120- $ this ->fs ->mkdir ($ this ->translationDir .'/translations ' );
121- $ this ->fs ->mkdir ($ this ->translationDir .'/templates ' );
122-
123113 $ tester = $ this ->createCommandTester (['messages ' => ['foo ' => 'foo ' ]]);
124114 $ tester ->execute (['command ' => 'translation:extract ' , 'locale ' => 'en ' , '--force ' => true ]);
125115 $ this ->assertMatchesRegularExpression ('/Translation files were successfully updated./ ' , $ tester ->getDisplay ());
@@ -174,7 +164,8 @@ public function testFilterDuplicateTransPaths()
174164 protected function setUp (): void
175165 {
176166 $ this ->fs = new Filesystem ();
177- $ this ->translationDir = sys_get_temp_dir ().'/ ' .uniqid ('sf_translation ' , true );
167+ $ this ->translationDir = tempnam (sys_get_temp_dir (), 'sf_translation_ ' );
168+ $ this ->fs ->remove ($ this ->translationDir );
178169 $ this ->fs ->mkdir ($ this ->translationDir .'/translations ' );
179170 $ this ->fs ->mkdir ($ this ->translationDir .'/templates ' );
180171 }
0 commit comments