X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FgenerateRandomImages.php;h=d49971470d36d5ca04e7e82a214e59b96c9c5f66;hb=46c7453ddb593a124a307a7a3944c3fcf0983d29;hp=b22eccd0981f728121db0cca1f6738df823684f9;hpb=e516a54238e0d017ba2f1cf7557dc4411bff6b6a;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/api/generateRandomImages.php b/tests/phpunit/includes/api/generateRandomImages.php index b22eccd098..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( dirname( __FILE__ ) ) ) ) ); - // Start up MediaWiki in command-line mode -require_once( "$IP/maintenance/Maintenance.php" ); -require( dirname( __FILE__ ) . "/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,6 +43,4 @@ class GenerateRandomImages extends Maintenance { } $maintClass = 'GenerateRandomImages'; -require( RUN_MAINTENANCE_IF_MAIN ); - - +require RUN_MAINTENANCE_IF_MAIN;