Thiemo Mättig (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/253314

Change subject: Add missing test cases to WikibaseRepoTest
......................................................................

Add missing test cases to WikibaseRepoTest

This adds two sets of test cases for the two methods that do support
a $reset = 'reset' parameter.

Change-Id: I81bdfbdce988ffe0dba9d0f352086f1c255f3b64
---
M repo/tests/phpunit/includes/WikibaseRepoTest.php
1 file changed, 30 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/14/253314/1

diff --git a/repo/tests/phpunit/includes/WikibaseRepoTest.php 
b/repo/tests/phpunit/includes/WikibaseRepoTest.php
index b8b83cd..75ce7f3 100644
--- a/repo/tests/phpunit/includes/WikibaseRepoTest.php
+++ b/repo/tests/phpunit/includes/WikibaseRepoTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Tests\Repo;
 
 use Language;
+use MediaWikiTestCase;
 use Wikibase\Lib\DataTypeDefinitions;
 use Wikibase\Repo\WikibaseRepo;
 use Wikibase\SettingsArray;
@@ -19,7 +20,35 @@
  * @author Jeroen De Dauw < jeroended...@gmail.com >
  * @author Daniel Kinzler
  */
-class WikibaseRepoTest extends \MediaWikiTestCase {
+class WikibaseRepoTest extends MediaWikiTestCase {
+
+       public function testGetDefaultValidatorBuilders_noReset() {
+               $first = 
$this->getWikibaseRepo()->getDefaultValidatorBuilders();
+               $this->assertInstanceOf( 'Wikibase\Repo\ValidatorBuilders', 
$first );
+
+               $second = 
$this->getWikibaseRepo()->getDefaultValidatorBuilders();
+               $this->assertSame( $first, $second );
+       }
+
+       public function testGetDefaultValidatorBuilders_withReset() {
+               $first = 
$this->getWikibaseRepo()->getDefaultValidatorBuilders();
+               $second = 
$this->getWikibaseRepo()->getDefaultValidatorBuilders( 'reset' );
+               $this->assertNotSame( $first, $second );
+       }
+
+       public function testGetDefaultFormatterBuilders_noReset() {
+               $first = 
$this->getWikibaseRepo()->getDefaultFormatterBuilders();
+               $this->assertInstanceOf( 
'Wikibase\Lib\WikibaseValueFormatterBuilders', $first );
+
+               $second = 
$this->getWikibaseRepo()->getDefaultFormatterBuilders();
+               $this->assertSame( $first, $second );
+       }
+
+       public function testGetDefaultFormatterBuilders_withReset() {
+               $first = 
$this->getWikibaseRepo()->getDefaultFormatterBuilders();
+               $second = 
$this->getWikibaseRepo()->getDefaultFormatterBuilders( 'reset' );
+               $this->assertNotSame( $first, $second );
+       }
 
        public function testGetDataTypeFactoryReturnType() {
                $returnValue = $this->getWikibaseRepo()->getDataTypeFactory();

-- 
To view, visit https://gerrit.wikimedia.org/r/253314
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81bdfbdce988ffe0dba9d0f352086f1c255f3b64
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to