Merge "Fix use of GenderCache in ApiPageSet::processTitlesArray"
[lhc/web/wiklou.git] / tests / phpunit / unit / includes / libs / filebackend / filejournal / NullFileJournalTest.php
1 <?php
2
3 /**
4 * @coversDefaultClass NullFileJournal
5 */
6 class NullFileJournalTest extends MediaWikiUnitTestCase {
7 public function newObj() : NullFileJournal {
8 return FileJournal::factory( [ 'class' => NullFileJournal::class ], '' );
9 }
10
11 /**
12 * @covers ::doLogChangeBatch
13 */
14 public function testLogChangeBatch() {
15 $this->assertEquals( StatusValue::newGood(), $this->newObj()->logChangeBatch( [ 1 ], '' ) );
16 }
17
18 /**
19 * @covers ::doGetCurrentPosition
20 */
21 public function testGetCurrentPosition() {
22 $this->assertFalse( $this->newObj()->getCurrentPosition() );
23 }
24
25 /**
26 * @covers ::doGetPositionAtTime
27 */
28 public function testGetPositionAtTime() {
29 $this->assertFalse( $this->newObj()->getPositionAtTime( 2 ) );
30 }
31
32 /**
33 * @covers ::doGetChangeEntries
34 */
35 public function testGetChangeEntries() {
36 $next = 1;
37 $entries = $this->newObj()->getChangeEntries( null, 0, $next );
38 $this->assertSame( [], $entries );
39 $this->assertNull( $next );
40 }
41
42 /**
43 * @covers ::doPurgeOldLogs
44 */
45 public function testPurgeOldLogs() {
46 $this->assertEquals( StatusValue::newGood(), $this->newObj()->purgeOldLogs() );
47 }
48 }