You are here

public function PathautoPatternTest::testPagePattern in Lightning Core 8

Same name and namespace in other branches
  1. 8.5 modules/lightning_page/tests/src/Functional/PathautoPatternTest.php \Drupal\Tests\lightning_page\Functional\PathautoPatternTest::testPagePattern()
  2. 8.2 modules/lightning_page/tests/src/Functional/PathautoPatternTest.php \Drupal\Tests\lightning_page\Functional\PathautoPatternTest::testPagePattern()
  3. 8.3 modules/lightning_page/tests/src/Functional/PathautoPatternTest.php \Drupal\Tests\lightning_page\Functional\PathautoPatternTest::testPagePattern()
  4. 8.4 modules/lightning_page/tests/src/Functional/PathautoPatternTest.php \Drupal\Tests\lightning_page\Functional\PathautoPatternTest::testPagePattern()

Tests that Basic Page nodes are available at path '/[node:title]'.

File

modules/lightning_page/tests/src/Functional/PathautoPatternTest.php, line 27

Class

PathautoPatternTest
@group lightning @group lightning_core @group lightning_page

Namespace

Drupal\Tests\lightning_page\Functional

Code

public function testPagePattern() {
  $node = Node::create([
    'type' => 'page',
    'title' => 'Foo Bar',
    'status' => NodeInterface::PUBLISHED,
  ]);
  $node
    ->save();
  $this
    ->drupalGet('/foo-bar');
  $this
    ->assertSession()
    ->pageTextContains('Foo Bar');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}