[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RevisionIntegrationTest for newFromPageId

2017-10-16 Thread jenkins-bot (Code Review)
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 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RevisionIntegrationTest for newFromPageId

2017-10-14 Thread Addshore (Code Review)
Addshore has uploaded a new change for review. ( 
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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/12/384212/1

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: newchange
Gerrit-Change-Id: I09cf5fcbacab662e30acda1687ebcfe6b29f1900
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits