X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Futils%2FUIDGeneratorTest.php;h=fedcc762deb10a595585f01b6cdfca684cdd3ab5;hb=6733f81d33a71755428a55f2723f4066a141cbb8;hp=50fa3849330a950e1758c674a3781e79c8704db1;hpb=05b8af8b91dac965c67571668187d1dc2511ae03;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/utils/UIDGeneratorTest.php b/tests/phpunit/includes/utils/UIDGeneratorTest.php index 50fa384933..fedcc762de 100644 --- a/tests/phpunit/includes/utils/UIDGeneratorTest.php +++ b/tests/phpunit/includes/utils/UIDGeneratorTest.php @@ -1,6 +1,6 @@ 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" );