jenkins-bot has submitted this change and it was merged.
Change subject: Test UUID get*() to create() roundtrip
......................................................................
Test UUID get*() to create() roundtrip
Change-Id: Ifa2a7d8706fdab8c8259ebb60bde3b33af4d0c69
---
M tests/phpunit/Model/UUIDTest.php
1 file changed, 44 insertions(+), 0 deletions(-)
Approvals:
Sbisson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/phpunit/Model/UUIDTest.php b/tests/phpunit/Model/UUIDTest.php
index ec9ca3b..2235e6e 100644
--- a/tests/phpunit/Model/UUIDTest.php
+++ b/tests/phpunit/Model/UUIDTest.php
@@ -159,4 +159,48 @@
public function testCreateLowNumber() {
$this->assertEquals( UUID::create( 10 )->getAlphadecimal(),
'000000000000000a' );
}
+
+ public static function uuidProvider()
+ {
+ return array(
+ array( UUID::create() ),
+ array( UUID::getComparisonUUID( 1 ) ),
+ );
+ }
+
+ /**
+ * @dataProvider uuidProvider
+ * @param UUID $uuid
+ */
+ public function testAlphadecimalRoundtrip( UUID $uuid )
+ {
+ $expect = $uuid->getAlphadecimal();
+ $new = UUID::create( $expect );
+
+ $this->assertEquals( $expect, $new->getAlphadecimal() );
+ }
+
+ /**
+ * @dataProvider uuidProvider
+ * @param UUID $uuid
+ */
+ public function testHexRoundtrip( UUID $uuid )
+ {
+ $expect = $uuid->getHex();
+ $new = UUID::create( $expect );
+
+ $this->assertEquals( $expect, $new->getHex() );
+ }
+
+ /**
+ * @dataProvider uuidProvider
+ * @param UUID $uuid
+ */
+ public function testBinaryRoundtrip( UUID $uuid )
+ {
+ $expect = $uuid->getBinary();
+ $new = UUID::create( $expect );
+
+ $this->assertEquals( $expect->fetch(),
$new->getBinary()->fetch() );
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/270959
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa2a7d8706fdab8c8259ebb60bde3b33af4d0c69
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits