RequestTest::testInvalidPage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace Thunder\SimilarWebApi\Tests;
3
4
use Thunder\SimilarWebApi\Request\KeywordsOrganicSearch;
5
use Thunder\SimilarWebApi\Request\MobileApp;
6
use Thunder\SimilarWebApi\Request\Traffic;
7
use Thunder\SimilarWebApi\Request\TrafficPro;
8
use Thunder\SimilarWebApi\Tests\Dummy\SampleRequest;
9
10
/**
11
 * @author Tomasz Kowalczyk <[email protected]>
12
 */
13
class RequestTest extends \PHPUnit_Framework_TestCase
14
    {
15
    public function testInvalidDomain()
16
        {
17
        $this->setExpectedException('InvalidArgumentException');
18
        new Traffic('');
19
        }
20
21
    public function testInvalidApp()
22
        {
23
        $this->setExpectedException('InvalidArgumentException');
24
        new MobileApp(0, '');
25
        }
26
27
    public function testInvalidAppStore()
28
        {
29
        $this->setExpectedException('InvalidArgumentException');
30
        new MobileApp('invalid', 'app.id');
31
        }
32
33
    public function testInvalidStart()
34
        {
35
        $this->setExpectedException('InvalidArgumentException');
36
        new TrafficPro('example.com', 'weekly', 'invalid', '10-2014', true);
37
        }
38
39
    public function testInvalidEnd()
40
        {
41
        $this->setExpectedException('InvalidArgumentException');
42
        new TrafficPro('example.com', 'weekly', '09-2014', 'invalid', true);
43
        }
44
45
    public function testInvalidPeriod()
46
        {
47
        $this->setExpectedException('InvalidArgumentException');
48
        new TrafficPro('example.com', 'invalid', '09-2014', '10-2014', true);
49
        }
50
51
    public function testInvalidPage()
52
        {
53
        $this->setExpectedException('InvalidArgumentException');
54
        new KeywordsOrganicSearch('example.com', '09-2014', '10-2014', true, 'invalid');
55
        }
56
57
    public function testInvalidArg()
58
        {
59
        $this->setExpectedException('InvalidArgumentException');
60
        new SampleRequest();
61
        }
62
    }
63