Passed
Push — master ( 48b31c...af15c0 )
by Louis
02:02
created

ClientTest::unsupportedMethodProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace EtherpadLite\Tests;
4
5
use EtherpadLite\Client;
6
use PHPUnit\Framework\TestCase;
7
8
class ClientTest extends TestCase
9
{
10
    const API_KEY = 'T6UnYqgl19';
11
12
    /**
13
     * @expectedException \EtherpadLite\Exception\UnsupportedMethodException
14
     * @dataProvider unsupportedMethodProvider
15
     */
16
    public function testUnsupportedMethods($method)
17
    {
18
        $client = new Client(self::API_KEY);
19
        $client->$method();
20
    }
21
22
    public function unsupportedMethodProvider()
23
    {
24
        return array(
25
            array('listMyImportantPad'),
26
            array('getPad'),
27
            array('setPadName')
28
        );
29
    }
30
31
    public function testGeneratePadID()
32
    {
33
        $client = new Client(self::API_KEY);
34
        $padId = $client->generatePadID();
35
36
        $this->assertTrue(is_string($padId));
37
        $this->assertEquals(16,strlen($padId));
38
    }
39
}
40