You are here

PathautoPatternTest.php in Lightning Core 8.3

File

modules/lightning_page/tests/src/Functional/PathautoPatternTest.php
View source
<?php

namespace Drupal\Tests\lightning_page\Functional;

use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
use Drupal\Tests\BrowserTestBase;

/**
 * @group lightning
 * @group lightning_core
 * @group lightning_page
 */
class PathautoPatternTest extends BrowserTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'lightning_page',
    'pathauto',
  ];

  /**
   * Tests that Basic Page nodes are available at path '/[node:title]'.
   */
  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);
  }

}

Classes

Namesort descending Description
PathautoPatternTest @group lightning @group lightning_core @group lightning_page