You are here

public function SqlBaseTest::sqlBaseTestProvider in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/tests/src/Unit/SqlBaseTest.php \Drupal\Tests\migrate\Unit\SqlBaseTest::sqlBaseTestProvider()

The data provider for SqlBase.

Return value

array An array of data per test run.

File

core/modules/migrate/tests/src/Unit/SqlBaseTest.php, line 86
Contains \Drupal\Tests\migrate\Unit\SqlBaseTest.

Class

SqlBaseTest
Tests the SqlBase class.

Namespace

Drupal\Tests\migrate\Unit

Code

public function sqlBaseTestProvider() {
  return [
    // Source ids are empty so mapJoinable() is false.
    [
      FALSE,
      FALSE,
      FALSE,
    ],
    // Still false because getIdMap() is not a subclass of Sql.
    [
      FALSE,
      FALSE,
      TRUE,
    ],
    // Test mapJoinable() returns false when source and id connection options
    // differ.
    [
      FALSE,
      TRUE,
      TRUE,
      [
        'username' => 'different_from_map',
        'password' => 'different_from_map',
      ],
      [
        'username' => 'different_from_source',
        'password' => 'different_from_source',
      ],
    ],
    // Returns true because source and id map connection options are the same.
    [
      TRUE,
      TRUE,
      TRUE,
      [
        'username' => 'same_value',
        'password' => 'same_value',
      ],
      [
        'username' => 'same_value',
        'password' => 'same_value',
      ],
    ],
  ];
}