You are here

public function IpFieldValidationRuleTest::ipValidProvider in Field Validation 8

Data provider for valid ip by version.

Return value

array Returns the dataset.

File

tests/src/Kernel/Plugin/FieldValidationRule/IpFieldValidationRuleTest.php, line 163

Class

IpFieldValidationRuleTest
Tests IpFieldValidationRule.

Namespace

Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRule

Code

public function ipValidProvider() {
  return [
    'ipv4-1' => [
      '4',
      '192.168.1.1',
    ],
    'ipv6-1' => [
      '6',
      '1200:0000:AB00:1234:0000:2552:7777:1313',
    ],
    'ipv6-2' => [
      '6',
      '21DA:D3:0:2F3B:2AA:FF:FE28:9C5A',
    ],
    'ipv6-3' => [
      '6',
      '21DA:D3::2F3B:2AA:FF:FE28:9C5A',
    ],
    'ipv6-4' => [
      '6',
      '2001:3452:4952:2837::',
    ],
    'ipv4-no-priv-1' => [
      '4_no_priv',
      '171.0.1.10',
    ],
    'ipv6-no-priv-1' => [
      '6_no_priv',
      '3731:54:65fe:2::a7',
    ],
    'all-1' => [
      'all',
      '192.168.1.1',
    ],
    'all-2' => [
      'all',
      'fd57:5e8d:962e:5ee5::',
    ],
    'all-3' => [
      'all',
      '3731:54:65fe:2::a7',
    ],
    'all-1-no-private' => [
      'all_no_priv',
      '171.0.1.10',
    ],
    'all-2-no-private' => [
      'all_no_priv',
      '3731:54:65fe:2::a7',
    ],
    'all-1-no-reserved' => [
      'all_no_res',
      '3731:54:65fe:2::a7',
    ],
    'all-2-no-reserved' => [
      'all_no_res',
      '171.0.1.10',
    ],
    'all-1-public' => [
      'all_public',
      '171.0.1.10',
    ],
    'all-2-public' => [
      'all_public',
      '3731:54:65fe:2::a7',
    ],
    'ipv4-no-reserved' => [
      '4_no_res',
      '171.0.1.10',
    ],
    'ipv6-no-reserved' => [
      '6_no_res',
      '3731:54:65fe:2::a7',
    ],
    'ipv4-public' => [
      '4_public',
      '171.0.1.10',
    ],
    'ipv6-public' => [
      '6_public',
      '3731:54:65fe:2::a7',
    ],
  ];
}