public function ConfigSelectorTest::testGetConfigEntityLinkToUrlEditForm in Configuration selector 8.2
Same name and namespace in other branches
- 8 tests/src/Unit/ConfigSelectorTest.php \Drupal\Tests\config_selector\Unit\ConfigSelectorTest::testGetConfigEntityLinkToUrlEditForm()
@covers ::getConfigEntityLink
File
- tests/
src/ Unit/ ConfigSelectorTest.php, line 23
Class
- ConfigSelectorTest
- Tests the ConfigSelector.
Namespace
Drupal\Tests\config_selector\UnitCode
public function testGetConfigEntityLinkToUrlEditForm() {
$config_entity = $this
->prophesize(ConfigEntityInterface::class);
$config_entity
->hasLinkTemplate('edit-form')
->willReturn(TRUE);
$url = $this
->prophesize(Url::class);
$url
->toString()
->willReturn('a/link/to/an/edit-form');
$config_entity
->toUrl('edit-form')
->willReturn($url);
$config_entity
->toUrl()
->shouldNotBeCalled();
$this
->assertEquals('a/link/to/an/edit-form', ConfigSelector::getConfigEntityLink($config_entity
->reveal()));
}