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

Change subject: Register an own Datatypes text function in DataTypeSelectorTest
......................................................................


Register an own Datatypes text function in DataTypeSelectorTest

Needed for that to work with data types 0.5.2 as that stopped setting
one per default for tests.

Change-Id: Ie83ad7888d710a09f8b15eb90773db81833d201e
---
M repo/tests/phpunit/includes/DataTypeSelectorTest.php
1 file changed, 17 insertions(+), 8 deletions(-)

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



diff --git a/repo/tests/phpunit/includes/DataTypeSelectorTest.php 
b/repo/tests/phpunit/includes/DataTypeSelectorTest.php
index d914cab..2d27d36 100644
--- a/repo/tests/phpunit/includes/DataTypeSelectorTest.php
+++ b/repo/tests/phpunit/includes/DataTypeSelectorTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Test;
 
 use DataTypes\DataType;
+use DataTypes\Message;
 use PHPUnit_Framework_TestCase;
 use Wikibase\DataTypeSelector;
 
@@ -16,6 +17,14 @@
  * @author Thiemo Mättig
  */
 class DataTypeSelectorTest extends PHPUnit_Framework_TestCase {
+
+       protected function setUp() {
+               parent::setUp();
+
+               Message::registerTextFunction( function( $key, $languageCode ) {
+                       return '(' . implode( '|', func_get_args() ) . ')';
+               } );
+       }
 
        /**
         * @param DataType[]|null $dataTypes
@@ -68,15 +77,15 @@
                                array( new DataType( '<PT>', '<VT>' ) ),
                                '',
                                '<select name="&lt;NAME&gt;" id="&lt;ID&gt;" 
class="wb-select">'
-                               . '<option 
value="&lt;PT&gt;">(datatypes-type-&lt;PT>)</option>'
+                               . '<option 
value="&lt;PT&gt;">(datatypes-type-&lt;PT>|qqx)</option>'
                                . '</select>'
                        ),
                        array(
                                array( new DataType( 'PT1', 'VT1' ), new 
DataType( 'PT2', 'VT2' ) ),
                                'PT2',
                                '<select name="&lt;NAME&gt;" id="&lt;ID&gt;" 
class="wb-select">'
-                               . '<option 
value="PT1">(datatypes-type-PT1)</option>'
-                               . '<option value="PT2" 
selected="">(datatypes-type-PT2)</option>'
+                               . '<option 
value="PT1">(datatypes-type-PT1|qqx)</option>'
+                               . '<option value="PT2" 
selected="">(datatypes-type-PT2|qqx)</option>'
                                . '</select>'
                        ),
                );
@@ -85,11 +94,11 @@
        public function testGetOptionsArray() {
                $selector = $this->newInstance();
                $options = $selector->getOptionsArray();
-               $this->assertSame( array( '<PT>' => '(datatypes-type-<PT>)' ), 
$options );
+               $this->assertSame( array( '<PT>' => '(datatypes-type-<PT>|qqx)' 
), $options );
        }
 
        /**
-        * @dataProvider testGetOptionsHtmlProvider
+        * @dataProvider getOptionsHtmlProvider
         */
        public function testGetOptionsHtml( $selectedTypeId, $expected ) {
                $selector = $this->newInstance();
@@ -97,15 +106,15 @@
                $this->assertSame( $expected, $html );
        }
 
-       public function testGetOptionsHtmlProvider() {
+       public function getOptionsHtmlProvider() {
                return array(
                        array(
                                '',
-                               '<option 
value="&lt;PT&gt;">(datatypes-type-&lt;PT>)</option>'
+                               '<option 
value="&lt;PT&gt;">(datatypes-type-&lt;PT>|qqx)</option>'
                        ),
                        array(
                                '<PT>',
-                               '<option value="&lt;PT&gt;" 
selected="">(datatypes-type-&lt;PT>)</option>'
+                               '<option value="&lt;PT&gt;" 
selected="">(datatypes-type-&lt;PT>|qqx)</option>'
                        ),
                );
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie83ad7888d710a09f8b15eb90773db81833d201e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: wmf/1.27.0-wmf.14
Gerrit-Owner: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Hoo man <h...@online.de>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to