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