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