You are here

public function EntityConverterTest::testApplies in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php \Drupal\Tests\Core\ParamConverter\EntityConverterTest::testApplies()

Tests the applies() method.

@dataProvider providerTestApplies

@covers ::applies

File

core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php, line 53
Contains \Drupal\Tests\Core\ParamConverter\EntityConverterTest.

Class

EntityConverterTest
@coversDefaultClass \Drupal\Core\ParamConverter\EntityConverter @group ParamConverter @group Entity

Namespace

Drupal\Tests\Core\ParamConverter

Code

public function testApplies(array $definition, $name, Route $route, $applies) {
  $this->entityManager
    ->expects($this
    ->any())
    ->method('hasDefinition')
    ->willReturnCallback(function ($entity_type) {
    return 'entity_test' == $entity_type;
  });
  $this
    ->assertEquals($applies, $this->entityConverter
    ->applies($definition, $name, $route));
}