You are here

public function ConfigMapperManagerTest::providerTestHasTranslatable in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php \Drupal\Tests\config_translation\Unit\ConfigMapperManagerTest::providerTestHasTranslatable()
  2. 10 core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php \Drupal\Tests\config_translation\Unit\ConfigMapperManagerTest::providerTestHasTranslatable()

Provides data for ConfigMapperManager::testHasTranslatable()

Return value

array An array of arrays, where each inner array contains the schema element to test as the first key and the expected result of ConfigMapperManager::hasTranslatable() as the second key.

File

core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php, line 85

Class

ConfigMapperManagerTest
Tests the functionality provided by configuration translation mapper manager.

Namespace

Drupal\Tests\config_translation\Unit

Code

public function providerTestHasTranslatable() {
  return [
    [
      $this
        ->getElement([]),
      FALSE,
    ],
    [
      $this
        ->getElement([
        'aaa' => 'bbb',
      ]),
      FALSE,
    ],
    [
      $this
        ->getElement([
        'translatable' => FALSE,
      ]),
      FALSE,
    ],
    [
      $this
        ->getElement([
        'translatable' => TRUE,
      ]),
      TRUE,
    ],
    [
      $this
        ->getNestedElement([
        $this
          ->getElement([]),
      ]),
      FALSE,
    ],
    [
      $this
        ->getNestedElement([
        $this
          ->getElement([
          'translatable' => TRUE,
        ]),
      ]),
      TRUE,
    ],
    [
      $this
        ->getNestedElement([
        $this
          ->getElement([
          'aaa' => 'bbb',
        ]),
        $this
          ->getElement([
          'ccc' => 'ddd',
        ]),
        $this
          ->getElement([
          'eee' => 'fff',
        ]),
      ]),
      FALSE,
    ],
    [
      $this
        ->getNestedElement([
        $this
          ->getElement([
          'aaa' => 'bbb',
        ]),
        $this
          ->getElement([
          'ccc' => 'ddd',
        ]),
        $this
          ->getElement([
          'translatable' => TRUE,
        ]),
      ]),
      TRUE,
    ],
    [
      $this
        ->getNestedElement([
        $this
          ->getElement([
          'aaa' => 'bbb',
        ]),
        $this
          ->getNestedElement([
          $this
            ->getElement([
            'ccc' => 'ddd',
          ]),
          $this
            ->getElement([
            'eee' => 'fff',
          ]),
        ]),
        $this
          ->getNestedElement([
          $this
            ->getElement([
            'ggg' => 'hhh',
          ]),
          $this
            ->getElement([
            'iii' => 'jjj',
          ]),
        ]),
      ]),
      FALSE,
    ],
    [
      $this
        ->getNestedElement([
        $this
          ->getElement([
          'aaa' => 'bbb',
        ]),
        $this
          ->getNestedElement([
          $this
            ->getElement([
            'ccc' => 'ddd',
          ]),
          $this
            ->getElement([
            'eee' => 'fff',
          ]),
        ]),
        $this
          ->getNestedElement([
          $this
            ->getElement([
            'ggg' => 'hhh',
          ]),
          $this
            ->getElement([
            'translatable' => TRUE,
          ]),
        ]),
      ]),
      TRUE,
    ],
  ];
}