5 * Contains \Drupal\linkit\Tests\Controllers\LinkitControllerTest.
8 namespace Drupal\linkit\Tests\Controllers;
11 use Drupal\linkit\Tests\LinkitTestBase;
15 * Tests Linkit controller.
19 class LinkitControllerTest extends LinkitTestBase {
24 * @var \Drupal\linkit\ProfileInterface
26 protected $linkitProfile;
31 protected function setUp() {
34 $this->linkitProfile = $this->createProfile();
36 $this->drupalLogin($this->adminUser);
40 * Tests the profile route title callback.
42 function testProfileTitle() {
43 $this->drupalGet(Url::fromRoute('entity.linkit_profile.edit_form', [
44 'linkit_profile' => $this->linkitProfile->id(),
47 $this->assertText('Edit ' . $this->linkitProfile->label() . ' profile');
51 * Tests the matcher route title callback.
53 function testMatcherTitle() {
54 /** @var \Drupal\linkit\MatcherInterface $plugin */
55 $plugin = $this->container->get('plugin.manager.linkit.matcher')->createInstance('configurable_dummy_matcher');
56 $matcher_uuid = $this->linkitProfile->addMatcher($plugin->getConfiguration());
57 $this->linkitProfile->save();
59 $this->drupalGet(Url::fromRoute('linkit.matcher.edit', [
60 'linkit_profile' => $this->linkitProfile->id(),
61 'plugin_instance_id' => $matcher_uuid,
64 $this->assertText('Edit ' . $plugin->getLabel() . ' matcher');
68 * Tests the attribute route title callback.
70 function testAttributeTitle() {
71 /** @var \Drupal\linkit\AttributeInterface $plugin */
72 $plugin = $this->container->get('plugin.manager.linkit.attribute')->createInstance('configurable_dummy_attribute');
73 $this->linkitProfile->addAttribute($plugin->getConfiguration());
74 $this->linkitProfile->save();
76 $this->drupalGet(Url::fromRoute('linkit.attribute.edit', [
77 'linkit_profile' => $this->linkitProfile->id(),
78 'plugin_instance_id' => $plugin->getPluginId(),
80 $this->assertText('Edit ' . $plugin->getLabel() . ' attribute');