You are here

public function ArrayShiftTest::arrayShiftDataProvider in Migrate Plus 8.5

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/process/ArrayShiftTest.php \Drupal\Tests\migrate_plus\Unit\process\ArrayShiftTest::arrayShiftDataProvider()

Data provider for testArrayShift().

Return value

array An array containing input values and expected output values.

File

tests/src/Unit/process/ArrayShiftTest.php, line 31

Class

ArrayShiftTest
Tests the array shift process plugin.

Namespace

Drupal\Tests\migrate_plus\Unit\process

Code

public function arrayShiftDataProvider() : array {
  return [
    'indexed array' => [
      'input' => [
        'v1',
        'v2',
        'v3',
      ],
      'expected_output' => 'v1',
    ],
    'associative array' => [
      'input' => [
        'i1' => 'v1',
        'i2' => 'v2',
        'i3' => 'v3',
      ],
      'expected_output' => 'v1',
    ],
    'empty array' => [
      'input' => [],
      'expected_output' => NULL,
    ],
  ];
}