You are here

public function GateTest::gateProvider in Migrate Plus 8.5

Row and plugin configuration for tests.

Return value

array

File

tests/src/Unit/process/GateTest.php, line 48

Class

GateTest
Tests the gate process plugin.

Namespace

Drupal\Tests\migrate_plus\Unit\process

Code

public function gateProvider() {
  return [
    'Gate does not unlock' => [
      [
        'state_abbr' => 'MO',
        'source_data' => 'Let me through!',
      ],
      NULL,
      [
        'source' => 'source_data',
        'use_as_key' => 'state_abbr',
        'valid_keys' => 'CO',
        'key_direction' => 'unlock',
      ],
      'Processing of destination property destinationproperty was skipped: Gate was not unlocked by property state_abbr with value MO.',
    ],
    'Gate unlocks (with valid_keys array)' => [
      [
        'state_abbr' => 'Colorado',
        'source_data' => 'Let me through!',
      ],
      NULL,
      [
        'source' => 'source_data',
        'use_as_key' => 'state_abbr',
        'valid_keys' => [
          'CO',
          'Colorado',
        ],
        'key_direction' => 'unlock',
      ],
      NULL,
    ],
    'Gate locks' => [
      [
        'state_abbr' => 'CO',
        'source_data' => 'Let me through!',
      ],
      NULL,
      [
        'source' => 'source_data',
        'use_as_key' => 'state_abbr',
        'valid_keys' => 'CO',
        'key_direction' => 'lock',
      ],
      'Processing of destination property destinationproperty was skipped: Gate was locked by property state_abbr with value CO.',
    ],
    'Gate stays unlocked' => [
      [
        'state_abbr' => 'MO',
        'source_data' => 'Let me through!',
      ],
      NULL,
      [
        'source' => 'source_data',
        'use_as_key' => 'state_abbr',
        'valid_keys' => 'CO',
        'key_direction' => 'lock',
      ],
      NULL,
    ],
    'Destination prop does not unlock gate' => [
      [
        'source_data' => 'Let me through!',
      ],
      [
        'state_abbr' => 'MO',
      ],
      [
        'source' => 'source_data',
        'use_as_key' => '@state_abbr',
        'valid_keys' => 'CO',
        'key_direction' => 'unlock',
      ],
      'Processing of destination property destinationproperty was skipped: Gate was not unlocked by property @state_abbr with value MO.',
    ],
    'Destination prop unlocks gate' => [
      [
        'source_data' => 'Let me through!',
      ],
      [
        'state_abbr' => 'CO',
      ],
      [
        'source' => 'source_data',
        'use_as_key' => '@state_abbr',
        'valid_keys' => 'CO',
        'key_direction' => 'unlock',
      ],
      NULL,
    ],
    'Destination prop locks gate' => [
      [
        'source_data' => 'Let me through!',
      ],
      [
        'state_abbr' => 'CO',
      ],
      [
        'source' => 'source_data',
        'use_as_key' => '@state_abbr',
        'valid_keys' => 'CO',
        'key_direction' => 'lock',
      ],
      'Processing of destination property destinationproperty was skipped: Gate was locked by property @state_abbr with value CO.',
    ],
    'Gate stays unlocked with destination prop' => [
      [
        'source_data' => 'Let me through!',
      ],
      [
        'state_abbr' => 'MO',
      ],
      [
        'source' => 'source_data',
        'use_as_key' => '@state_abbr',
        'valid_keys' => 'CO',
        'key_direction' => 'lock',
      ],
      NULL,
    ],
  ];
}