function PathPluginBaseTest::testGetRouteName
Same name and namespace in other branches
- 9 core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest::testGetRouteName()
- 8.9.x core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest::testGetRouteName()
- 10 core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest::testGetRouteName()
Tests the getRouteName method.
File
-
core/
modules/ views/ tests/ src/ Unit/ Plugin/ display/ PathPluginBaseTest.php, line 542
Class
- PathPluginBaseTest
- @coversDefaultClass <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21display%21PathPluginBase.php/class/PathPluginBase/11.x" title="The base display plugin for path/callbacks. This is used for pages and feeds." class="local">\Drupal\views\Plugin\views\display\PathPluginBase</a> @group views
Namespace
Drupal\Tests\views\Unit\Plugin\displayCode
public function testGetRouteName() : void {
[
$view,
] = $this->setupViewExecutableAccessPlugin();
$display = [];
$display['display_plugin'] = 'page';
$display['id'] = 'page_1';
$display['display_options'] = [
'path' => 'test_route',
];
$this->pathPlugin
->initDisplay($view, $display);
$route_name = $this->pathPlugin
->getRouteName();
// Ensure that the expected route name is returned.
$this->assertEquals('view.test_id.page_1', $route_name);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.