Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
f82e35fb
Verified
Commit
f82e35fb
authored
9 months ago
by
Théodore Biadala
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3463548
by catch, smustgrave: Consolidate methods on FormElementsLabelsTest
parent
ae638ca0
No related branches found
No related tags found
Loading
Pipeline
#235267
canceled
9 months ago
Stage: 🏗️ Build
Stage: 🪄 Lint
Stage: 🗜️ Test
Pipeline: drupal
#235272
Changes
1
Pipelines
22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php
+14
-4
14 additions, 4 deletions
...s/system/tests/src/Functional/Form/ElementsLabelsTest.php
with
14 additions
and
4 deletions
core/modules/system/tests/src/Functional/Form/ElementsLabelsTest.php
+
14
−
4
View file @
f82e35fb
...
...
@@ -26,6 +26,16 @@ class ElementsLabelsTest extends BrowserTestBase {
*/
protected
$defaultTheme
=
'stark'
;
/**
* Tests form elements.
*/
public
function
testFormElements
():
void
{
$this
->
testFormLabels
();
$this
->
testTitleEscaping
();
$this
->
testFormDescriptions
();
$this
->
testFormsInThemeLessEnvironments
();
}
/**
* Tests form element rendering.
*
...
...
@@ -35,7 +45,7 @@ class ElementsLabelsTest extends BrowserTestBase {
* - Prefix and suffix render element placement.
* - Form element title attributes.
*/
p
ublic
function
testFormLabels
():
void
{
p
rotected
function
testFormLabels
():
void
{
$this
->
drupalGet
(
'form_test/form-labels'
);
// Check that the checkbox/radio processing is not interfering with
...
...
@@ -104,7 +114,7 @@ public function testFormLabels(): void {
/**
* Tests XSS-protection of element labels.
*/
p
ublic
function
testTitleEscaping
():
void
{
p
rotected
function
testTitleEscaping
():
void
{
$this
->
drupalGet
(
'form_test/form-labels'
);
foreach
(
FormTestLabelForm
::
$typesWithTitle
as
$type
)
{
$this
->
assertSession
()
->
responseContains
(
"
$type
alert('XSS') is XSS filtered!"
);
...
...
@@ -115,7 +125,7 @@ public function testTitleEscaping(): void {
/**
* Tests different display options for form element descriptions.
*/
p
ublic
function
testFormDescriptions
():
void
{
p
rotected
function
testFormDescriptions
():
void
{
$this
->
drupalGet
(
'form_test/form-descriptions'
);
// Check #description placement with #description_display='after'.
...
...
@@ -142,7 +152,7 @@ public function testFormDescriptions(): void {
/**
* Tests forms in theme-less environments.
*/
p
ublic
function
testFormsInThemeLessEnvironments
():
void
{
p
rotected
function
testFormsInThemeLessEnvironments
():
void
{
$form
=
$this
->
getFormWithLimitedProperties
();
$render_service
=
$this
->
container
->
get
(
'renderer'
);
// This should not throw any notices.
...
...
This diff is collapsed.
Click to expand it.
Théodore Biadala
@nod_
mentioned in commit
0d664bc8
·
9 months ago
mentioned in commit
0d664bc8
mentioned in commit 0d664bc8b47af4d3fed97a48f80073e2cb59321d
Toggle commit list
Théodore Biadala
@nod_
mentioned in commit
3ec2fa91
·
9 months ago
mentioned in commit
3ec2fa91
mentioned in commit 3ec2fa91d5d5f32dfbee0a8d4f020e73f1227d66
Toggle commit list
Théodore Biadala
@nod_
mentioned in commit
62a37e84
·
9 months ago
mentioned in commit
62a37e84
mentioned in commit 62a37e84de42c9ac17554761ded63f75eb58cdbb
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment