aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/ApiTestCase.php
diff options
context:
space:
mode:
authorAryeh Gregor <ayg@aryeh.name>2018-07-24 17:50:03 +0300
committerAryeh Gregor <ayg@aryeh.name>2018-07-29 12:47:45 +0300
commit05d78a6c7108c8ea85792ef0b34f44297c5adb67 (patch)
tree1c08d448d7c799c6938db12eecdcaaf328d32701 /tests/phpunit/includes/api/ApiTestCase.php
parent7a206823e36c834b2dca44a7ea06b8a1451c26a6 (diff)
downloadmediawikicore-05d78a6c7108c8ea85792ef0b34f44297c5adb67.tar.gz
mediawikicore-05d78a6c7108c8ea85792ef0b34f44297c5adb67.zip
Move utility methods from ApiTestCase to MediaWikiTestCase
Change-Id: I79c4e37092958c63a693194b27a9eafae70cb2f8
Diffstat (limited to 'tests/phpunit/includes/api/ApiTestCase.php')
-rw-r--r--tests/phpunit/includes/api/ApiTestCase.php37
1 files changed, 0 insertions, 37 deletions
diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php
index a5ee7ddb8c9f..0fce35abeceb 100644
--- a/tests/phpunit/includes/api/ApiTestCase.php
+++ b/tests/phpunit/includes/api/ApiTestCase.php
@@ -42,43 +42,6 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
}
/**
- * Edits or creates a page/revision
- * @param string $pageName Page title
- * @param string $text Content of the page
- * @param string $summary Optional summary string for the revision
- * @param int $defaultNs Optional namespace id
- * @return array Array as returned by WikiPage::doEditContent()
- */
- protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) {
- $title = Title::newFromText( $pageName, $defaultNs );
- $page = WikiPage::factory( $title );
-
- return $page->doEditContent( ContentHandler::makeContent( $text, $title ), $summary );
- }
-
- /**
- * Revision-deletes a revision.
- *
- * @param Revision|int $rev Revision to delete
- * @param array $value Keys are Revision::DELETED_* flags. Values are 1 to set the bit, 0 to
- * clear, -1 to leave alone. (All other values also clear the bit.)
- * @param string $comment Deletion comment
- */
- protected function revisionDelete(
- $rev, array $value = [ Revision::DELETED_TEXT => 1 ], $comment = ''
- ) {
- if ( is_int( $rev ) ) {
- $rev = Revision::newFromId( $rev );
- }
- RevisionDeleter::createList(
- 'revision', RequestContext::getMain(), $rev->getTitle(), [ $rev->getId() ]
- )->setVisibility( [
- 'value' => $value,
- 'comment' => $comment,
- ] );
- }
-
- /**
* Does the API request and returns the result.
*
* The returned value is an array containing