function EntityFormTest::testGet

Tests that __get triggers proper deprecation errors.

@covers ::__get @group legacy

@expectedDeprecation EntityForm::entityManager is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use EntityForm::entityTypeManager instead. See https://www.drupal.org/node/2549139

File

core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php, line 265

Class

EntityFormTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityForm.php/class/EntityForm/8.9.x" title="Base class for entity forms." class="local">\Drupal\Core\Entity\EntityForm</a> @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testGet() {
    $container = new ContainerBuilder();
    $entity_manager = $this->prophesize(EntityManager::class)
        ->reveal();
    $container->set('entity.manager', $entity_manager);
    \Drupal::setContainer($container);
    $this->assertSame($entity_manager, $this->entityForm->entityManager);
}

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