LinkitControllerTest.php in Linkit 8.5
File
tests/src/Functional/Controller/LinkitControllerTest.php
View source
<?php
namespace Drupal\Tests\linkit\Functional\Controller;
use Drupal\linkit\Tests\ProfileCreationTrait;
use Drupal\Tests\linkit\Functional\LinkitBrowserTestBase;
class LinkitControllerTest extends LinkitBrowserTestBase {
use ProfileCreationTrait;
protected $linkitProfile;
protected function setUp() {
parent::setUp();
$this->linkitProfile = $this
->createProfile();
}
public function testProfileTitle() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('/admin/config/content/linkit/manage/' . $this->linkitProfile
->id());
$this
->assertSession()
->pageTextContains('Edit ' . $this->linkitProfile
->label() . ' profile');
}
public function testMatcherTitle() {
$this
->drupalLogin($this->adminUser);
$plugin = $this->container
->get('plugin.manager.linkit.matcher')
->createInstance('configurable_dummy_matcher');
$matcher_uuid = $this->linkitProfile
->addMatcher($plugin
->getConfiguration());
$this->linkitProfile
->save();
$this
->drupalGet('/admin/config/content/linkit/manage/' . $this->linkitProfile
->id() . '/matchers/' . $matcher_uuid);
$this
->assertSession()
->pageTextContains('Edit ' . $plugin
->getLabel() . ' matcher');
}
}