diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/ResultPrinters/TableResultPrinterTest.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/ResultPrinters/TableResultPrinterTest.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/ResultPrinters/TableResultPrinterTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/ResultPrinters/TableResultPrinterTest.php new file mode 100644 index 00000000..7ae4026c --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/Query/ResultPrinters/TableResultPrinterTest.php @@ -0,0 +1,44 @@ +<?php + +namespace SMW\Tests\Query\ResultPrinters; + +use SMW\Query\ResultPrinters\TableResultPrinter; + +/** + * @covers \SMW\Query\ResultPrinters\TableResultPrinter + * @group semantic-mediawiki + * + * @license GNU GPL v2+ + * @since 3.0 + * + * @author mwjames + */ +class TableResultPrinterTest extends \PHPUnit_Framework_TestCase { + + public function testCanConstruct() { + + $this->assertInstanceOf( + TableResultPrinter::class, + new TableResultPrinter( 'table' ) + ); + } + + public function testGetResult_Empty() { + + $queryResult = $this->getMockBuilder( '\SMWQueryResult' ) + ->disableOriginalConstructor() + ->getMock(); + + $queryResult->expects( $this->any() ) + ->method( 'getErrors' ) + ->will( $this->returnValue( [] ) ); + + $instance = new TableResultPrinter( 'table' ); + + $this->assertInternalType( + 'string', + $instance->getResult( $queryResult, [], SMW_OUTPUT_WIKI ) + ); + } + +} |