File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -27,4 +27,9 @@ public static function classNameToFilename(string $className): string
2727 $ className
2828 ) . '.php ' ;
2929 }
30+
31+ public static function createDirectory (string $ directory ): bool
32+ {
33+ return !(!\is_dir ($ directory ) && !@\mkdir ($ directory , 0777 , true ) && !\is_dir ($ directory ));
34+ }
3035}
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function __construct($out = null)
5353
5454 $ this ->out = \fsockopen ($ out [0 ], $ out [1 ]);
5555 } else {
56- if (\strpos ($ out , 'php:// ' ) === false && !$ this -> createDirectory (\dirname ($ out ))) {
56+ if (\strpos ($ out , 'php:// ' ) === false && !Filesystem:: createDirectory (\dirname ($ out ))) {
5757 throw new Exception (\sprintf ('Directory "%s" was not created ' , \dirname ($ out )));
5858 }
5959
@@ -132,9 +132,4 @@ public function setAutoFlush(bool $autoFlush): void
132132 {
133133 $ this ->autoFlush = $ autoFlush ;
134134 }
135-
136- private function createDirectory (string $ directory ): bool
137- {
138- return !(!\is_dir ($ directory ) && !@\mkdir ($ directory , 0777 , true ) && !\is_dir ($ directory ));
139- }
140135}
Original file line number Diff line number Diff line change 1010namespace PHPUnit \Runner ;
1111
1212use PHPUnit \Framework \Test ;
13+ use PHPUnit \Util \Filesystem ;
1314
1415class TestResultCache implements \Serializable, TestResultCacheInterface
1516{
@@ -79,7 +80,7 @@ public function saveToFile(): void
7980 return ;
8081 }
8182
82- if (!$ this -> createDirectory (\dirname ($ this ->cacheFilename ))) {
83+ if (!Filesystem:: createDirectory (\dirname ($ this ->cacheFilename ))) {
8384 throw new Exception (
8485 \sprintf (
8586 'Cannot create directory "%s" for result cache file ' ,
@@ -187,9 +188,4 @@ public function unserialize($serialized): void
187188 }
188189 }
189190 }
190-
191- private function createDirectory (string $ directory ): bool
192- {
193- return !(!\is_dir ($ directory ) && !@\mkdir ($ directory , 0777 , true ) && !\is_dir ($ directory ));
194- }
195191}
You can’t perform that action at this time.
0 commit comments