Exemplo n.º 1
0
 /**
  * CCValidator::ip tests
  */
 public function test_ip()
 {
     $validator = new CCValidator(array('ip1' => '127.0.0.1', 'ip2' => '127.0000.0.1', 'ip3' => '127.0.0.1.1', 'ip4' => '266.0.0.2', 'ip5' => '255.255.255.255'));
     $this->assertTrue($validator->ip('ip1'));
     $this->assertFalse($validator->not_ip('ip1'));
     $this->assertFalse($validator->ip('ip2'));
     $this->assertFalse($validator->ip('ip3'));
     $this->assertFalse($validator->ip('ip4'));
     $this->assertTrue($validator->ip('ip5'));
 }