function MenuLinkMock::create

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php \Drupal\Tests\Core\Menu\MenuLinkMock::create()
  2. 8.9.x core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php \Drupal\Tests\Core\Menu\MenuLinkMock::create()
  3. 11.x core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php \Drupal\Tests\Core\Menu\MenuLinkMock::create()

Create an instance from a definition with at least id, title, route_name.

12 calls to MenuLinkMock::create()
DefaultMenuLinkTreeManipulatorsTest::mockTree in core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
Creates a mock tree.
DefaultMenuLinkTreeManipulatorsTest::testCheckNodeAccess in core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
Tests the optimized node access checking.
MenuActiveTrailTest::provider in core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php
Provides test data for all test methods.
MenuLinkTreeElementTest::testConstruction in core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php
Tests construction.
MenuLinkTreeElementTest::testCount in core/tests/Drupal/Tests/Core/Menu/MenuLinkTreeElementTest.php
Tests count().

... See full list

File

core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php, line 43

Class

MenuLinkMock
Defines a mock implementation of a menu link used in tests only.

Namespace

Drupal\Tests\Core\Menu

Code

public static function create($definition) {
    return new static([], $definition['id'], $definition + static::$defaults);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.