MergeHistory: Fix flaky test due to relative timestamp
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 15 Aug 2018 00:11:43 +0000 (01:11 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 15 Aug 2018 01:16:02 +0000 (02:16 +0100)
commit4c9fd032403c1656d07a76e3bee0a1ce088d136d
tree1c54f89449d73e5749aefaa2140ebc006914a9d5
parent0a0d5cb7f7cd4479a7e8954d90422e6dda33d349
MergeHistory: Fix flaky test due to relative timestamp

In PHP, `strtotime('tomorrow')` evaluates to the first midnight
after the current time.

Which means on Aug 14 at 23:59:59, strtotime('tomorrow') refers
to a timestamp merely 1 second in the future (Aug 15 00:00:00).

This causes the test to fail because this timestamp is computed
in a data provider, before the test itself starts. In order to
pass, it needs to be far enough in the future that it will also
be after the point in time where the test creates the page and
revisions in question.

Fix this by:
* ... moving it into the test itself, where even plain time()
      should probably suffice, but that's for another time.

* ... using +24*3600 instead of strtotime().

Bug: T201976
Change-Id: Ice5d54af4fb7cffa8db9b657796ba6ebecdaffa0
tests/phpunit/includes/MergeHistoryTest.php