Merge "rdbms: avoid LoadBalancer::getConnection waste when using $groups"
[lhc/web/wiklou.git] / tests / phpunit / includes / utils / UIDGeneratorTest.php
index 230c935..6b81a66 100644 (file)
@@ -1,11 +1,11 @@
 <?php
 
-class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
+class UIDGeneratorTest extends PHPUnit\Framework\TestCase {
 
        use MediaWikiCoversValidator;
 
        protected function tearDown() {
-               // Bug: 44850
+               // T46850
                UIDGenerator::unitTestTearDown();
                parent::tearDown();
        }
@@ -14,11 +14,13 @@ class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
         * Test that generated UIDs have the expected properties
         *
         * @dataProvider provider_testTimestampedUID
-        * @covers UIDGenerator::newTimestampedUID128
         * @covers UIDGenerator::newTimestampedUID88
+        * @covers UIDGenerator::getTimestampedID88
+        * @covers UIDGenerator::newTimestampedUID128
+        * @covers UIDGenerator::getTimestampedID128
         */
        public function testTimestampedUID( $method, $digitlen, $bits, $tbits, $hostbits ) {
-               $id = call_user_func( [ 'UIDGenerator', $method ] );
+               $id = call_user_func( [ UIDGenerator::class, $method ] );
                $this->assertEquals( true, ctype_digit( $id ), "UID made of digit characters" );
                $this->assertLessThanOrEqual( $digitlen, strlen( $id ),
                        "UID has the right number of digits" );
@@ -27,7 +29,7 @@ class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
 
                $ids = [];
                for ( $i = 0; $i < 300; $i++ ) {
-                       $ids[] = call_user_func( [ 'UIDGenerator', $method ] );
+                       $ids[] = call_user_func( [ UIDGenerator::class, $method ] );
                }
 
                $lastId = array_shift( $ids );
@@ -78,6 +80,7 @@ class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
 
        /**
         * @covers UIDGenerator::newUUIDv1
+        * @covers UIDGenerator::getUUIDv1
         */
        public function testUUIDv1() {
                $ids = [];
@@ -157,6 +160,7 @@ class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
 
        /**
         * @covers UIDGenerator::newSequentialPerNodeIDs
+        * @covers UIDGenerator::getSequentialPerNodeIDs
         */
        public function testNewSequentialIDs() {
                $ids = UIDGenerator::newSequentialPerNodeIDs( 'test', 32, 5 );