diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SQLStore/QueryEngine/QuerySegmentTest.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SQLStore/QueryEngine/QuerySegmentTest.php | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SQLStore/QueryEngine/QuerySegmentTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SQLStore/QueryEngine/QuerySegmentTest.php new file mode 100644 index 00000000..f4388a5e --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Unit/SQLStore/QueryEngine/QuerySegmentTest.php @@ -0,0 +1,82 @@ +<?php + +namespace SMW\Tests\SQLStore\QueryEngine; + +use SMW\SQLStore\QueryEngine\QuerySegment; + +/** + * @covers \SMW\SQLStore\QueryEngine\QuerySegment + * @group semantic-mediawiki + * + * @license GNU GPL v2+ + * @since 2.2 + * + * @author mwjames + */ +class QuerySegmentTest extends \PHPUnit_Framework_TestCase { + + public function testCanConstruct() { + + $this->assertInstanceOf( + '\SMW\SQLStore\QueryEngine\QuerySegment', + new QuerySegment() + ); + } + + public function testInitialStateAfterReset() { + + $instance = new QuerySegment(); + $instance->reset(); + + $this->assertEquals( + 0, + $instance->queryNumber + ); + + $this->assertEquals( + 't0', + $instance->alias + ); + + $this->assertEquals( + 1, + $instance::$qnum + ); + + $this->assertEquals( + $instance::Q_TABLE, + $instance->type + ); + + $this->assertEquals( + [], + $instance->components + ); + + $this->assertEquals( + [], + $instance->sortfields + ); + + $this->assertEquals( + '', + $instance->joinfield + ); + + $this->assertEquals( + '', + $instance->joinTable + ); + + $this->assertEquals( + '', + $instance->from + ); + + $this->assertEquals( + '', + $instance->where + ); + } + +} |