You are here

public function ViewExecutableTest::testGetUrlWithPathNoPlaceholders in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/tests/src/Unit/ViewExecutableTest.php \Drupal\Tests\views\Unit\ViewExecutableTest::testGetUrlWithPathNoPlaceholders()

@covers ::getUrl

File

core/modules/views/tests/src/Unit/ViewExecutableTest.php, line 126
Contains \Drupal\Tests\views\Unit\ViewExecutableTest.

Class

ViewExecutableTest
@coversDefaultClass \Drupal\views\ViewExecutable @group views

Namespace

Drupal\Tests\views\Unit

Code

public function testGetUrlWithPathNoPlaceholders() {
  $this->displayHandler
    ->expects($this
    ->any())
    ->method('getRoutedDisplay')
    ->willReturn($this->displayHandler);
  $this->displayHandlers
    ->expects($this
    ->any())
    ->method('get')
    ->willReturn($this->displayHandler);
  $this->displayHandler
    ->expects($this
    ->any())
    ->method('getUrlInfo')
    ->willReturn(Url::fromRoute('views.test.page_1'));
  $this->displayHandler
    ->expects($this
    ->any())
    ->method('getPath')
    ->willReturn('test-path');
  $this
    ->assertEquals(Url::fromRoute('views.test.page_1'), $this->executable
    ->getUrl());
}