MediaWiki  master
IPTest Class Reference

Tests for IP validity functions. More...

Inheritance diagram for IPTest:
Collaboration diagram for IPTest:

Public Member Functions

 isNotIPAddress ($val, $desc)
 IP::isIPAddress provideInvalidIPs. More...
 
 provideInvalidIPs ()
 Provide a list of things that aren't IP addresses. More...
 
 provideInvalidIPv4Addresses ()
 
 provideInvalidRanges ()
 
 provideIPsandHexes ()
 Provide some IP addresses and their equivalent hex representations. More...
 
 provideOctetsAndHexes ()
 Provide some hex and octet representations of the same IPs. More...
 
 provideValidIPv4Address ()
 Provide some IPv4 addresses and ranges. More...
 
 provideValidRanges ()
 Provide some valid IP ranges. More...
 
 testCIDRParsing ()
 IP::parseCIDR() returns an array containing a signed IP address representing the network mask and the bit mask. More...
 
 testCombineHostAndPort ($expected, $input, $description)
 IP::combineHostAndPort() provideCombineHostAndPort. More...
 
 testHexToOctet ($octet, $hex)
 IP::hexToOctet provideOctetsAndHexes. More...
 
 testHexToQuad ($ip, $hex)
 IP::hexToQuad provideIPsAndHexes. More...
 
 testInvalidIPs ()
 IP::isValid. More...
 
 testInvalidRanges ($invalid)
 IP::isValidRange provideInvalidRanges. More...
 
 testIPCanonicalizeMappedAddress ()
 IP::canonicalize. More...
 
 testIPCanonicalizeOnValidIp ()
 IP::canonicalize. More...
 
 testIPIsInRange ($expected, $addr, $range, $message= '')
 Issues there are most probably from IP::toHex() or IP::parseRange() IP::isInRange provideIPsAndRanges. More...
 
 testisIPAddress ()
 IP::isIPAddress. More...
 
 testIsIPv4 ($ip, $desc)
 IP::isIPv4 provideValidIPv4Address. More...
 
 testisIPv6 ()
 IP::isIPv6. More...
 
 testisNotIPv4 ($bogusIP, $desc)
 IP::isIPv4 provideInvalidIPv4Addresses. More...
 
 testIsPublic ($expected, $input)
 IP::isPublic provideIsPublic. More...
 
 testPrettifyIP ($ip, $prettified)
 IP::prettifyIP() provideIPsToPrettify. More...
 
 testSanitizeIP ($expected, $input)
 IP::sanitizeIP provideSanitizeIP. More...
 
 testSanitizeRange ($input, $expected, $description)
 IP::sanitizeRange() provideIPCIDRs. More...
 
 testSplitHostAndPort ($expected, $input, $description)
 IP::splitHostAndPort() provideSplitHostAndPort. More...
 
 testToHex ($expected, $input)
 IP::toHex provideToHex. More...
 
 testValidIPs ()
 IP::isValid. More...
 
 testValidRanges ($range)
 IP::isValidRange provideValidRanges. More...
 

Static Public Member Functions

static provideCombineHostAndPort ()
 Provider for IP::combineHostAndPort() More...
 
static provideIPCIDRs ()
 Provider for IP::testSanitizeRange() More...
 
static provideIPsAndRanges ()
 Provider for testIPIsInRange() More...
 
static provideIPsToPrettify ()
 Provider for IP::testPrettifyIP() More...
 
static provideIsPublic ()
 Provider for IP::testIsPublic() More...
 
static provideSanitizeIP ()
 Provider for IP::testSanitizeIP() More...
 
static provideSplitHostAndPort ()
 Provider for IP::splitHostAndPort() More...
 
static provideToHex ()
 Provider for IP::testToHex() More...
 

Private Member Functions

 assertFalseCIDR ($CIDR, $msg= '')
 
 assertNet ($expected, $CIDR)
 

Detailed Description

Tests for IP validity functions.

Ported from /t/inc/IP.t by avar.

IP

Todo:
Test methods in this call should be split into a method and a dataprovider.

Definition at line 12 of file IPTest.php.

Member Function Documentation

IPTest::assertFalseCIDR (   $CIDR,
  $msg = '' 
)
private

Definition at line 404 of file IPTest.php.

References false, and IP\parseCIDR().

Referenced by testCIDRParsing().

IPTest::assertNet (   $expected,
  $CIDR 
)
private

Definition at line 410 of file IPTest.php.

References IP\parseCIDR().

Referenced by testCIDRParsing().

IPTest::isNotIPAddress (   $val,
  $desc 
)

IP::isIPAddress provideInvalidIPs.

Definition at line 20 of file IPTest.php.

References IP\isIPAddress().

static IPTest::provideCombineHostAndPort ( )
static

Provider for IP::combineHostAndPort()

Definition at line 608 of file IPTest.php.

IPTest::provideInvalidIPs ( )

Provide a list of things that aren't IP addresses.

Definition at line 27 of file IPTest.php.

IPTest::provideInvalidIPv4Addresses ( )

Definition at line 127 of file IPTest.php.

IPTest::provideInvalidRanges ( )

Definition at line 295 of file IPTest.php.

static IPTest::provideIPCIDRs ( )
static

Provider for IP::testSanitizeRange()

Definition at line 628 of file IPTest.php.

IPTest::provideIPsandHexes ( )

Provide some IP addresses and their equivalent hex representations.

