You are here

function LinkitControllerTest::testAttributeTitle in Linkit 8.4

Tests the attribute route title callback.

File

src/Tests/Controllers/LinkitControllerTest.php, line 70
Contains \Drupal\linkit\Tests\Controllers\LinkitControllerTest.

Class

LinkitControllerTest
Tests Linkit controller.

Namespace

Drupal\linkit\Tests\Controllers

Code

function testAttributeTitle() {

  /** @var \Drupal\linkit\AttributeInterface $plugin */
  $plugin = $this->container
    ->get('plugin.manager.linkit.attribute')
    ->createInstance('configurable_dummy_attribute');
  $this->linkitProfile
    ->addAttribute($plugin
    ->getConfiguration());
  $this->linkitProfile
    ->save();
  $this
    ->drupalGet(Url::fromRoute('linkit.attribute.edit', [
    'linkit_profile' => $this->linkitProfile
      ->id(),
    'plugin_instance_id' => $plugin
      ->getPluginId(),
  ]));
  $this
    ->assertText('Edit ' . $plugin
    ->getLabel() . ' attribute');
}