testMakeScriptCommand( $expected, $script, $parameters, $options=[], $hook=null)
\MediaWiki\Shell\Shell::makeScriptCommand provideMakeScriptCommand
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class