You are here

public function WebformArrayHelperTest::providerToString in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Unit/Utility/WebformArrayHelperTest.php \Drupal\Tests\webform\Unit\Utility\WebformArrayHelperTest::providerToString()

Data provider for testToString().

See also

testToString()

File

tests/src/Unit/Utility/WebformArrayHelperTest.php, line 41

Class

WebformArrayHelperTest
Tests webform array utility.

Namespace

Drupal\Tests\webform\Unit\Utility

Code

public function providerToString() {
  $tests[] = [
    [
      'Jack',
      'Jill',
    ],
    'and',
    'Jack and Jill',
  ];
  $tests[] = [
    [
      'Jack',
      'Jill',
    ],
    'or',
    'Jack or Jill',
  ];
  $tests[] = [
    [
      'Jack',
      'Jill',
      'Bill',
    ],
    'and',
    'Jack, Jill, and Bill',
  ];
  $tests[] = [
    [
      '',
    ],
    'and',
    '',
    'WebformArrayHelper::toString with no one',
  ];
  $tests[] = [
    [
      'Jack',
    ],
    'and',
    'Jack',
  ];
  return $tests;
}