Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
WCMS
uw_base_profile
Commits
f5773224
Commit
f5773224
authored
Jun 24, 2021
by
Chris Shantz
Browse files
Merge branch '3.0.x' into prod/3.0.x for 3.0.0
parents
81d609c0
dba0602f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
31 deletions
+57
-31
composer.json
composer.json
+23
-22
tests/src/Functional/UwWcmsBasicTest.php
tests/src/Functional/UwWcmsBasicTest.php
+34
-9
No files found.
composer.json
View file @
f5773224
...
...
@@ -100,7 +100,7 @@
"
drupal/roleassign
"
:
"
1.0-beta1
"
,
"
drupal/schema_metatag
"
:
"
1.8
"
,
"
drupal/sendgrid_integration
"
:
"
2.0-alpha4
"
,
"
drupal/simplesamlphp_auth
"
:
"
3.2
"
,
"
drupal/simplesamlphp_auth
"
:
"
dev-3.2-uw_wcms1
"
,
"
drupal/simplesamlphp_custom_attributes
"
:
"
dev-8.x-1.1+5-dev
"
,
"
drupal/simplify_menu
"
:
"
2.0
"
,
"
drupal/smart_date
"
:
"
3.1.1
"
,
...
...
@@ -140,27 +140,28 @@
"
symfony/css-selector
"
:
"
~3.0
"
,
"
symfony/finder
"
:
"
^4.0
"
,
"
symfony/var-dumper
"
:
"
^4.0
"
,
"
wcms/layout_builder_expand_collapse
"
:
"
1.0.1
"
,
"
wcms/uw_auth_wcms_admins
"
:
"
1.0.0
"
,
"
wcms/uw_cfg_common
"
:
"
1.0.2
"
,
"
wcms/uw_ct_blog
"
:
"
1.0.2
"
,
"
wcms/uw_ct_catalog
"
:
"
1.0.2
"
,
"
wcms/uw_ct_contact
"
:
"
1.0.2
"
,
"
wcms/uw_ct_event
"
:
"
1.0.2
"
,
"
wcms/uw_ct_news_item
"
:
"
1.0.2
"
,
"
wcms/uw_ct_profile
"
:
"
1.0.2
"
,
"
wcms/uw_ct_sidebar
"
:
"
1.0.0
"
,
"
wcms/uw_ct_site_footer
"
:
"
1.0.0
"
,
"
wcms/uw_ct_web_page
"
:
"
1.0.1
"
,
"
wcms/uw_custom_blocks
"
:
"
1.0.2
"
,
"
wcms/uw_dashboard
"
:
"
1.0.0
"
,
"
wcms/uw_fdsu_theme_resp
"
:
"
1.0.2
"
,
"
wcms/uw_media
"
:
"
1.0.0
"
,
"
wcms/uw_migrate
"
:
"
1.0.1
"
,
"
wcms/uw_sites_all
"
:
"
1.0.1
"
,
"
wcms/uw_theme_admin
"
:
"
1.0.1
"
,
"
wcms/uw_wcms_gesso
"
:
"
3.0.2
"
,
"
wcms/uw_ws_ofis
"
:
"
2.0.0
"
,
"
wcms/layout_builder_expand_collapse
"
:
"
dev-1.0.x
"
,
"
wcms/uw_auth_wcms_admins
"
:
"
dev-1.0.x
"
,
"
wcms/uw_cfg_common
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ckeditor_plugins
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_blog
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_catalog
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_contact
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_event
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_news_item
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_profile
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_sidebar
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_site_footer
"
:
"
dev-1.0.x
"
,
"
wcms/uw_ct_web_page
"
:
"
dev-1.0.x
"
,
"
wcms/uw_custom_blocks
"
:
"
dev-1.0.x
"
,
"
wcms/uw_dashboard
"
:
"
dev-1.0.x
"
,
"
wcms/uw_fdsu_theme_resp
"
:
"
dev-1.0.x
"
,
"
wcms/uw_media
"
:
"
dev-1.0.x
"
,
"
wcms/uw_migrate
"
:
"
dev-1.0.x
"
,
"
wcms/uw_sites_all
"
:
"
dev-1.0.x
"
,
"
wcms/uw_theme_admin
"
:
"
dev-1.0.x
"
,
"
wcms/uw_wcms_gesso
"
:
"
dev-3.0.x
"
,
"
wcms/uw_ws_ofis
"
:
"
dev-2.0.x
"
,
"
wikimedia/composer-merge-plugin
"
:
"
^1.4
"
}
}
...
...
tests/src/Functional/UwWcmsBasicTest.php
View file @
f5773224
...
...
@@ -249,6 +249,9 @@ class UwWcmsBasicTest extends BrowserTestBase {
];
$this
->
drupalPostForm
(
'admin/structure/webform/add'
,
$edit
,
'Save'
);
// Test for existence Webform CAPTCHA component on newly-created Webform.
$this
->
assertFieldByXPath
(
'//table[@id="edit-webform-ui-elements"]/tbody/tr[@data-webform-type="captcha"]'
,
NULL
,
'CAPTCHA component exists.'
);
// The variable $test_paths stores Drupal paths and permission information.
// In this array, the keys are paths. If the value is TRUE, everyone has
// access. Otherwise, the value must be an array of roles that have access.
...
...
@@ -313,6 +316,13 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this_code
=
$this
->
getSession
()
->
getStatusCode
();
$message
=
sprintf
(
'Response status code for %s on path %s is %d; %d expected.'
,
$role
,
$path
,
$this_code
,
$expected_code
);
$this
->
assert
(
intval
(
$this_code
)
===
$expected_code
,
$message
);
if
(
$path
===
'form/test-form'
&&
!
$this
->
loggedInUser
)
{
// Test for Honeypot element.
$this
->
assertRaw
(
'Leave this field blank'
);
// Test for hCaptcha element.
$this
->
assertFieldByXPath
(
'//div[@class="captcha"]/input[@name="captcha_token"]'
,
NULL
,
'Page has hCaptcha element.'
);
}
}
}
}
...
...
@@ -375,6 +385,21 @@ class UwWcmsBasicTest extends BrowserTestBase {
// The message is displayed when creating a catalog item
// without a catalog term created.
$this
->
assertSession
()
->
pageTextContains
(
'You must create at least one catalog before adding a catalog item.'
);
// Content Author default has 'create terms in uw_vocab_catalogs',
// so when creating a catalog node, 'Add a catalog' link
// shows without any catalog term created.
$this
->
assertSession
()
->
linkExists
(
'Add a catalog'
);
$href
=
$this
->
getSession
()
->
getPage
()
->
find
(
'xpath'
,
"//a[contains(text(), 'Add a catalog.')]"
);
$this
->
assertEquals
(
base_path
()
.
'admin/structure/taxonomy/manage/uw_vocab_catalogs/add'
,
$href
->
getAttribute
(
'href'
));
// Revoke Content Author 'create terms in uw_vocab_catalogs' permission.
user_role_revoke_permissions
(
'uw_role_content_author'
,
[
'create terms in uw_vocab_catalogs'
]);
// When creating catalog node, the help text shows
// without any catalog term created.
$this
->
drupalGet
(
$type
);
$this
->
assertSession
()
->
pageTextContains
(
'Reach out to someone who has access to add a catalog.'
);
// Grant Content Author 'create terms in uw_vocab_catalogs'
// permission again for late use.
user_role_grant_permissions
(
'uw_role_content_author'
,
[
'create terms in uw_vocab_catalogs'
]);
}
}
...
...
@@ -2214,13 +2239,13 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this
->
assertSession
()
->
pageTextContains
(
'Administrative label'
);
$this
->
assertSession
()
->
pageTextContains
(
'Section ID'
);
$this
->
assertSession
()
->
pageTextContains
(
'Make Section Expand/Collapsible'
);
$this
->
assertSession
()
->
pageTextContains
(
'Title of Expand/Collapse Group'
);
$this
->
assertSession
()
->
pageTextContains
(
'Heading Selector'
);
->
pageTextContains
(
'Make section expand/collapsible'
);
$this
->
assertSession
()
->
pageTextContains
(
'Grouping'
);
$this
->
assertSession
()
->
pageTextContains
(
'Group name'
);
$this
->
assertSession
()
->
pageTextContains
(
'other'
);
$this
->
assertSession
()
->
pageTextContains
(
'Create new grouping'
);
$this
->
assertSession
()
->
pageTextContains
(
'Header text'
);
$this
->
assertSession
()
->
pageTextContains
(
'Heading level'
);
$this
->
assertSession
()
->
pageTextContains
(
'Extra-wide contained width'
);
// No column widths on one column.
if
(
$section
[
'name'
]
!=
'One column'
)
{
...
...
@@ -2254,15 +2279,15 @@ class UwWcmsBasicTest extends BrowserTestBase {
// Test step 3E: Check if page contains the correct link wordage.
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
$msg
=
$this
->
t
(
'Expand/
C
ollapse
G
roup
ing of
'
);
$msg
=
$this
->
t
(
'Expand/
c
ollapse
g
roup'
);
// Text is based on the label and group.
$labelCheck
=
[
'label'
=>
"Configure "
.
$section
[
'admin-label'
],
'group'
=>
"Configure [
$msg
: "
.
$section
[
'group'
]
.
"]"
,
'group'
=>
"Configure
Section
[
$msg
: "
.
$section
[
'group'
]
.
"]"
,
'label-group'
=>
"Configure "
.
$section
[
'admin-label'
]
.
" [
$msg
: "
.
$section
[
'group'
]
.
"]"
,
];
if
(
!
empty
(
$section
[
'admin-label'
])
&&
!
empty
(
$section
[
'group'
]))
{
// Configure {ADMIN LABEL} [Expand/
C
ollapse
G
roup
ing of
: {GROUP}].
// Configure {ADMIN LABEL} [Expand/
c
ollapse
g
roup: {GROUP}].
$this
->
assertSession
()
->
linkExists
(
$labelCheck
[
'label-group'
]);
}
elseif
(
!
empty
(
$section
[
'admin-label'
])
&&
empty
(
$section
[
'group'
]))
{
...
...
@@ -2270,7 +2295,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this
->
assertSession
()
->
linkExists
(
$labelCheck
[
'label'
]);
}
elseif
(
empty
(
$section
[
'admin-label'
])
&&
!
empty
(
$section
[
'group'
]))
{
// Configure [Expand/
C
ollapse
G
roup
ing of
: {GROUP}].
// Configure
Section
[Expand/
c
ollapse
g
roup: {GROUP}].
$this
->
assertSession
()
->
linkExists
(
$labelCheck
[
'group'
]);
}
// Step 3F: Assert the class and custom data property.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment