summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/api/ApiBaseTest.php
blob: a05c4fa83114212129efcb56781ab504407a1598 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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"
		);
	}

}