assertIsString( $instance->buildHTML( [], null ) ); } public function testExplainFormat() { $instance = new DebugFormatter( 'mysql', DebugFormatter::JSON_FORMAT ); $this->assertEquals( 'FORMAT=json', $instance->getFormat() ); } public function testFormatDebugOutputWithQuery() { $description = $this->getMockBuilder( '\SMW\Query\Language\Description' ) ->disableOriginalConstructor() ->getMockForAbstractClass(); $query = $this->getMockBuilder( '\SMWQuery' ) ->disableOriginalConstructor() ->getMock(); $query->expects( $this->any() ) ->method( 'getDescription' ) ->willReturn( $description ); $query->expects( $this->any() ) ->method( 'getErrors' ) ->willReturn( [] ); $instance = new DebugFormatter(); $this->assertIsString( $instance->buildHTML( [], $query ) ); } /** * @dataProvider sqlExplainFormatProvider */ public function testFormatSQLExplainOutput( $type, $res ) { $instance = new DebugFormatter(); $this->assertIsString( $instance->prettifyExplain( $res ) ); } public function testFormatSPARQLStatement() { $instance = new DebugFormatter(); $sparql = ''; $this->assertIsString( $instance->prettifySPARQL( $sparql ) ); $this->assertEquals( '