jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I662942c5186d656d01ef47ca121ac39f3e5d1c3b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Ask
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Anja Jentzsch <[email protected]>
Gerrit-Reviewer: Ataherivand <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Daniel Werner <[email protected]>
Gerrit-Reviewer: Denny Vrandecic <[email protected]>
Gerrit-Reviewer: Henning Snater <[email protected]>
Gerrit-Reviewer: Jens Ohlig <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: John Erling Blad <[email protected]>
Gerrit-Reviewer: Lydia Pintscher <[email protected]>
Gerrit-Reviewer: Markus Kroetzsch <[email protected]>
Gerrit-Reviewer: Nikola Smolenski <[email protected]>
Gerrit-Reviewer: Silke Meyer <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to