title: Fix flaky TitlePermissionTest::testUserBlock
authorTimo Tijhof <krinklemail@gmail.com>
Sun, 25 Aug 2019 15:04:19 +0000 (16:04 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sun, 25 Aug 2019 15:04:19 +0000 (16:04 +0100)
commitb9f19780422322a8e6ff9195b6458af2f6d7f2dd
tree0b30e858c3a7338d5678e483954b7c537c33ac35
parent41355718e137b2ed88160ad5ddb4db50336d54d9
title: Fix flaky TitlePermissionTest::testUserBlock

The mock timestamp is asserted via $prev, which is set a few lines
up.

The input timestamp is set as 0, which usually passes (if these two
lines execute in the same second), but when the two lines of code
are on opposite sides of a clock second boundary, the test would
fail.

Instead of fixing the setTimestamp() call, remove it in favour of
fixing the 'timestamp' option instead, which was needlessly
being set to one thing and then overwritten by setTimestamp.

Bug: T231166
Change-Id: If6a1e4ec7b91efee0a43e6dd86794f15c5a440b3
tests/phpunit/includes/TitlePermissionTest.php