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
Merge requests
!4879
Issue
#3389804
: Split up MediaConfigurationUiTest
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Issue
#3389804
: Split up MediaConfigurationUiTest
issue/drupal-3389804:3389804-split-up-mediaconfigurationuitest
into
11.x
Overview
0
Commits
1
Pipelines
1
Changes
3
Closed
catch
requested to merge
issue/drupal-3389804:3389804-split-up-mediaconfigurationuitest
into
11.x
1 year ago
Overview
0
Commits
1
Pipelines
1
Changes
3
Expand
0
0
Merge request reports
Compare
11.x
11.x (base)
and
latest version
latest version
dd37763a
1 commit,
1 year ago
3 files
+
117
−
95
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiAddTest.php
0 → 100644
+
59
−
0
Options
<?php
namespace
Drupal\Tests\media\FunctionalJavascript
;
/**
* @covers ::media_filter_format_edit_form_validate
* @group media
* @group #slow
*/
class
MediaEmbedFilterConfigurationUiAddTest
extends
MediaEmbedFilterTestBase
{
/**
* @covers ::media_form_filter_format_add_form_alter
* @dataProvider providerTestValidations
*/
public
function
testValidationWhenAdding
(
$filter_html_status
,
$filter_align_status
,
$filter_caption_status
,
$filter_html_image_secure_status
,
$media_embed
,
$allowed_html
,
$expected_error_message
)
{
$this
->
drupalGet
(
'admin/config/content/formats/add'
);
// Enable the `filter_html` and `media_embed` filters.
$page
=
$this
->
getSession
()
->
getPage
();
$page
->
fillField
(
'name'
,
'Another test format'
);
$this
->
showHiddenFields
();
$page
->
findField
(
'format'
)
->
setValue
(
'another_media_embed_test'
);
if
(
$filter_html_status
)
{
$page
->
checkField
(
'filters[filter_html][status]'
);
}
if
(
$filter_align_status
)
{
$page
->
checkField
(
'filters[filter_align][status]'
);
}
if
(
$filter_caption_status
)
{
$page
->
checkField
(
'filters[filter_caption][status]'
);
}
if
(
$filter_html_image_secure_status
)
{
$page
->
checkField
(
'filters[filter_html_image_secure][status]'
);
}
if
(
$media_embed
===
TRUE
||
is_numeric
(
$media_embed
))
{
$page
->
checkField
(
'filters[media_embed][status]'
);
// Set a non-default weight.
if
(
is_numeric
(
$media_embed
))
{
$this
->
click
(
'.tabledrag-toggle-weight'
);
$page
->
selectFieldOption
(
'filters[media_embed][weight]'
,
$media_embed
);
}
}
if
(
!
empty
(
$allowed_html
))
{
$page
->
clickLink
(
'Limit allowed HTML tags and correct faulty HTML'
);
$page
->
fillField
(
'filters[filter_html][settings][allowed_html]'
,
$allowed_html
);
}
$page
->
pressButton
(
'Save configuration'
);
if
(
$expected_error_message
)
{
$this
->
assertSession
()
->
pageTextNotContains
(
'Added text format Another test format.'
);
$this
->
assertSession
()
->
pageTextContains
(
$expected_error_message
);
}
else
{
$this
->
assertSession
()
->
pageTextContains
(
'Added text format Another test format.'
);
}
}
}
Loading