You are here

public function MenuLinkParentTest::providerMenuLinkParent in Drupal 9

Provides data for testMenuLinkParent().

File

core/modules/migrate/tests/src/Unit/process/MenuLinkParentTest.php, line 160

Class

MenuLinkParentTest
Tests the menu link parent process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function providerMenuLinkParent() {
  return [
    'menu link is route item' => [
      'source_value' => [
        0,
        NULL,
        NULL,
      ],
      'lookup_result' => NULL,
      'plugin_id' => NULL,
      'route_name' => NULL,
      'expected_result' => '',
    ],
    'parent id exists' => [
      'source_value' => [
        1,
        NULL,
        NULL,
      ],
      'lookup_result' => 1,
      'plugin_id' => 'menu_link_content:abc',
      'route_name' => NULL,
      'expected_result' => 'menu_link_content:abc',
    ],
    'no parent id internal route' => [
      'source_value' => [
        20,
        'admin',
        'admin/content',
      ],
      'lookup_result' => NULL,
      'plugin_id' => 'system.admin_structure',
      'route_name' => 'system.admin_content',
      'expected_result' => 'system.admin_structure',
    ],
    'external' => [
      'source_value' => [
        9054,
        'admin',
        'http://example.com',
      ],
      'lookup_result' => 9054,
      'plugin_id' => 'menu_link_content:fe151460-dfa2-4133-8864-c1746f28ab27',
      'route_name' => NULL,
      'expected_result' => 'menu_link_content:fe151460-dfa2-4133-8864-c1746f28ab27',
    ],
  ];
}