From 6fe1e2e24827f5fbe0c44a46ab8d5ed891985813 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 16 Jun 2016 22:25:58 +0200 Subject: [PATCH] test: basic test for ApiStashEdit At least execute the main entry point. Change-Id: I0788c9a7bf93b5365f4e510dff4e11fe6ffa3558 --- .../phpunit/includes/api/ApiStashEditTest.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/phpunit/includes/api/ApiStashEditTest.php diff --git a/tests/phpunit/includes/api/ApiStashEditTest.php b/tests/phpunit/includes/api/ApiStashEditTest.php new file mode 100644 index 0000000000..e2462c6138 --- /dev/null +++ b/tests/phpunit/includes/api/ApiStashEditTest.php @@ -0,0 +1,28 @@ +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'] ); + } + +} -- 2.20.1