- Timestamp:
- 03/26/2021 05:21:35 PM (4 years ago)
- Location:
- branches/5.6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.6
-
branches/5.6/tests/phpunit/includes/abstract-testcase.php
r49280 r50602 1294 1294 ); 1295 1295 } 1296 1297 /** 1298 * Touches the given file and its directory if it doesn't already exist. 1299 * 1300 * This can be used to ensure a file that is implictly relied on in a test exists 1301 * without it having to be built. 1302 * 1303 * @param string $file The file name. 1304 */ 1305 public static function touch( $file ) { 1306 if ( file_exists( $file ) ) { 1307 return; 1308 } 1309 1310 $dir = dirname( $file ); 1311 1312 if ( ! file_exists( $dir ) ) { 1313 mkdir( $dir, 0777, true ); 1314 } 1315 1316 touch( $file ); 1317 } 1296 1318 }
Note: See TracChangeset
for help on using the changeset viewer.