summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/api/ApiBaseTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/api/ApiBaseTest.php')
-rw-r--r--tests/phpunit/includes/api/ApiBaseTest.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/phpunit/includes/api/ApiBaseTest.php b/tests/phpunit/includes/api/ApiBaseTest.php
new file mode 100644
index 00000000..a05c4fa8
--- /dev/null
+++ b/tests/phpunit/includes/api/ApiBaseTest.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @group API
+ * @group Database
+ * @group medium
+ */
+class ApiBaseTest extends ApiTestCase {
+
+ /**
+ * @covers ApiBase::requireOnlyOneParameter
+ */
+ public function testRequireOnlyOneParameterDefault() {
+ $mock = new MockApi();
+ $mock->requireOnlyOneParameter(
+ array( "filename" => "foo.txt", "enablechunks" => false ),
+ "filename", "enablechunks"
+ );
+ $this->assertTrue( true );
+ }
+
+ /**
+ * @expectedException UsageException
+ * @covers ApiBase::requireOnlyOneParameter
+ */
+ public function testRequireOnlyOneParameterZero() {
+ $mock = new MockApi();
+ $mock->requireOnlyOneParameter(
+ array( "filename" => "foo.txt", "enablechunks" => 0 ),
+ "filename", "enablechunks"
+ );
+ }
+
+ /**
+ * @expectedException UsageException
+ * @covers ApiBase::requireOnlyOneParameter
+ */
+ public function testRequireOnlyOneParameterTrue() {
+ $mock = new MockApi();
+ $mock->requireOnlyOneParameter(
+ array( "filename" => "foo.txt", "enablechunks" => true ),
+ "filename", "enablechunks"
+ );
+ }
+
+}