wiki.techinc.nl/tests/phpunit/includes/api/ApiStashEditTest.php
Aryeh Gregor ed40e8ec53 Get rid of ApiTestCase::doLogin
The function is entirely unnecessary.

Change-Id: I805520e5355119e872e602d0bfc93be26f227128
2018-04-11 20:17:52 +03:00

27 lines
601 B
PHP

<?php
/**
* @covers ApiStashEdit
* @group API
* @group medium
* @group Database
*/
class ApiStashEditTest extends ApiTestCase {
public function testBasicEdit() {
$apiResult = $this->doApiRequestWithToken(
[
'action' => 'stashedit',
'title' => 'ApistashEdit_Page',
'contentmodel' => 'wikitext',
'contentformat' => 'text/x-wiki',
'text' => 'Text for ' . __METHOD__ . ' page',
'baserevid' => 0,
]
);
$apiResult = $apiResult[0];
$this->assertArrayHasKey( 'stashedit', $apiResult );
$this->assertEquals( 'stashed', $apiResult['stashedit']['status'] );
}
}