X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FgenerateRandomImages.php;h=d49971470d36d5ca04e7e82a214e59b96c9c5f66;hb=46c7453ddb593a124a307a7a3944c3fcf0983d29;hp=cba8312bf9e514e7c385ddfeaf9a71ae58d2eb95;hpb=78271824d2085591a43d3a7b9410614a2fd10d9d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/generateRandomImages.php b/tests/phpunit/includes/api/generateRandomImages.php index cba8312bf9..d49971470d 100644 --- a/tests/phpunit/includes/api/generateRandomImages.php +++ b/tests/phpunit/includes/api/generateRandomImages.php @@ -5,12 +5,9 @@ * @file */ -// Evaluate the include path relative to this file -$IP = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ); - // Start up MediaWiki in command-line mode -require_once( "$IP/maintenance/Maintenance.php" ); -require( __DIR__ . "/RandomImageGenerator.php" ); +require_once __DIR__ . "/../../../../maintenance/Maintenance.php"; +require __DIR__ . "/RandomImageGenerator.php"; class GenerateRandomImages extends Maintenance { @@ -20,7 +17,7 @@ class GenerateRandomImages extends Maintenance { public function execute() { - $getOptSpec = array( + $getOptSpec = [ 'dictionaryFile::', 'minWidth::', 'maxWidth::', @@ -31,7 +28,7 @@ class GenerateRandomImages extends Maintenance { 'number::', 'format::' - ); + ]; $options = getopt( null, $getOptSpec ); $format = isset( $options['format'] ) ? $options['format'] : 'jpg'; @@ -46,4 +43,4 @@ class GenerateRandomImages extends Maintenance { } $maintClass = 'GenerateRandomImages'; -require( RUN_MAINTENANCE_IF_MAIN ); +require RUN_MAINTENANCE_IF_MAIN;