Add tests for Revision::getTitle
This method is touched in I4f24e7fbb683cb51f3fd8b250732bae9c7541ba2 hence adding some test coverage now. Change-Id: Ie39a294546d84413bfb716efb27fd2c0321b349b
This commit is contained in:
parent
763546fea5
commit
858067fec3
1 changed files with 31 additions and 0 deletions
|
|
@ -1046,4 +1046,35 @@ class RevisionIntegrationTest extends MediaWikiTestCase {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Revision::getTitle
|
||||
*/
|
||||
public function testGetTitle_fromExistingRevision() {
|
||||
$this->assertTrue(
|
||||
$this->testPage->getTitle()->equals(
|
||||
$this->testPage->getRevision()->getTitle()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Revision::getTitle
|
||||
*/
|
||||
public function testGetTitle_fromRevisionWhichWillLoadTheTitle() {
|
||||
$rev = new Revision( [ 'id' => $this->testPage->getLatest() ] );
|
||||
$this->assertTrue(
|
||||
$this->testPage->getTitle()->equals(
|
||||
$rev->getTitle()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Revision::getTitle
|
||||
*/
|
||||
public function testGetTitle_forBadRevision() {
|
||||
$rev = new Revision( [] );
|
||||
$this->assertNull( $rev->getTitle() );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue