You are here

public function MenuDependencyTest::menuDependenciesDataProvider in Dependency Calculation 8

Data provider for testMenuEntityDependencies.

Return value

array Test data sets consisting of entity values and a list of dependencies respectively.

File

tests/src/Kernel/EventSubscriber/DependencyCollector/MenuDependencyTest.php, line 117

Class

MenuDependencyTest
Class MenuDependencyTest.

Namespace

Drupal\Tests\depcalc\Kernel\EventSubscriber\DependencyCollector

Code

public function menuDependenciesDataProvider() {
  return [
    [
      // Stand alone menu link content entity.
      'menu_link_content',
      '6e452034-9a51-42c4-8c51-eda1be63d048',
      [
        'menu_link_content' => [
          [
            'uuid' => '6e452034-9a51-42c4-8c51-eda1be63d048',
            'title' => 'Test 1',
            'menu_name' => 'test',
            'link' => 'http://www.google.com',
            'external' => TRUE,
          ],
        ],
      ],
      [
        '38584be3-605a-47b1-8881-838e1424d0f9',
      ],
      [
        'menu_link_content',
        'system',
      ],
    ],
    // Menu with parent
    [
      'menu_link_content',
      '6e452034-9a51-42c4-8c51-eda1be63d047',
      [
        'menu_link_content' => [
          [
            'uuid' => '6e452034-9a51-42c4-8c51-eda1be63d048',
            'title' => 'Test 1',
            'menu_name' => 'test',
            'link' => 'http://www.google.com',
            'external' => TRUE,
          ],
          [
            'uuid' => '6e452034-9a51-42c4-8c51-eda1be63d047',
            'title' => 'Test 2',
            'menu_name' => 'test',
            'link' => 'http://www.yahoo.com',
            'external' => TRUE,
            'parent' => 'menu_link_content:6e452034-9a51-42c4-8c51-eda1be63d048',
          ],
        ],
      ],
      [
        '38584be3-605a-47b1-8881-838e1424d0f9',
        '6e452034-9a51-42c4-8c51-eda1be63d048',
      ],
      [
        'menu_link_content',
        'system',
      ],
    ],
  ];
}