3 namespace MediaWiki\Tests\Maintenance
;
12 class DumpRevTest
extends MaintenanceBaseTestCase
{
14 protected function getMaintenanceClass() {
15 return DumpRev
::class;
18 public function testExecuteForMissingRevisionId() {
19 $this->maintenance
->setArg( 'rev-id', 123 );
20 $this->expectCallToFatalError();
21 $this->expectOutputRegex( '/Row not found/' );
22 $this->maintenance
->execute();
25 public function testExecute() {
26 $revId = $this->editPage( $this->getNonexistingTestPage(), 'testing1234' )->getNewRevision()->getId();
27 $this->maintenance
->setArg( 'rev-id', $revId );
28 $this->maintenance
->execute();
29 $this->expectOutputString( "Text length: 11\ntesting1234\n" );