You are here

public function FreelinkingPrefixAffixTest::testPrefixAffix in Freelinking 4.0.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/FreelinkingPrefixAffixTest.php \Drupal\Tests\freelinking\Functional\FreelinkingPrefixAffixTest::testPrefixAffix()

Asserts that text does not contain a break before or after the text.

Throws

\Behat\Mink\Exception\ResponseTextException

\Behat\Mink\Exception\ExpectationException

File

tests/src/Functional/FreelinkingPrefixAffixTest.php, line 28

Class

FreelinkingPrefixAffixTest
Tests that text is displayed inline after rendering.

Namespace

Drupal\Tests\freelinking\Functional

Code

public function testPrefixAffix() {

  // Create node that will contain a sample of each plugin.
  $edit = [];
  $edit['title[0][value]'] = $this
    ->getRandomGenerator()
    ->sentences(2);
  $edit['body[0][value]'] = $this
    ->getNodeBodyValue();
  $this
    ->drupalGet('node/add/page');
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->pageTextContains(t('Basic page @title has been created.', [
    '@title' => $edit['title[0][value]'],
  ]));

  // Confirm that the text is inline.
  $this
    ->assertSession()
    ->pageTextContains('PrefixFirst pageSuffix');
}