function ParamConverterManagerTest::testGetConverter
Tests \Drupal\Core\ParamConverter\ParamConverterManager::getConverter().
@dataProvider providerTestGetConverter
@covers ::getConverter
File
-
core/
tests/ Drupal/ Tests/ Core/ ParamConverter/ ParamConverterManagerTest.php, line 41
Class
- ParamConverterManagerTest
- @coversDefaultClass \Drupal\Core\ParamConverter\ParamConverterManager[[api-linebreak]] @group ParamConverter
Namespace
Drupal\Tests\Core\ParamConverterCode
public function testGetConverter($name, $class) : void {
$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));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.