Skip to content

Commit 0e746db

Browse files
authored
bug: Fixed unmanaged files incorrectly working with directories. (#129)
1 parent fce663f commit 0e746db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/FileTrait.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,10 @@ protected function fileLoadMultiple(array $conditions = []) {
189189
* @Given unmanaged file :uri created
190190
*/
191191
public function fileCreateUnmanaged($uri, $content = 'test') {
192-
$dir = dirname($uri);
192+
$dir = \Drupal::service('file_system')->dirname($uri);
193+
193194
if (!file_exists($dir)) {
194-
mkdir($dir, 0770, TRUE);
195+
$dir = \Drupal::service('file_system')->dirname($dir, 0770, TRUE);
195196
}
196197

197198
file_put_contents($uri, $content);

0 commit comments

Comments
 (0)