ctr, self::$SKIPPEDINDICES ) ) { MMLTestUtilHTML::generateHTMLtableRow( self::$GENERATEDHTMLFILE, [ $tc->ctr, $tc->tex, "skipped", "skipped", "skipped", "skipped" ], false, self::$GENERATEHTML ); $this->assertTrue( true ); return; } # Fetch result from TexVC(PHP) $mhchemParser = new MhchemParser( self::$LOGMHCHEM ); $mhchemOutput = $mhchemParser->toTex( $tc->tex, $tc->typeC, true ); $warnings = []; $resTexVC = $texVC->check( $mhchemOutput, [ 'debug' => false, 'usemathrm' => true, 'oldtexvc' => false, 'usemhchem' => true, "usemhchemtexified" => true ], $warnings, false ); $mathMLtexVC = isset( $resTexVC["input"] ) ? MMLTestUtil::getMMLwrapped( $resTexVC["input"] ) : " error texvc "; MMLTestUtilHTML::generateHTMLtableRow( self::$GENERATEDHTMLFILE, [ $title, $tc->tex, $tc->texNew, $mhchemOutput, $tc->mml_latexml ?? "no mathml", $mathMLtexVC ], false, self::$GENERATEHTML ); if ( !self::$SKIPXMLVALIDATION ) { $this->assertEquals( $tc->texNew, $mhchemOutput ); } else { $this->assertTrue( true ); } } public static function provideTestCases() { $fileTestcases = MMLTestUtil::getJSON( self::$FILENAMEREF ); $f = []; // Adding running indices for location of tests. $ctr = 0; foreach ( $fileTestcases as $tcF ) { $tc = [ "ctr" => $ctr, "tex" => $tcF->tex, "texNew" => $tcF->texNew, "type" => $tcF->type, "typeC" => $tcF->typeC, "mml_mathoid" => $tcF->mmlMathoid, "mml_latexml" => $tcF->mmlLaTeXML, ]; $f[] = [ "tc#" . str_pad( $ctr, 3, '0', STR_PAD_LEFT ) . " " . $tcF->description, (object)$tc ]; $ctr++; } // Filtering results by index if necessary if ( self::$APPLYFILTER ) { $f = array_slice( $f, self::$FILTERSTART, self::$FILTERLENGTH ); } return $f; } }