addDescription( 'Update reference rendering for regression tests. Changes should be investigated manually.' ); } /** * @throws \MediaWiki\Maintenance\MaintenanceFatalError */ public function execute() { $file = file_get_contents( __DIR__ . "/../tests/phpunit/unit/WikiTexVC/data/reference.json" ); $json = json_decode( $file, true ); $success = true; $allEntries = []; foreach ( $json as $entry ) { $success = $success && MathNativeMML::renderReferenceEntry( $entry ); $allEntries[] = $entry; } $jsonData = json_encode( $allEntries, JSON_PRETTY_PRINT ); file_put_contents( __DIR__ . "/../tests/phpunit/unit/WikiTexVC/data/reference.json", $jsonData ); if ( !$success ) { $this->fatalError( "Some entries were skipped. Please investigate.\n" ); } $this->output( "Regression.json successfully updated.\n" ); } } $maintClass = FixNativeReferences::class; require_once RUN_MAINTENANCE_IF_MAIN;