Page MenuHomeWickedGov Phorge

RevertedTagUpdateManagerTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

RevertedTagUpdateManagerTest.php

<?php
namespace MediaWiki\Tests\Storage;
use JobQueueGroup;
use MediaWiki\Storage\EditResult;
use MediaWiki\Storage\EditResultCache;
use MediaWiki\Storage\RevertedTagUpdateManager;
use MediaWikiUnitTestCase;
/**
* @covers \MediaWiki\Storage\RevertedTagUpdateManager
*
* @see RevertedTagUpdateIntegrationTest for integration tests
*/
class RevertedTagUpdateManagerTest extends MediaWikiUnitTestCase {
public function testApproveRevertedTagForRevision() {
$revisionId = 123;
$editResult = $this->createMock( EditResult::class );
$editResultCache = $this->createMock( EditResultCache::class );
$editResultCache->expects( $this->once() )
->method( 'get' )
->with( $revisionId )
->willReturn( $editResult );
$jobQueueGroup = $this->createMock( JobQueueGroup::class );
$jobQueueGroup->expects( $this->once() )
->method( 'lazyPush' );
$manager = new RevertedTagUpdateManager(
$editResultCache,
$jobQueueGroup
);
$this->assertTrue(
$manager->approveRevertedTagForRevision( $revisionId ),
'The operation is successful'
);
}
public function testApproveRevertedTagForRevision_missingEditResult() {
$revisionId = 123;
$editResultCache = $this->createMock( EditResultCache::class );
$editResultCache->expects( $this->once() )
->method( 'get' )
->with( $revisionId )
->willReturn( null );
$jobQueueGroup = $this->createNoOpMock( JobQueueGroup::class );
$manager = new RevertedTagUpdateManager(
$editResultCache,
$jobQueueGroup
);
$this->assertFalse(
$manager->approveRevertedTagForRevision( $revisionId ),
'The operation is not successful'
);
}
}

File Metadata

Mime Type
text/x-php
Expires
Aug 19 2026, 16:32 (4 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9d/36/9c772a6d3524c1541e58d53b3a24
Default Alt Text
RevertedTagUpdateManagerTest.php (1 KB)

Event Timeline