Refactor ApiTestCase to get token from ApiQueryTokens
[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 $this->doLogin();
13 $apiResult = $this->doApiRequestWithToken(
14 [
15 'action' => 'stashedit',
16 'title' => 'ApistashEdit_Page',
17 'contentmodel' => 'wikitext',
18 'contentformat' => 'text/x-wiki',
19 'text' => 'Text for ' . __METHOD__ . ' page',
20 'baserevid' => 0,
21 ]
22 );
23 $apiResult = $apiResult[0];
24 $this->assertArrayHasKey( 'stashedit', $apiResult );
25 $this->assertEquals( 'stashed', $apiResult['stashedit']['status'] );
26 }
27
28 }