Definition at line 426 of file IPTest.php.

static IPTest::provideIPsAndRanges ( )
static

Provider for testIPIsInRange()

Definition at line 539 of file IPTest.php.

static IPTest::provideIPsToPrettify ( )
static

Provider for IP::testPrettifyIP()

Definition at line 652 of file IPTest.php.

static IPTest::provideIsPublic ( )
static

Provider for IP::testIsPublic()

Definition at line 386 of file IPTest.php.

References link.

IPTest::provideOctetsAndHexes ( )

Provide some hex and octet representations of the same IPs.

Definition at line 451 of file IPTest.php.

static IPTest::provideSanitizeIP ( )
static

Provider for IP::testSanitizeIP()

Definition at line 324 of file IPTest.php.

static IPTest::provideSplitHostAndPort ( )
static

Provider for IP::splitHostAndPort()

Definition at line 577 of file IPTest.php.

References false.

static IPTest::provideToHex ( )
static

Provider for IP::testToHex()

Definition at line 356 of file IPTest.php.

IPTest::provideValidIPv4Address ( )

Provide some IPv4 addresses and ranges.

Definition at line 151 of file IPTest.php.

IPTest::provideValidRanges ( )

Provide some valid IP ranges.

Definition at line 262 of file IPTest.php.

IPTest::testCIDRParsing ( )

IP::parseCIDR() returns an array containing a signed IP address representing the network mask and the bit mask.

IP::parseCIDR

Definition at line 473 of file IPTest.php.

References assertFalseCIDR(), assertNet(), and IP\parseCIDR().

IPTest::testCombineHostAndPort (   $expected,
  $input,
  $description 
)

IP::combineHostAndPort() provideCombineHostAndPort.

Definition at line 597 of file IPTest.php.

References $input, IP\combineHostAndPort(), and list.

IPTest::testHexToOctet (   $octet,
  $hex 
)

IP::hexToOctet provideOctetsAndHexes.

Definition at line 444 of file IPTest.php.

References IP\hexToOctet().

IPTest::testHexToQuad (   $ip,
  $hex 
)

IP::hexToQuad provideIPsAndHexes.

Definition at line 419 of file IPTest.php.

References IP\hexToQuad().

IPTest::testInvalidIPs ( )

IP::isValid.

Definition at line 212 of file IPTest.php.

References as, and IP\isValid().

IPTest::testInvalidRanges (   $invalid)

IP::isValidRange provideInvalidRanges.

Definition at line 291 of file IPTest.php.

References IP\isValidRange().

IPTest::testIPCanonicalizeMappedAddress ( )

IP::canonicalize.

Definition at line 514 of file IPTest.php.

References IP\canonicalize().

IPTest::testIPCanonicalizeOnValidIp ( )

IP::canonicalize.

Definition at line 506 of file IPTest.php.

References IP\canonicalize().

IPTest::testIPIsInRange (   $expected,
  $addr,
  $range,
  $message = '' 
)

Issues there are most probably from IP::toHex() or IP::parseRange() IP::isInRange provideIPsAndRanges.

Definition at line 530 of file IPTest.php.

References IP\isInRange().

IPTest::testisIPAddress ( )

IP::isIPAddress.

Definition at line 47 of file IPTest.php.

References as, and IP\isIPAddress().

IPTest::testIsIPv4 (   $ip,
  $desc 
)

IP::isIPv4 provideValidIPv4Address.

Definition at line 144 of file IPTest.php.

References IP\isIPv4().

IPTest::testisIPv6 ( )

IP::isIPv6.

Definition at line 64 of file IPTest.php.

References IP\isIPv6().

IPTest::testisNotIPv4 (   $bogusIP,
  $desc 
)

IP::isIPv4 provideInvalidIPv4Addresses.

Definition at line 123 of file IPTest.php.

References IP\isIPv4().

IPTest::testIsPublic (   $expected,
  $input 
)

IP::isPublic provideIsPublic.

Definition at line 378 of file IPTest.php.

References $input, and IP\isPublic().

IPTest::testPrettifyIP (   $ip,
  $prettified 
)

IP::prettifyIP() provideIPsToPrettify.

Definition at line 645 of file IPTest.php.

References IP\prettifyIP().

IPTest::testSanitizeIP (   $expected,
  $input 
)

IP::sanitizeIP provideSanitizeIP.

Definition at line 316 of file IPTest.php.

References $input, and IP\sanitizeIP().

IPTest::testSanitizeRange (   $input,
  $expected,
  $description 
)

IP::sanitizeRange() provideIPCIDRs.

Definition at line 621 of file IPTest.php.

References $input, and IP\sanitizeRange().

IPTest::testSplitHostAndPort (   $expected,
  $input,
  $description 
)

IP::splitHostAndPort() provideSplitHostAndPort.

Definition at line 570 of file IPTest.php.

References $input, and IP\splitHostAndPort().

IPTest::testToHex (   $expected,
  $input 
)

IP::toHex provideToHex.

Definition at line 347 of file IPTest.php.

References $input, and IP\toHex().

IPTest::testValidIPs ( )

IP::isValid.

Definition at line 162 of file IPTest.php.

References as, and IP\isValid().

IPTest::testValidRanges (   $range)

IP::isValidRange provideValidRanges.

Definition at line 283 of file IPTest.php.

References IP\isValidRange().


The documentation for this class was generated from the following file: