test() 공개 메소드

public test ( $value )
예제 #1
0
 public function testIpv4Type()
 {
     $ipv4 = new Ipv4Type();
     ok($ipv4->test('192.168.25.58'));
     ok($ipv4->test('8.8.8.8'));
     $this->assertFalse($ipv4->test('2607:f0d0:1002:51::4'));
 }
예제 #2
0
 /**
  * @dataProvider ipV4Provider
  */
 public function testIpv4Type($ipstr, $pass = true)
 {
     $ipv4 = new Ipv4Type();
     $this->assertEquals($pass, $ipv4->test($ipstr));
     if ($pass) {
         $this->assertNotNull($ipv4->parse($ipstr));
     }
 }