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