You are here

public function ProviderManagerTest::optionsWithExpectedProviders in Video Embed Field 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/ProviderManagerTest.php \Drupal\Tests\video_embed_field\Unit\ProviderManagerTest::optionsWithExpectedProviders()

A data provider for user input with expected filtered providers.

Return value

array An array of test cases.

File

tests/src/Unit/ProviderManagerTest.php, line 62

Class

ProviderManagerTest
Tests the provider manager is working.

Namespace

Drupal\Tests\video_embed_field\Unit

Code

public function optionsWithExpectedProviders() {
  return [
    'Empty input: all providers' => [
      [],
      $this->mockProviders,
    ],
    'Empty checkbox input: all providers' => [
      [
        'provider_a' => '0',
        'provider_b' => '0',
        'provider_c' => '0',
      ],
      $this->mockProviders,
    ],
    'Some providers' => [
      [
        'provider_a' => '0',
        'provider_b' => 'provider_b',
        'provider_c' => 'provider_c',
      ],
      [
        'provider_b' => $this->mockProviders['provider_b'],
        'provider_c' => $this->mockProviders['provider_c'],
      ],
    ],
    'One provider' => [
      [
        'provider_a' => 'provider_a',
        'provider_b' => '0',
        'provider_c' => '0',
      ],
      [
        'provider_a' => $this->mockProviders['provider_a'],
      ],
    ],
  ];
}