public function DrupalTest::testL in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/DrupalTest.php \Drupal\Tests\Core\DrupalTest::testL()
Tests the l() method.
@covers ::l
See also
\Drupal\Core\Utility\LinkGeneratorInterface::generate()
File
- core/
tests/ Drupal/ Tests/ Core/ DrupalTest.php, line 353 - Contains \Drupal\Tests\Core\DrupalTest.
Class
- DrupalTest
- Tests the Drupal class.
Namespace
Drupal\Tests\CoreCode
public function testL() {
$route_parameters = array(
'test_parameter' => 'test',
);
$options = array(
'test_option' => 'test',
);
$generator = $this
->getMock('Drupal\\Core\\Utility\\LinkGeneratorInterface');
$url = new Url('test_route', $route_parameters, $options);
$generator
->expects($this
->once())
->method('generate')
->with('Test title', $url)
->will($this
->returnValue('link_html_string'));
$this
->setMockContainerService('link_generator', $generator);
$this
->assertInternalType('string', \Drupal::l('Test title', $url));
}