test: basic test for ApiStashEdit
authorAntoine Musso <hashar@free.fr>
Thu, 16 Jun 2016 20:25:58 +0000 (22:25 +0200)
committerAntoine Musso <hashar@free.fr>
Thu, 16 Jun 2016 20:26:24 +0000 (22:26 +0200)
At least execute the main entry point.

Change-Id: I0788c9a7bf93b5365f4e510dff4e11fe6ffa3558

tests/phpunit/includes/api/ApiStashEditTest.php [new file with mode: 0644]

diff --git a/tests/phpunit/includes/api/ApiStashEditTest.php b/tests/phpunit/includes/api/ApiStashEditTest.php
new file mode 100644 (file)
index 0000000..e2462c6
--- /dev/null
@@ -0,0 +1,28 @@
+<?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'] );
+       }
+
+}