You are here

public function ExternalAuthTest::registerDataProvider in External Authentication 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/ExternalAuthTest.php \Drupal\Tests\externalauth\Unit\ExternalAuthTest::registerDataProvider()

Provides test data for testRegister.

Return value

array Parameters

File

tests/src/Unit/ExternalAuthTest.php, line 223

Class

ExternalAuthTest
ExternalAuth unit tests.

Namespace

Drupal\Tests\externalauth\Unit

Code

public function registerDataProvider() {
  return [
    // Test basic registration.
    [
      [
        'authname' => 'test_authname',
        'provider' => 'test_provider',
        'account_data' => [],
        'authmap_data' => NULL,
      ],
      [
        'username' => 'test_provider-test_authname',
        'authname' => 'test_authname',
        'timezone' => 'Europe/Brussels',
        'data' => [],
      ],
    ],
    // Test with added account data.
    [
      [
        'authname' => 'test_authname',
        'provider' => 'test_provider',
        'account_data' => [
          'timezone' => 'Europe/Prague',
        ],
        'authmap_data' => NULL,
      ],
      [
        'username' => 'test_provider-test_authname',
        'authname' => 'test_authname',
        'timezone' => 'Europe/Prague',
        'data' => [],
      ],
    ],
    // Test with added authmap data.
    [
      [
        'authname' => 'test_authname',
        'provider' => 'test_provider',
        'account_data' => [],
        'authmap_data' => [
          'extra_property' => 'extra',
        ],
      ],
      [
        'username' => 'test_provider-test_authname',
        'authname' => 'test_authname',
        'timezone' => 'Europe/Brussels',
        'data' => [
          'extra_property' => 'extra',
        ],
      ],
    ],
  ];
}