Merge "Only need one check for is_dir"
[lhc/web/wiklou.git] / tests / phpunit / includes / utils / UIDGeneratorTest.php
index 50fa384..fedcc76 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class UIDGeneratorTest extends MediaWikiTestCase {
+class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
 
        protected function tearDown() {
                // Bug: 44850
@@ -28,21 +28,21 @@ class UIDGeneratorTest extends MediaWikiTestCase {
 
                $lastId = array_shift( $ids );
 
-               $this->assertArrayEquals( array_unique( $ids ), $ids, "All generated IDs are unique." );
+               $this->assertSame( array_unique( $ids ), $ids, "All generated IDs are unique." );
 
                foreach ( $ids as $id ) {
                        $id_bin = wfBaseConvert( $id, 10, 2 );
                        $lastId_bin = wfBaseConvert( $lastId, 10, 2 );
 
                        $this->assertGreaterThanOrEqual(
-                               substr( $id_bin, 0, $tbits ),
                                substr( $lastId_bin, 0, $tbits ),
+                               substr( $id_bin, 0, $tbits ),
                                "New ID timestamp ($id_bin) >= prior one ($lastId_bin)." );
 
                        if ( $hostbits ) {
                                $this->assertEquals(
-                                       substr( $id_bin, 0, -$hostbits ),
-                                       substr( $lastId_bin, 0, -$hostbits ),
+                                       substr( $id_bin, -$hostbits ),
+                                       substr( $lastId_bin, -$hostbits ),
                                        "Host ID of ($id_bin) is same as prior one ($lastId_bin)." );
                        }
 
@@ -105,8 +105,8 @@ class UIDGeneratorTest extends MediaWikiTestCase {
                $id1 = UIDGenerator::newSequentialPerNodeID( 'test', 32 );
                $id2 = UIDGenerator::newSequentialPerNodeID( 'test', 32 );
 
-               $this->assertType( 'float', $id1, "ID returned as float" );
-               $this->assertType( 'float', $id2, "ID returned as float" );
+               $this->assertInternalType( 'float', $id1, "ID returned as float" );
+               $this->assertInternalType( 'float', $id2, "ID returned as float" );
                $this->assertGreaterThan( 0, $id1, "ID greater than 1" );
                $this->assertGreaterThan( $id1, $id2, "IDs increasing in value" );
        }
@@ -118,7 +118,7 @@ class UIDGeneratorTest extends MediaWikiTestCase {
                $ids = UIDGenerator::newSequentialPerNodeIDs( 'test', 32, 5 );
                $lastId = null;
                foreach ( $ids as $id ) {
-                       $this->assertType( 'float', $id, "ID returned as float" );
+                       $this->assertInternalType( 'float', $id, "ID returned as float" );
                        $this->assertGreaterThan( 0, $id, "ID greater than 1" );
                        if ( $lastId ) {
                                $this->assertGreaterThan( $lastId, $id, "IDs increasing in value" );