Fix UID test and make debugging easier
authorMatthew Flaschen <mflaschen@wikimedia.org>
Tue, 5 Apr 2016 00:16:40 +0000 (20:16 -0400)
committerMatthew Flaschen <mflaschen@wikimedia.org>
Tue, 5 Apr 2016 22:52:14 +0000 (18:52 -0400)
commitaef78d13d4d17071554c0d905bc353dfd78125fd
tree5fdc0a685f2ed9babdcdc717e8ed627c366e11e2
parent84abebcd939e6bf121228653c19aa8189d18fb5b
Fix UID test and make debugging easier

This should fix the test and make the test failures (if any)
more informative.

The issue was that it was trying to extract a 46-bit segment
(the timestamp).  But because the whole thing wasn't 0-padded first,
the timestamp might be shorter.  So it would extract part of the next
segment too.  That meant it was testing a 46-bit segment with no
guaranteed properties, with arbitrary results.

Bug: T131549
Change-Id: I11c9e86951cc1d6b186710cda6e42ee58c920db8
tests/phpunit/includes/utils/UIDGeneratorTest.php