You are here

public function UnicodeTest::providerStrpos in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::providerStrpos()

Data provider for testStrpos().

Return value

array An array containing:

  • The haystack string to be searched in.
  • The needle string to search for.
  • The offset integer to start at.
  • The expected integer/FALSE result.

See also

testStrpos()

File

core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php, line 560
Contains \Drupal\Tests\Component\Utility\UnicodeTest.

Class

UnicodeTest
Test unicode handling features implemented in Unicode component.

Namespace

Drupal\Tests\Component\Utility

Code

public function providerStrpos() {
  return array(
    array(
      'frànçAIS is über-åwesome',
      'frànçAIS is über-åwesome',
      0,
      0,
    ),
    array(
      'frànçAIS is über-åwesome',
      'rànçAIS is über-åwesome',
      0,
      1,
    ),
    array(
      'frànçAIS is über-åwesome',
      'not in string',
      0,
      FALSE,
    ),
    array(
      'frànçAIS is über-åwesome',
      'r',
      0,
      1,
    ),
    array(
      'frànçAIS is über-åwesome',
      'nçAIS',
      0,
      3,
    ),
    array(
      'frànçAIS is über-åwesome',
      'nçAIS',
      2,
      3,
    ),
    array(
      'frànçAIS is über-åwesome',
      'nçAIS',
      3,
      3,
    ),
    array(
      '以呂波耳・ほへとち。リヌルヲ。',
      '波耳',
      0,
      2,
    ),
    array(
      '以呂波耳・ほへとち。リヌルヲ。',
      '波耳',
      1,
      2,
    ),
    array(
      '以呂波耳・ほへとち。リヌルヲ。',
      '波耳',
      2,
      2,
    ),
  );
}