public function MatcherAdminTest::testAddConfigurable in Linkit 8.5
Test adding a configurable attribute to a profile.
File
- tests/
src/ Functional/ MatcherAdminTest.php, line 77
Class
- MatcherAdminTest
- Tests adding, listing, updating and deleting matchers on a profile.
Namespace
Drupal\Tests\linkit\FunctionalCode
public function testAddConfigurable() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('/admin/config/content/linkit/manage/' . $this->linkitProfile
->id() . '/matchers/add');
// Create configurable matcher.
$edit = [];
$edit['plugin'] = 'configurable_dummy_matcher';
$this
->submitForm($edit, 'Save and continue');
// Reload the profile.
$this->linkitProfile = Profile::load($this->linkitProfile
->id());
$matcher_ids = $this->linkitProfile
->getMatchers()
->getInstanceIds();
/** @var \Drupal\linkit\MatcherInterface $plugin */
$plugin = $this->linkitProfile
->getMatcher(current($matcher_ids));
$this
->assertSession()
->addressEquals('/admin/config/content/linkit/manage/' . $this->linkitProfile
->id() . '/matchers/' . $plugin
->getUuid());
$this
->drupalGet('/admin/config/content/linkit/manage/' . $this->linkitProfile
->id() . '/matchers');
$this
->assertSession()
->pageTextNotContains('No matchers added.');
}