@@ -78,11 +78,6 @@ public function testDumpWrongSortAndClean()
78
78
79
79
public function testDumpMessagesAndCleanInRootDirectory ()
80
80
{
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
-
86
81
$ tester = $ this ->createCommandTester (['messages ' => ['foo ' => 'foo ' ]], [], null , [$ this ->translationDir .'/trans ' ], [$ this ->translationDir .'/views ' ]);
87
82
$ tester ->execute (['command ' => 'translation:extract ' , 'locale ' => 'en ' , '--dump-messages ' => true , '--clean ' => true ]);
88
83
$ this ->assertMatchesRegularExpression ('/foo/ ' , $ tester ->getDisplay ());
@@ -115,11 +110,6 @@ public function testWriteMessages()
115
110
116
111
public function testWriteMessagesInRootDirectory ()
117
112
{
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
-
123
113
$ tester = $ this ->createCommandTester (['messages ' => ['foo ' => 'foo ' ]]);
124
114
$ tester ->execute (['command ' => 'translation:extract ' , 'locale ' => 'en ' , '--force ' => true ]);
125
115
$ this ->assertMatchesRegularExpression ('/Translation files were successfully updated./ ' , $ tester ->getDisplay ());
@@ -174,7 +164,8 @@ public function testFilterDuplicateTransPaths()
174
164
protected function setUp (): void
175
165
{
176
166
$ 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 );
178
169
$ this ->fs ->mkdir ($ this ->translationDir .'/translations ' );
179
170
$ this ->fs ->mkdir ($ this ->translationDir .'/templates ' );
180
171
}
0 commit comments