function InlineBlockUsageTest::testGetUsage

Same name in other branches
  1. 11.x core/modules/layout_builder/tests/src/Kernel/InlineBlockUsageTest.php \Drupal\Tests\layout_builder\Kernel\InlineBlockUsageTest::testGetUsage()

Covers ::getUsage.

File

core/modules/layout_builder/tests/src/Kernel/InlineBlockUsageTest.php, line 124

Class

InlineBlockUsageTest
Class for testing the InlineBlockUsage service.

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testGetUsage() : void {
    $this->inlineBlockUsage
        ->addUsage('1', $this->entity);
    $result = $this->inlineBlockUsage
        ->getUsage('1');
    $this->assertEquals($this->entity
        ->id(), $result->layout_entity_id);
    $this->assertEquals($this->entity
        ->getEntityTypeId(), $result->layout_entity_type);
}

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