Completed
Push — master ( 8b4718...61d59f )
by Oleg
02:27
created

ExceptionTest::testCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 13
nc 1
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace OptimizelyPHPTest;
3
4
use PHPUnit_Framework_TestCase;
5
use WebMarketingROI\OptimizelyPHP\Exception;
6
7
class ExceptionTest extends PHPUnit_Framework_TestCase
8
{
9
    public function testCreate()
10
    {
11
        $exception = new Exception('Error', -2, array(
12
            'http_code' => 400,
13
            'uuid' => '232342342342424',
14
            'rate_limit' => 100,
15
            'rate_limit_remaining' => 98,
16
            'rate_limit_reset' => 123456789
17
        ));
18
        
19
        $this->assertEquals(-2, $exception->getCode());
20
        $this->assertEquals(400, $exception->getHttpCode());
21
        $this->assertEquals('232342342342424', $exception->getUuid());
22
        $this->assertEquals(100, $exception->getRateLimit());
23
        $this->assertEquals(98, $exception->getRateLimitRemaining());
24
        $this->assertEquals(123456789, $exception->getRateLimitReset());
25
    }    
26
}
27
28
29