public function MapArrayTest::testCopyValuesToKey

Tests MapArray::copyValuesToKey() input against expected output.

@dataProvider providerCopyValuesToKey

Parameters

array $input: The input array for the MapArray::copyValuesToKey() method.

array $expected: The expected output from calling the method.

callable $callable: The optional callable.

See also

Drupal\Component\Utility\MapArray::copyValuesToKey()

Drupal\Tests\Component\Utility\MapArrayTest::providerCopyValuesToKey()

File

drupal/core/tests/Drupal/Tests/Component/Utility/MapArrayTest.php, line 43
Contains \Drupal\Tests\Component\Utility\MapArrayTest.

Class

MapArrayTest
Tests the MapArray system.

Namespace

Drupal\Tests\Component\Utility

Code

public function testCopyValuesToKey(array $input, array $expected, $callable = NULL) {
  $output = MapArray::copyValuesToKeys($input, $callable);
  $this
    ->assertEquals($expected, $output);
}