wfBaseConvert(): Work around PHP Bug #50175
[lhc/web/wiklou.git] / tests / phpunit / includes / GlobalFunctions / wfBaseConvertTest.php
index 79dd91d..9d55e85 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 /**
+ * @group GlobalFunctions
  * @covers ::wfBaseConvert
  */
 class WfBaseConvertTest extends MediaWikiTestCase {
@@ -185,4 +186,10 @@ class WfBaseConvertTest extends MediaWikiTestCase {
                        strlen( wfBaseConvert( $number, 2, 2, strlen( $number ) - 5 ) )
                );
        }
+
+       public function testLeadingZero() {
+               $this->assertSame( '24', wfBaseConvert( '010', 36, 16 ) );
+               $this->assertSame( '37d4', wfBaseConvert( '0b10', 36, 16 ) );
+               $this->assertSame( 'a734', wfBaseConvert( '0x10', 36, 16 ) );
+       }
 }