public function ParamConverterManagerTest::testGetConverter in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php \Drupal\Tests\Core\ParamConverter\ParamConverterManagerTest::testGetConverter()
- 9 core/tests/Drupal/Tests/Core/ParamConverter/ParamConverterManagerTest.php \Drupal\Tests\Core\ParamConverter\ParamConverterManagerTest::testGetConverter()
Tests \Drupal\Core\ParamConverter\ParamConverterManager::getConverter().
@dataProvider providerTestGetConverter
@covers ::getConverter
File
- core/
tests/ Drupal/ Tests/ Core/ ParamConverter/ ParamConverterManagerTest.php, line 39
Class
- ParamConverterManagerTest
- @coversDefaultClass \Drupal\Core\ParamConverter\ParamConverterManager @group ParamConverter
Namespace
Drupal\Tests\Core\ParamConverterCode
public function testGetConverter($name, $class) {
$converter = $this
->getMockBuilder('Drupal\\Core\\ParamConverter\\ParamConverterInterface')
->setMockClassName($class)
->getMock();
$this->manager
->addConverter($converter, $name);
$this
->assertInstanceOf($class, $this->manager
->getConverter($name));
// Assert that a second call to getConverter() does not use the container.
$this
->assertInstanceOf($class, $this->manager
->getConverter($name));
}