You are here

public function RestrictIpServiceTest::cleanIpAddressInputDataProvider in Restrict IP 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/Service/RestrictIpServiceTest.php \Drupal\Tests\restrict_ip\Unit\Service\RestrictIpServiceTest::cleanIpAddressInputDataProvider()
  2. 3.x tests/src/Unit/Service/RestrictIpServiceTest.php \Drupal\Tests\restrict_ip\Unit\Service\RestrictIpServiceTest::cleanIpAddressInputDataProvider()

* Data provider for testCleanIpAddressInput()

File

tests/src/Unit/Service/RestrictIpServiceTest.php, line 343

Class

RestrictIpServiceTest
@coversDefaultClass \Drupal\restrict_ip\Service\RestrictIpService @group restrict_ip

Namespace

Drupal\Tests\restrict_ip\Unit\Service

Code

public function cleanIpAddressInputDataProvider() {
  return [
    [
      '111.111.111.111
			111.111.111.112',
      [
        '111.111.111.111',
        '111.111.111.112',
      ],
      'Items properly parsed when separated by new lines',
    ],
    [
      '// This is a comment
			111.111.111.111',
      [
        '111.111.111.111',
      ],
      'Items properly parsed when comment starting with // exists',
    ],
    [
      '# This is a comment
			111.111.111.111',
      [
        '111.111.111.111',
      ],
      'Items properly parsed when comment starting with # exists',
    ],
    [
      '/**
			 *This is a comment
			 */
			111.111.111.111',
      [
        '111.111.111.111',
      ],
      'Items properly parsed when multiline comment exists',
    ],
  ];
}