You are here

protected function AccessFilterResrictionTestCase::assertIpAddressMatching in Access Filter 7

Check IP address matching works correctly.

Parameters

string $pattern: A string of pattern.

string $ip: A string of IP address.

bool $status: Boolean of desired result.

Return value

bool TRUE if the assertion succeeded, FALSE otherwise.

1 call to AccessFilterResrictionTestCase::assertIpAddressMatching()
AccessFilterResrictionTestCase::testIpAddressMatching in ./access_filter.test
Test IP address matching functions.

File

./access_filter.test, line 141
Tests for access_filter.module

Class

AccessFilterResrictionTestCase

Code

protected function assertIpAddressMatching($pattern, $ip, $status = TRUE) {
  return $this
    ->assert($status == access_filter_ip_match($pattern, $ip), format_string('IP address %ip is' . ($status ? '' : ' not') . ' matched to %pattern', array(
    '%ip' => $ip,
    '%pattern' => $pattern,
  )));
}