public function PathPluginBaseTest::testCollectRoutesWithDisplayReturnResponse in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/tests/src/Unit/Plugin/display/PathPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest::testCollectRoutesWithDisplayReturnResponse()
Tests the collectRoutes method with a display returning a response.
See also
\Drupal\views\Plugin\views\display\PathPluginBase::collectRoutes()
File
- core/
modules/ views/ tests/ src/ Unit/ Plugin/ display/ PathPluginBaseTest.php, line 119 - Contains \Drupal\Tests\views\Unit\Plugin\display\PathPluginBaseTest.
Class
- PathPluginBaseTest
- @coversDefaultClass \Drupal\views\Plugin\views\display\PathPluginBase @group views
Namespace
Drupal\Tests\views\Unit\Plugin\displayCode
public function testCollectRoutesWithDisplayReturnResponse() {
list($view) = $this
->setupViewExecutableAccessPlugin();
$display = array();
$display['display_plugin'] = 'page';
$display['id'] = 'page_1';
$display['display_options'] = array(
'path' => 'test_route',
);
$this->pathPlugin = $this
->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\PathPluginBase')
->setConstructorArgs(array(
array(),
'path_base',
array(
'returns_response' => TRUE,
),
$this->routeProvider,
$this->state,
))
->setMethods(NULL)
->getMock();
$this->pathPlugin
->initDisplay($view, $display);
$collection = new RouteCollection();
$this->pathPlugin
->collectRoutes($collection);
$route = $collection
->get('view.test_id.page_1');
$this
->assertSame(TRUE, $route
->getOption('returns_response'));
$this
->assertEquals('my views title', $route
->getDefault('_title'));
}