function MenuLinkPluginTest::testGetInstanceReflection

Same name in other branches
  1. 9 core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php \Drupal\Tests\menu_link_content\Unit\MenuLinkPluginTest::testGetInstanceReflection()
  2. 8.9.x core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php \Drupal\Tests\menu_link_content\Unit\MenuLinkPluginTest::testGetInstanceReflection()
  3. 11.x core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php \Drupal\Tests\menu_link_content\Unit\MenuLinkPluginTest::testGetInstanceReflection()

@covers ::getUuid

File

core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php, line 20

Class

MenuLinkPluginTest
@coversDefaultClass \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent

Namespace

Drupal\Tests\menu_link_content\Unit

Code

public function testGetInstanceReflection() : void {
    
    /** @var \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent $menu_link_content_plugin */
    $menu_link_content_plugin = $this->prophesize(MenuLinkContent::class);
    $menu_link_content_plugin->getDerivativeId()
        ->willReturn('test_id');
    $menu_link_content_plugin = $menu_link_content_plugin->reveal();
    $class = new \ReflectionClass(MenuLinkContent::class);
    $instance_method = $class->getMethod('getUuid');
    $this->assertEquals('test_id', $instance_method->invoke($menu_link_content_plugin));
}

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