From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- tests/phpunit/includes/UIDGeneratorTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/phpunit/includes/UIDGeneratorTest.php') diff --git a/tests/phpunit/includes/UIDGeneratorTest.php b/tests/phpunit/includes/UIDGeneratorTest.php index 23553ca7..8f78ae51 100644 --- a/tests/phpunit/includes/UIDGeneratorTest.php +++ b/tests/phpunit/includes/UIDGeneratorTest.php @@ -1,8 +1,11 @@ assertEquals( true, preg_match( '!^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$!', $id ), "UID $id has the right format" ); + } + } + /** + * @covers UIDGenerator::newRawUUIDv4 + */ + public function testRawUUIDv4() { + for ( $i = 0; $i < 100; $i++ ) { $id = UIDGenerator::newRawUUIDv4(); $this->assertEquals( true, preg_match( '!^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ), "UID $id has the right format" ); + } + } + /** + * @covers UIDGenerator::newRawUUIDv4 + */ + public function testRawUUIDv4QuickRand() { + for ( $i = 0; $i < 100; $i++ ) { $id = UIDGenerator::newRawUUIDv4( UIDGenerator::QUICK_RAND ); $this->assertEquals( true, preg_match( '!^[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15}$!', $id ), "UID $id has the right format" ); } } + } -- cgit v1.2.3-54-g00ecf