You are here

public function ArrayPopTest::arrayPopDataProvider in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Unit/process/ArrayPopTest.php \Drupal\Tests\migrate_plus\Unit\process\ArrayPopTest::arrayPopDataProvider()

Data provider for testArrayPop().

Return value

array An array containing input values and expected output values.

File

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

Class

ArrayPopTest
Tests the array pop process plugin.

Namespace

Drupal\Tests\migrate_plus\Unit\process

Code

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