Fix handling of ar_length and ar_sha1 in RevisionArchiveRecord.
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 17 Apr 2018 16:51:38 +0000 (18:51 +0200)
committerKrinkle <krinklemail@gmail.com>
Tue, 24 Apr 2018 15:58:51 +0000 (15:58 +0000)
commitcad9b7ca365c4be4cde27c7cd4dc708abe37b61d
treee9579e3f95d285795b117a3a70bceac2bb74f41e
parent18b4aee3df0e52a5cf908cb533dabf7b5982cc78
Fix handling of ar_length and ar_sha1 in RevisionArchiveRecord.

This makes sure that length and hash are calculated if not known.

This patch also adds missing unit tests for RevisionArchiveRecord,
and consolidates unit tests for the different RevisionRecord
subclasses using a trait.

Bug: T192189
Change-Id: I5e1d17ba96e61e068b6aa5ac9c45ac0f657905a6
(cherry picked from commit 040d5b25525a9a9c8fd27d8dca7fe1b7452cf05b)
includes/Storage/RevisionArchiveRecord.php
includes/Storage/RevisionStoreRecord.php
tests/common/TestsAutoLoader.php
tests/phpunit/includes/Storage/MutableRevisionRecordTest.php
tests/phpunit/includes/Storage/RevisionArchiveRecordTest.php [new file with mode: 0644]
tests/phpunit/includes/Storage/RevisionRecordTests.php [new file with mode: 0644]
tests/phpunit/includes/Storage/RevisionStoreRecordTest.php