public function WorkspaceTest::testSpecialCharacters in Workspace 8.2
Same name and namespace in other branches
- 8 tests/src/Functional/WorkspaceTest.php \Drupal\Tests\workspace\Functional\WorkspaceTest::testSpecialCharacters()
Test creating a workspace with special characters.
File
- tests/
src/ Functional/ WorkspaceTest.php, line 55
Class
- WorkspaceTest
- Test the workspace entity.
Namespace
Drupal\Tests\workspace\FunctionalCode
public function testSpecialCharacters() {
$this
->drupalLogin($this->editor1);
// Test a valid workspace name.
$this
->createWorkspaceThroughUi('Workspace 1', 'a0_$()+-/');
// Test and invalid workspace name.
$this
->drupalGet('/admin/config/workflow/workspace/add');
$this
->assertSession()
->statusCodeEquals(200);
$page = $this
->getSession()
->getPage();
$page
->fillField('label', 'workspace2');
$page
->fillField('id', 'A!"£%^&*{}#~@?');
$page
->findButton('Save')
->click();
$page
->hasContent("This value is not valid");
}