summaryrefslogtreecommitdiff
path: root/www/wiki/tests/phpunit/includes/api/ApiStashEditTest.php
blob: 60cda090300abb4a2622342a71eff5c6cbf32cb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?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'] );
	}

}