*/
public function testFetchRevision() {
$page = $this->createPage( 'RevisionStorageTest_testFetchRevision', 'one', CONTENT_MODEL_WIKITEXT );
- $id1 = $page->getRevision()->getId();
+
+ // Hidden process cache assertion below
+ $page->getRevision()->getId();
$page->doEditContent( new WikitextContent( 'two' ), 'second rev' );
- $id2 = $page->getRevision()->getId();
+ $id = $page->getRevision()->getId();
$res = Revision::fetchRevision( $page->getTitle() );
$rows[$row->rev_id] = $row;
}
- $row = $res->fetchObject();
$this->assertEquals( 1, count( $rows ), 'expected exactly one revision' );
- $this->assertArrayHasKey( $id2, $rows, 'missing revision with id ' . $id2 );
+ $this->assertArrayHasKey( $id, $rows, 'missing revision with id ' . $id );
}
/**
}
$page = $this->createPage( $title, $text, $model );
- $hasLinks = wfGetDB( DB_SLAVE )->selectField( 'pagelinks', 1,
- array( 'pl_from' => $page->getId() ), __METHOD__ );
$editInfo = $page->prepareContentForEdit( $page->getContent() );
$prevYear = $curYear - 1;
$curMonth = intval( gmdate( 'n' ) );
- $prevMonth = $curMonth - 1;
- if ( $prevMonth == 0 ) {
- $prevMonth = 12;
- }
+
$nextMonth = $curMonth + 1;
if ( $nextMonth == 13 ) {
$nextMonth = 1;
$rpage->doEditContent( new WikitextContent( "#REDIRECT [[$name]]" ),
"testing 1", EDIT_NEW, false, self::$users['sysop']->user );
$this->forceRevisionDate( $rpage, '20120101000000' );
- $baseTime = $rpage->getRevision()->getTimestamp();
// new edit to content
$page->doEditContent( new WikitextContent( "Foo bar" ),
return pow( $mean - $x, 2 );
}, $this->points ) ) / ( count( $rstat ) - 1 );
$stddev = sqrt( $variance );
- $min = min( $this->points );
- $max = max( $this->points );
$this->assertEquals( count( $rstat ), count( $this->points ) );
$this->assertEquals( $rstat->min, min( $this->points ) );
$fork &= !$this->cache instanceof MultiWriteBagOStuff;
if ( $fork ) {
// callback should take awhile now so that we can test concurrent merge attempts
- $usleep = 5000;
-
$pid = pcntl_fork();
if ( $pid == -1 ) {
// can't fork, ignore this test...
$this->deleteFile( 'UploadFromUrlTest.png' );
- $talkRev = Revision::newFromTitle( $talk );
- $talkSize = $talkRev->getSize();
-
$exception = false;
try {
$this->doApiRequest( array(
return;
/*
// Broken until using leavemessage with ignorewarnings is supported
+ $talkRev = Revision::newFromTitle( $talk );
+ $talkSize = $talkRev->getSize();
+
$job->run();
$this->assertFalse( wfLocalFile( 'UploadFromUrlTest.png' )->exists() );
}
$lastId = array_shift( $ids );
- if ( $hostbits ) {
- $lastHost = substr( wfBaseConvert( $lastId, 10, 2, $bits ), -$hostbits );
- }
$this->assertArrayEquals( array_unique( $ids ), $ids, "All generated IDs are unique." );