Merge "Test ApiUserrights"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiStashEditTest.php
1 <?php
2
3 /**
4 * @covers ApiStashEdit
5 * @group API
6 * @group medium
7 * @group Database
8 */
9 class ApiStashEditTest extends ApiTestCase {
10
11 public function testBasicEdit() {
12 $apiResult = $this->doApiRequestWithToken(
13 [
14 'action' => 'stashedit',
15 'title' => 'ApistashEdit_Page',
16 'contentmodel' => 'wikitext',
17 'contentformat' => 'text/x-wiki',
18 'text' => 'Text for ' . __METHOD__ . ' page',
19 'baserevid' => 0,
20 ]
21 );
22 $apiResult = $apiResult[0];
23 $this->assertArrayHasKey( 'stashedit', $apiResult );
24 $this->assertEquals( 'stashed', $apiResult['stashedit']['status'] );
25 }
26
27 }