markTestSkipped( "No mathoid cli configured on server" ); } } public function testGood() { $mml = new MathMathMLCli( $this->goodInput ); $input = [ 'good' => [ $mml ] ]; MathMathMLCli::batchEvaluate( $input ); $this->assertTrue( $mml->render(), 'assert that renders' ); $this->assertStringContainsString( '', $mml->getMathml() ); } public function testUndefinedFunctionError() { $mml = new MathMathMLCli( $this->badInput ); $input = [ 'bad' => [ $mml ] ]; MathMathMLCli::batchEvaluate( $input ); $this->assertFalse( $mml->render(), 'assert that fails' ); $this->assertStringContainsString( 'newcommand', $mml->getLastError() ); } public function testSyntaxError() { $mml = new MathMathMLCli( '^' ); $input = [ 'bad' => [ $mml ] ]; MathMathMLCli::batchEvaluate( $input ); $this->assertFalse( $mml->render(), 'assert that fails' ); $this->assertStringContainsString( 'SyntaxError', $mml->getLastError() ); } public function testCeError() { $mml = new MathMathMLCli( '\ce{H2O}' ); $input = [ 'bad' => [ $mml ] ]; MathMathMLCli::batchEvaluate( $input ); $this->assertFalse( $mml->render(), 'assert that fails' ); $this->assertStringContainsString( 'SyntaxError', $mml->getLastError() ); } public function testEmpty() { $mml = new MathMathMLCli( '' ); $input = [ 'bad' => [ $mml ] ]; MathMathMLCli::batchEvaluate( $input ); $this->assertFalse( $mml->render(), 'assert that renders' ); $this->assertFalse( $mml->isTexSecure() ); $this->assertStringContainsString( 'empty', $mml->getLastError() ); } }