Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/65296
Change subject: Improvements to QueryOptionsTest ...................................................................... Improvements to QueryOptionsTest Change-Id: I662942c5186d656d01ef47ca121ac39f3e5d1c3b --- M Tests/Phpunit/Language/Option/QueryOptionsTest.php 1 file changed, 25 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Ask refs/changes/96/65296/1 diff --git a/Tests/Phpunit/Language/Option/QueryOptionsTest.php b/Tests/Phpunit/Language/Option/QueryOptionsTest.php index 280b9a2..b7f5dbb 100644 --- a/Tests/Phpunit/Language/Option/QueryOptionsTest.php +++ b/Tests/Phpunit/Language/Option/QueryOptionsTest.php @@ -3,6 +3,8 @@ namespace Ask\Tests\Phpunit\Language\Option; use Ask\Language\Option\QueryOptions; +use Ask\Language\Option\SortOptions; +use Ask\Tests\Phpunit\AskTestCase; /** * @covers Ask\Language\Option\QueryOptions @@ -33,7 +35,7 @@ * @licence GNU GPL v2+ * @author Jeroen De Dauw < [email protected] > */ -class QueryOptionsTest extends \Ask\Tests\Phpunit\AskTestCase { +class QueryOptionsTest extends AskTestCase { /** * @since 0.1 @@ -56,7 +58,7 @@ $instances[] = new QueryOptions( 9000, 42, - new \Ask\Language\Option\SortOptions( array() ) + new SortOptions( array() ) ); return $instances; @@ -83,4 +85,25 @@ $this->assertPrimitiveStructure( $array ); } + /** + * @dataProvider constructorArgumentProvider + */ + public function testConstructSetsFields( $limit, $offset, SortOptions $sort ) { + $queryOptions = new QueryOptions( $limit, $offset, $sort ); + + $this->assertEquals( $limit, $queryOptions->getLimit() ); + $this->assertEquals( $offset, $queryOptions->getOffset() ); + $this->assertEquals( $sort, $queryOptions->getSort() ); + } + + public function constructorArgumentProvider() { + $argLists = array(); + + $argLists[] = array( 1, 2, new SortOptions( array() ) ); + + $argLists[] = array( 100, 0, new SortOptions( array() ) ); + + return $argLists; + } + } -- To view, visit https://gerrit.wikimedia.org/r/65296 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I662942c5186d656d01ef47ca121ac39f3e5d1c3b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Ask Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
