3 namespace MediaWiki\Tests\Api
;
5 use MediaWiki\Maintenance\Maintenance
;
8 * Bootstrapping for test image file generation
13 // Start up MediaWiki in command-line mode
14 require_once __DIR__
. "/../../../../maintenance/Maintenance.php";
15 require_once __DIR__
. "/RandomImageGenerator.php";
17 class GenerateRandomImages
extends Maintenance
{
19 public function getDbType() {
20 return Maintenance
::DB_NONE
;
23 public function execute() {
33 $options = getopt( '', $getOptSpec );
35 $format = $options['format'] ??
'svg';
36 unset( $options['format'] );
38 $number = (int)( $options['number'] ??
1 );
39 unset( $options['number'] );
41 $randomImageGenerator = new RandomImageGenerator( $options );
42 $randomImageGenerator->writeImages( $number, $format );
46 $maintClass = GenerateRandomImages
::class;
47 require_once RUN_MAINTENANCE_IF_MAIN
;