function testMatchWildCard() { $obj = new IpAccess('192.168.1.101'); $obj->allowedIps = array('192.168.1.*'); $this->assertEquals($obj->matchWildCard(), '192.168.1.*'); $obj->setIp('192.168.2.101'); $this->assertEmpty($obj->matchWildCard()); $obj->setIp('190.168.1.101'); $this->assertEmpty($obj->matchWildCard()); $obj = new IpAccess('192.168.2.2'); $obj->allowedIps = array('192.168.*'); $this->assertEquals($obj->matchWildCard(), '192.168.*'); $obj->allowedIps = array('192.167.*'); $this->assertNull($obj->matchWildCard()); $obj->allowedIps = array('192.*'); $this->assertEquals($obj->matchWildCard(), '192.*'); $obj->allowedIps = array('10.*'); $this->assertNull($obj->matchWildCard()); }