jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/384212 )
Change subject: RevisionIntegrationTest for newFromPageId ...................................................................... RevisionIntegrationTest for newFromPageId Change-Id: I09cf5fcbacab662e30acda1687ebcfe6b29f1900 --- M tests/phpunit/includes/RevisionIntegrationTest.php 1 file changed, 40 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/tests/phpunit/includes/RevisionIntegrationTest.php b/tests/phpunit/includes/RevisionIntegrationTest.php index 5d96abf..4904f02 100644 --- a/tests/phpunit/includes/RevisionIntegrationTest.php +++ b/tests/phpunit/includes/RevisionIntegrationTest.php @@ -261,6 +261,46 @@ } /** + * @covers Revision::newFromPageId + */ + public function testNewFromPageId() { + $rev = Revision::newFromPageId( $this->testPage->getId() ); + $this->assertRevEquals( + $this->testPage->getRevision(), + $rev + ); + } + + /** + * @covers Revision::newFromPageId + */ + public function testNewFromPageIdWithLatestId() { + $rev = Revision::newFromPageId( + $this->testPage->getId(), + $this->testPage->getLatest() + ); + $this->assertRevEquals( + $this->testPage->getRevision(), + $rev + ); + } + + /** + * @covers Revision::newFromPageId + */ + public function testNewFromPageIdWithNotLatestId() { + $this->testPage->doEditContent( new WikitextContent( __METHOD__ ), __METHOD__ ); + $rev = Revision::newFromPageId( + $this->testPage->getId(), + $this->testPage->getRevision()->getPrevious()->getId() + ); + $this->assertRevEquals( + $this->testPage->getRevision()->getPrevious(), + $rev + ); + } + + /** * @covers Revision::fetchRevision */ public function testFetchRevision() { -- To view, visit https://gerrit.wikimedia.org/r/384212 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09cf5fcbacab662e30acda1687ebcfe6b29f1900 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Legoktm <lego...@member.fsf.org> Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits