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

Static Public Member Functions

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

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

◆ assertFalseCIDR()

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

Definition at line 401 of file IPTest.php.

References false.

Referenced by testCIDRParsing().

◆ assertNet()

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

Definition at line 407 of file IPTest.php.

Referenced by testCIDRParsing().

◆ isNotIPAddress()

IPTest::isNotIPAddress ( $val,
$desc )

IP::isIPAddress provideInvalidIPs.

Definition at line 17 of file IPTest.php.

◆ provideCombineHostAndPort()

static IPTest::provideCombineHostAndPort ( )
static

Provider for IP::combineHostAndPort()

Definition at line 605 of file IPTest.php.

◆ provideInvalidIPs()

IPTest::provideInvalidIPs ( )

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

Definition at line 24 of file IPTest.php.

◆ provideInvalidIPv4Addresses()

IPTest::provideInvalidIPv4Addresses ( )

Definition at line 124 of file IPTest.php.

◆ provideInvalidRanges()

IPTest::provideInvalidRanges ( )

Definition at line 292 of file IPTest.php.

◆ provideIPCIDRs()

static IPTest::provideIPCIDRs ( )
static

Provider for IP::testSanitizeRange()

Definition at line 625 of file IPTest.php.

◆ provideIPsandHexes()

IPTest::provideIPsandHexes ( )

Provide some IP addresses and their equivalent hex representations.

Definition at line 423 of file IPTest.php.

◆ provideIPsAndRanges()

static IPTest::provideIPsAndRanges ( )
static

Provider for testIPIsInRange()

Definition at line 536 of file IPTest.php.

◆ provideIPsToPrettify()

static IPTest::provideIPsToPrettify ( )
static

Provider for IP::testPrettifyIP()

Definition at line 649 of file IPTest.php.

◆ provideIsPublic()

static IPTest::provideIsPublic ( )
static

Provider for IP::testIsPublic()

Definition at line 383 of file IPTest.php.

◆ provideOctetsAndHexes()

IPTest::provideOctetsAndHexes ( )

Provide some hex and octet representations of the same IPs.

Definition at line 448 of file IPTest.php.

◆ provideSanitizeIP()

static IPTest::provideSanitizeIP ( )
static

Provider for IP::testSanitizeIP()

Definition at line 321 of file IPTest.php.

◆ provideSplitHostAndPort()

static IPTest::provideSplitHostAndPort ( )
static

Provider for IP::splitHostAndPort()

Definition at line 574 of file IPTest.php.

References false.

◆ provideToHex()

static IPTest::provideToHex ( )
static

Provider for IP::testToHex()

Definition at line 353 of file IPTest.php.

◆ provideValidIPv4Address()

IPTest::provideValidIPv4Address ( )

Provide some IPv4 addresses and ranges.

Definition at line 148 of file IPTest.php.

◆ provideValidRanges()

IPTest::provideValidRanges ( )

Provide some valid IP ranges.

Definition at line 259 of file IPTest.php.

◆ testCIDRParsing()

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 470 of file IPTest.php.

References assertFalseCIDR(), and assertNet().

◆ testCombineHostAndPort()

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

Test for IP::combineHostAndPort() provideCombineHostAndPort.

Definition at line 594 of file IPTest.php.

References $input, and list.

◆ testHexToOctet()

IPTest::testHexToOctet ( $octet,
$hex )

IP::hexToOctet provideOctetsAndHexes.

Definition at line 441 of file IPTest.php.

◆ testHexToQuad()

IPTest::testHexToQuad ( $ip,
$hex )

IP::hexToQuad provideIPsAndHexes.

Definition at line 416 of file IPTest.php.

◆ testInvalidIPs()

IPTest::testInvalidIPs ( )

IP::isValid.

Definition at line 209 of file IPTest.php.

◆ testInvalidRanges()

IPTest::testInvalidRanges ( $invalid)

IP::isValidRange provideInvalidRanges.

Definition at line 288 of file IPTest.php.

◆ testIPCanonicalizeMappedAddress()

IPTest::testIPCanonicalizeMappedAddress ( )

IP::canonicalize.

Definition at line 511 of file IPTest.php.

◆ testIPCanonicalizeOnValidIp()

IPTest::testIPCanonicalizeOnValidIp ( )

IP::canonicalize.

Definition at line 503 of file IPTest.php.

◆ testIPIsInRange()

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

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

Definition at line 527 of file IPTest.php.

◆ testisIPAddress()

IPTest::testisIPAddress ( )

IP::isIPAddress.

Definition at line 44 of file IPTest.php.

◆ testIsIPv4()

IPTest::testIsIPv4 ( $ip,
$desc )

IP::isIPv4 provideValidIPv4Address.

Definition at line 141 of file IPTest.php.

◆ testisIPv6()

IPTest::testisIPv6 ( )

IP::isIPv6.

Definition at line 61 of file IPTest.php.

◆ testisNotIPv4()

IPTest::testisNotIPv4 ( $bogusIP,
$desc )

IP::isIPv4 provideInvalidIPv4Addresses.

Definition at line 120 of file IPTest.php.

◆ testIsPublic()

IPTest::testIsPublic ( $expected,
$input )

IP::isPublic provideIsPublic.

Definition at line 375 of file IPTest.php.

References $input.

◆ testPrettifyIP()

IPTest::testPrettifyIP ( $ip,
$prettified )

Test for IP::prettifyIP() provideIPsToPrettify.

Definition at line 642 of file IPTest.php.

◆ testSanitizeIP()

IPTest::testSanitizeIP ( $expected,
$input )

IP::sanitizeIP provideSanitizeIP.

Definition at line 313 of file IPTest.php.

References $input.

◆ testSanitizeRange()

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

Test for IP::sanitizeRange() provideIPCIDRs.

Definition at line 618 of file IPTest.php.

References $input.

◆ testSplitHostAndPort()

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

Test for IP::splitHostAndPort().

provideSplitHostAndPort

Definition at line 567 of file IPTest.php.

References $input.

◆ testToHex()

IPTest::testToHex ( $expected,
$input )

IP::toHex provideToHex.

Definition at line 344 of file IPTest.php.

References $input.

◆ testValidIPs()

IPTest::testValidIPs ( )

IP::isValid.

Definition at line 159 of file IPTest.php.

◆ testValidRanges()

IPTest::testValidRanges ( $range)

IP::isValidRange provideValidRanges.

Definition at line 280 of file IPTest.php.


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