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