You are here

public function OverridesSectionStorageTest::providerTestExtractIdFromRoute in Drupal 8

Provides data for ::testExtractIdFromRoute().

File

core/modules/layout_builder/tests/src/Unit/OverridesSectionStorageTest.php, line 92

Class

OverridesSectionStorageTest
@coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage

Namespace

Drupal\Tests\layout_builder\Unit

Code

public function providerTestExtractIdFromRoute() {
  $data = [];
  $data['with value, with layout'] = [
    'my_entity_type.entity_with_layout',
    'my_entity_type.entity_with_layout',
    [],
  ];
  $data['with value, without layout'] = [
    NULL,
    'my_entity_type',
    [],
  ];
  $data['empty value, populated defaults'] = [
    'my_entity_type.entity_with_layout',
    '',
    [
      'entity_type_id' => 'my_entity_type',
      'my_entity_type' => 'entity_with_layout',
    ],
  ];
  $data['empty value, empty defaults'] = [
    NULL,
    '',
    [],
  ];
  return $data;
}