You are here

public function ConfigSelectorTest::testGetConfigEntityLinkToUrlException in Configuration selector 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/ConfigSelectorTest.php \Drupal\Tests\config_selector\Unit\ConfigSelectorTest::testGetConfigEntityLinkToUrlException()

@covers ::getConfigEntityLink

File

tests/src/Unit/ConfigSelectorTest.php, line 49

Class

ConfigSelectorTest
Tests the ConfigSelector.

Namespace

Drupal\Tests\config_selector\Unit

Code

public function testGetConfigEntityLinkToUrlException() {
  $config_entity = $this
    ->prophesize(ConfigEntityInterface::class);
  $config_entity
    ->hasLinkTemplate('edit-form')
    ->willReturn(FALSE);
  $config_entity
    ->toUrl()
    ->willThrow(UndefinedLinkTemplateException::class);
  $this
    ->assertEquals('', ConfigSelector::getConfigEntityLink($config_entity
    ->reveal()));
}