wiki.techinc.nl/tests/phpunit/includes/api/ApiStashEditTest.php
Antoine Musso 6fe1e2e248 test: basic test for ApiStashEdit
At least execute the main entry point.

Change-Id: I0788c9a7bf93b5365f4e510dff4e11fe6ffa3558
2016-06-16 22:26:24 +02:00

28 lines
621 B
PHP

<?php
/**
* @covers ApiStashEdit
* @group API
* @group medium
* @group Database
*/
class ApiStashEditTest extends ApiTestCase {
public function testBasicEdit() {
$this->doLogin();
$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'] );
}
}