- Timestamp:
- 03/26/2021 07:22:10 PM (4 years ago)
- Location:
- branches/5.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.3
-
branches/5.3/tests/phpunit/includes/abstract-testcase.php
r50092 r50605 1225 1225 ); 1226 1226 } 1227 1228 /** 1229 * Touches the given file and its directory if it doesn't already exist. 1230 * 1231 * This can be used to ensure a file that is implictly relied on in a test exists 1232 * without it having to be built. 1233 * 1234 * @param string $file The file name. 1235 */ 1236 public static function touch( $file ) { 1237 if ( file_exists( $file ) ) { 1238 return; 1239 } 1240 1241 $dir = dirname( $file ); 1242 1243 if ( ! file_exists( $dir ) ) { 1244 mkdir( $dir, 0777, true ); 1245 } 1246 1247 touch( $file ); 1248 } 1227 1249 }
Note: See TracChangeset
for help on using the changeset viewer.