function RdfMappingConfigEntityUnitTest::setUp

Same name and namespace in other branches
  1. 8.9.x core/modules/rdf/tests/src/Unit/RdfMappingConfigEntityUnitTest.php \Drupal\Tests\rdf\Unit\RdfMappingConfigEntityUnitTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/rdf/tests/src/Unit/RdfMappingConfigEntityUnitTest.php, line 48

Class

RdfMappingConfigEntityUnitTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21rdf%21src%21Entity%21RdfMapping.php/class/RdfMapping/9" title="Config entity for working with RDF mappings." class="local">\Drupal\rdf\Entity\RdfMapping</a> @group rdf @group legacy

Namespace

Drupal\Tests\rdf\Unit

Code

protected function setUp() : void {
    $this->entityTypeId = $this->randomMachineName();
    $this->entityType = $this->createMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
    $this->entityType
        ->expects($this->any())
        ->method('getProvider')
        ->willReturn('entity');
    $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
    $this->uuid = $this->createMock('\\Drupal\\Component\\Uuid\\UuidInterface');
    $container = new ContainerBuilder();
    $container->set('entity_type.manager', $this->entityTypeManager);
    $container->set('uuid', $this->uuid);
    \Drupal::setContainer($container);
}

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