3 namespace MediaWiki\Tests\Maintenance
;
12 class PageExistsTest
extends MaintenanceBaseTestCase
{
14 protected function getMaintenanceClass() {
15 return PageExists
::class;
18 public function testExecuteForNonExistingPage() {
19 $nonExistentTestPage = $this->getNonexistingTestPage();
20 $this->maintenance
->setArg( 'title', $nonExistentTestPage );
21 $this->maintenance
->execute();
22 $this->expectOutputString(
23 "$nonExistentTestPage doesn't exist.\n"
27 public function testExecuteForExistingPage() {
28 $existingTestPage = $this->getExistingTestPage();
29 $this->maintenance
->setArg( 'title', $existingTestPage );
30 $this->maintenance
->execute();
31 $this->expectOutputString(
32 "$existingTestPage exists.\n"