- Timestamp:
- 03/26/2021 05:47:03 PM (4 years ago)
- Location:
- branches/5.5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.5
-
branches/5.5/tests/phpunit/includes/abstract-testcase.php
r48914 r50603 1247 1247 ); 1248 1248 } 1249 1250 /** 1251 * Touches the given file and its directory if it doesn't already exist. 1252 * 1253 * This can be used to ensure a file that is implictly relied on in a test exists 1254 * without it having to be built. 1255 * 1256 * @param string $file The file name. 1257 */ 1258 public static function touch( $file ) { 1259 if ( file_exists( $file ) ) { 1260 return; 1261 } 1262 1263 $dir = dirname( $file ); 1264 1265 if ( ! file_exists( $dir ) ) { 1266 mkdir( $dir, 0777, true ); 1267 } 1268 1269 touch( $file ); 1270 } 1249 1271 }
Note: See TracChangeset
for help on using the changeset viewer.