1 | <?php |
||
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 |