function DrupalTest::testEntityManager

Tests the entityManager() method.

@covers ::entityManager @group legacy @expectedDeprecation \Drupal::entityManager() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager() instead in most cases. If the needed method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the deprecated \Drupal\Core\Entity\EntityManager to find the correct interface or service. See https://www.drupal.org/node/2549139

File

core/tests/Drupal/Tests/Core/DrupalTest.php, line 86

Class

DrupalTest
Tests the Drupal class.

Namespace

Drupal\Tests\Core

Code

public function testEntityManager() {
    $this->setMockContainerService('entity.manager');
    $this->assertNotNull(\Drupal::entityManager());
}

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