| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | class IPv4AddressTest extends DefinitionTest |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @expectedException InvalidArgumentException |
||
| 15 | */ |
||
| 16 | public function testEmptyDefinition() |
||
| 17 | { |
||
| 18 | $this->_definition = new \Whitelist\Definition\IPv4Address(''); |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @expectedException InvalidArgumentException |
||
| 23 | */ |
||
| 24 | public function testValidate() |
||
| 25 | { |
||
| 26 | $this->_definition = new \Whitelist\Definition\IPv4Address('not.an.ipv4.address'); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @dataProvider provider |
||
| 31 | */ |
||
| 32 | public function testMatch($expected, $address) |
||
| 33 | { |
||
| 34 | $this->_definition = new \Whitelist\Definition\IPv4Address('192.168.1.1'); |
||
| 35 | $this->assertEquals($expected, $this->_definition->match($address)); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function provider() |
||
| 43 | ); |
||
| 44 | } |
||
| 45 | |||
| 46 | } |
||
| 47 |