You are here

public function EntityTypeTest::testGetHandler in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php \Drupal\Tests\Core\Entity\EntityTypeTest::testGetHandler()

Tests the getHandler() method.

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php, line 147
Contains \Drupal\Tests\Core\Entity\EntityTypeTest.

Class

EntityTypeTest
@coversDefaultClass \Drupal\Core\Entity\EntityType @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testGetHandler() {
  $controller = $this
    ->getTestHandlerClass();
  $entity_type = $this
    ->setUpEntityType(array(
    'handlers' => array(
      'storage' => $controller,
      'form' => array(
        'default' => $controller,
      ),
    ),
  ));
  $this
    ->assertSame($controller, $entity_type
    ->getHandlerClass('storage'));
  $this
    ->assertSame($controller, $entity_type
    ->getHandlerClass('form', 'default'));
}