Completed
Push — master ( f62226...8b6b73 )
by Stéphane
10s
created

ConfigurationTest::testSslVerify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of the bee4/httpclient package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 *
7
 * @copyright Bee4 2015
8
 * @author  Stephane HULARD <[email protected]>
9
 * @package Bee4\Test\Transport
10
 */
11
12
namespace Bee4\Test\Transport;
13
14
use Bee4\Transport\Configuration\Configuration;
15
16
/**
17
 * @package Bee4\Test\Transport
18
 */
19
class ConfigurationTest extends \PHPUnit_Framework_TestCase
20
{
21
    public function testDefaults()
22
    {
23
        $conf = new Configuration();
24
25
        $this->assertArrayHasKey('connect_timeout', $conf);
26
        $this->assertArrayHasKey('timeout', $conf);
27
        $this->assertArrayHasKey('verify', $conf);
28
        $this->assertArrayHasKey('url', $conf);
29
        $this->assertArrayHasKey('body', $conf);
30
        $this->assertArrayHasKey('method', $conf);
31
        $this->assertArrayHasKey('upload', $conf);
32
        $this->assertEquals('GET', $conf->method);
33
        $this->assertEquals(null, $conf->url);
34
        $this->assertEquals(null, $conf->body);
35
        $this->assertEquals(false, $conf->upload);
36
    }
37
38
    public function testTimeout()
39
    {
40
        $conf = new Configuration();
41
42
        $this->assertEquals(30, $conf->timeout);
43
        $conf->timeout = 120;
44
        $this->assertEquals(120, $conf->timeout);
45
    }
46
47
    public function testSslVerify()
48
    {
49
        $conf = new Configuration();
50
51
        $this->assertFalse($conf->verify);
52
        $conf->verify = true;
53
        $this->assertTrue($conf->verify);
54
    }
55
}
56