| Total Complexity | 7 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | class IPFuscatorTest extends TestCase |
||
| 15 | { |
||
| 16 | public $ip = '127.0.0.1'; |
||
| 17 | |||
| 18 | public function testCanBeUsedWithValidIp() |
||
| 19 | { |
||
| 20 | $this->assertIsString( |
||
| 21 | IPFuscator::class, |
||
| 22 | IPFuscator::getDecimal($this->ip) |
||
| 23 | ); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function testCanBeUsedWithInvalidIp() |
||
| 27 | { |
||
| 28 | $this->expectException(InvalidArgument::class); |
||
| 29 | IPFuscator::getDecimal('in.va.lid.ip'); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function testCanBeValidDecimal() |
||
| 33 | { |
||
| 34 | $this->assertEquals( |
||
| 35 | '2130706433', |
||
| 36 | IPFuscator::getDecimal($this->ip) |
||
| 37 | ); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function testCanBeValidHexadecimal() |
||
| 41 | { |
||
| 42 | $this->assertEquals( |
||
| 43 | '0x7f000001', |
||
| 44 | IPFuscator::getHexadecimal($this->ip) |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function testCanBeValidOctal() |
||
| 53 | ); |
||
| 54 | } |
||
| 55 | |||
| 56 | public function testCanBeValidFullHex() |
||
| 57 | { |
||
| 61 | ); |
||
| 62 | } |
||
| 63 | |||
| 64 | public function testCanBeValidFullOct() |
||
| 71 | } |