Class SubPathautoSpecialCharacterTest.
@group subpathauto
Hierarchy
- class \Drupal\Tests\subpathauto\Functional\SubPathautoSpecialCharacterTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of SubPathautoSpecialCharacterTest
File
-
tests/
src/ Functional/ SubPathautoSpecialCharacterTest.php, line 12
Namespace
Drupal\Tests\subpathauto\FunctionalView source
class SubPathautoSpecialCharacterTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'subpathauto',
'path_alias',
'node',
'user',
'text',
'language',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Ensures that special character urls do not return 404 page.
*/
public function testSpecialCharacterPath() : void {
$this->drupalCreateContentType([
'type' => 'page',
'name' => 'Basic page',
]);
$this->drupalCreateNode();
$aliasStorage = \Drupal::entityTypeManager()->getStorage('path_alias');
$path_alias = $aliasStorage->create([
'path' => '/node/1',
'alias' => '/test-alias%',
]);
$path_alias->save();
$alias_white_list = $this->container
->get('path_alias.whitelist');
$alias_white_list->set('node', TRUE);
$admin_user = $this->drupalCreateUser([
'bypass node access',
]);
$this->drupalLogin($admin_user);
$this->drupalGet('/test-alias%/edit');
$this->assertSession()
->statusCodeEquals(200);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
SubPathautoSpecialCharacterTest::$defaultTheme | protected | property | |
SubPathautoSpecialCharacterTest::$modules | protected static | property | |
SubPathautoSpecialCharacterTest::testSpecialCharacterPath | public | function | Ensures that special character urls do not return 404 page. |