Data provider for MapArray::copyValuesToKey().
array An array of tests, matching the parameter inputs for testCopyValuesToKey.
Drupal\Component\Utility\MapArray::copyValuesToKey()
Drupal\Tests\Component\Utility\MapArrayTest::testCopyValuesToKey()
public function providerCopyValuesToKey() {
// Test an empty array.
$tests[] = array(
array(),
array(),
);
// Tests the creation of an associative array.
$tests[] = array(
array(
'foobar',
),
array(
'foobar' => 'foobar',
),
);
// Tests overwriting indexes with their value.
$tests[] = array(
array(
'foo' => 'bar',
),
array(
'bar' => 'bar',
),
);
// Tests using the callback function.
$tests[] = array(
array(
1,
2,
3,
4,
5,
),
array(
1 => 2,
2 => 4,
3 => 6,
4 => 8,
5 => 10,
),
'Drupal\\Tests\\Component\\Utility\\MapArrayTest::providerCopyValuesToKeyCallback',
);
return $tests;
}