You are here

class MenuLinkPluginTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php \Drupal\Tests\menu_link_content\Unit\MenuLinkPluginTest
  2. 9 core/modules/menu_link_content/tests/src/Unit/MenuLinkPluginTest.php \Drupal\Tests\menu_link_content\Unit\MenuLinkPluginTest

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

@group Menu

Hierarchy

  • class \Drupal\Tests\UnitTestCase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, PhpUnitWarnings

Expanded class hierarchy of MenuLinkPluginTest

File

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

Namespace

Drupal\Tests\menu_link_content\Unit
View source
class MenuLinkPluginTest extends UnitTestCase {

  /**
   * @covers ::getUuid
   */
  public function testGetInstanceReflection() {

    /** @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');
    $instance_method
      ->setAccessible(TRUE);
    $this
      ->assertEquals('test_id', $instance_method
      ->invoke($menu_link_content_plugin));
  }

}

Members