public function setUp() { $document = new MediaWikiDocument(new SimpleXMLElement($this->documentManyRevisionsXml)); $contributor = new MediaWikiContributor(json_decode($this->documentManyRevisionsUserJson, true)); $this->instance = new GitCommitFileRevision($document, 'foo/', '.html'); $revisionsList = $document->getRevisions(); for ($revisionsList->rewind(); $revisionsList->valid(); $revisionsList->next()) { $rev = $revisionsList->current(); $rev->setContributor($contributor, false); } $this->instance->setRevision($document->getLatest()); }
/** * @covers ::getLatest */ public function testLatestRevisionDateTime() { $obj = new MediaWikiDocument($this->dumpBackupXml->page[0]); $this->assertInstanceOf('\\DateTime', $obj->getLatest()->getTimestamp()); }