Debian Codegraph @

tests/phpunit/maintenance/PageExistsTest.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Tests\Maintenance;
4
5 use PageExists;
6
7 /**
8 * @covers \PageExists
9 * @group Database
10 * @author Dreamy Jazz
11 */
12 class PageExistsTest extends MaintenanceBaseTestCase {
13
14 protected function getMaintenanceClass() {
15 return PageExists::class;
16 }
17
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"
24 );
25 }
26
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"
33 );
34 }
35 }