Refactor ApiTestCase to get token from ApiQueryTokens
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiUnblockTest.php
1 <?php
2
3 /**
4 * @group API
5 * @group Database
6 * @group medium
7 *
8 * @covers ApiUnblock
9 */
10 class ApiUnblockTest extends ApiTestCase {
11 protected function setUp() {
12 parent::setUp();
13 $this->doLogin();
14 }
15
16 /**
17 * @expectedException ApiUsageException
18 */
19 public function testWithNoToken() {
20 $this->doApiRequest(
21 [
22 'action' => 'unblock',
23 'user' => 'UTApiBlockee',
24 'reason' => 'Some reason',
25 ],
26 null,
27 false,
28 self::$users['sysop']->getUser()
29 );
30 }
31 }