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)
committerdaniel <daniel.kinzler@wikimedia.de>
Wed, 18 Apr 2018 19:47:57 +0000 (21:47 +0200)
commit040d5b25525a9a9c8fd27d8dca7fe1b7452cf05b
tree2e6cef8ec6678929280992e020e7cb61e21279ed
parentcb20bab28c37cd84f6489e13fe51d4632885e9df
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
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