PathAliasTest.php in Lightning Core 8.5
File
modules/lightning_contact_form/tests/src/Functional/PathAliasTest.php
View source
<?php
namespace Drupal\Tests\lightning_contact_form\Functional;
use Drupal\Tests\BrowserTestBase;
class PathAliasTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected static $modules = [
'node',
'path',
];
protected function setUp() {
parent::setUp();
$this
->drupalCreateContentType([
'type' => 'page',
'name' => 'Page',
]);
}
public function testPathAlias() {
$assert_session = $this
->assertSession();
$this
->drupalGet('contact');
$assert_session
->statusCodeEquals(404);
$this
->drupalCreateNode([
'type' => 'page',
'path' => '/contact',
'title' => 'This is definitely the right contact page',
]);
$this
->drupalGet('contact');
$assert_session
->statusCodeEquals(200);
$assert_session
->pageTextContains('This is definitely the right contact page');
$this->container
->get('module_installer')
->install([
'lightning_contact_form',
]);
$this
->getSession()
->reload();
$assert_session
->statusCodeEquals(200);
$assert_session
->pageTextContains('This is definitely the right contact page');
}
}
Classes
Name |
Description |
PathAliasTest |
@group lightning
@group lightning_core
@group lightning_contact_form |