Completed
Push — master ( d991f2...2b3b24 )
by Julián
04:04
created

OptionIntTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 24
rs 10
1
<?php
2
3
/*
4
 * A PSR7 aware cURL client (https://github.com/juliangut/spiral).
5
 *
6
 * @license BSD-3-Clause
7
 * @link https://github.com/juliangut/spiral
8
 * @author Julián Gutiérrez <[email protected]>
9
 */
10
11
namespace Jgut\Spiral\Tests\Option;
12
13
use Jgut\Spiral\Option\OptionInt;
14
15
/**
16
 * Integer option tests.
17
 */
18
class OptionIntTest extends \PHPUnit_Framework_TestCase
19
{
20
    public function testAccessors()
21
    {
22
        $option = new OptionInt(CURLOPT_PORT);
23
24
        static::assertEquals(CURLOPT_PORT, $option->getOption());
25
        static::assertEquals(0, $option->getValue());
26
27
        $option->setValue(1);
28
        static::assertEquals(1, $option->getValue());
29
30
        $option->setValue(-10);
31
        static::assertEquals(0, $option->getValue());
32
33
        $option->setMin(20);
34
        $option->setValue(10);
35
        static::assertEquals(20, $option->getValue());
36
37
        $option->setMax(10);
38
        $option->setValue(20);
39
        static::assertEquals(10, $option->getValue());
40
    }
41
}
42