Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commerce-3184470
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
commerce-3184470
Commits
4231865d
Commit
4231865d
authored
4 years ago
by
Bojan Živanović
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3116756
by bojanz: Get the tests closer to passing on D9
parent
d52bbf27
No related branches found
Branches containing commit
Tags
8.x-2.17
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/src/FunctionalJavascript/CommerceWebDriverTestBase.php
+3
-1
3 additions, 1 deletion
tests/src/FunctionalJavascript/CommerceWebDriverTestBase.php
tests/src/Kernel/CommerceKernelTestBase.php
+6
-0
6 additions, 0 deletions
tests/src/Kernel/CommerceKernelTestBase.php
with
9 additions
and
1 deletion
tests/src/FunctionalJavascript/CommerceWebDriverTestBase.php
+
3
−
1
View file @
4231865d
...
...
@@ -139,11 +139,13 @@ abstract class CommerceWebDriverTestBase extends WebDriverTestBase {
*/
protected
function
assertRenderedAddress
(
array
$address
,
$container
=
'profile'
)
{
$page
=
$this
->
getSession
()
->
getPage
();
$address_text
=
$page
->
find
(
'css'
,
'p.address'
)
->
getText
();
foreach
(
$address
as
$property
=>
$value
)
{
if
(
$property
==
'country_code'
)
{
$value
=
$this
->
countryList
[
$value
];
}
$this
->
assertContains
(
$value
,
$page
->
find
(
'css'
,
'p.address'
)
->
getText
());
// Can't use assertContains() while maintaining D9 compatibility.
$this
->
assertTrue
(
strpos
(
$address_text
,
$value
)
!==
FALSE
);
$this
->
assertSession
()
->
fieldNotExists
(
$container
.
"[address][0][address][
$property
]"
);
}
$this
->
assertSession
()
->
fieldNotExists
(
$container
.
'[copy_to_address_book]'
);
...
...
This diff is collapsed.
Click to expand it.
tests/src/Kernel/CommerceKernelTestBase.php
+
6
−
0
View file @
4231865d
...
...
@@ -56,6 +56,12 @@ abstract class CommerceKernelTestBase extends EntityKernelTestBase {
$factory
->
register
(
new
NumberComparator
());
$factory
->
register
(
new
PriceComparator
());
// Drupal 8.8 installs path_alias automatically, but D9 doesn't.
// However, we can't add path_alias to modules until 8.7 support is dropped.
// @todo Clean up when Drupal 8.7 is no longer supported.
if
(
version_compare
(
\Drupal
::
VERSION
,
'9.0.0-alpha1'
)
>=
0
||
version_compare
(
\Drupal
::
VERSION
,
'9.0.0-dev'
)
==
0
)
{
$this
->
enableModules
([
'path_alias'
]);
}
if
(
\Drupal
::
entityTypeManager
()
->
hasDefinition
(
'path_alias'
))
{
$this
->
installEntitySchema
(
'path_alias'
);
}
...
...
This diff is collapsed.
Click to expand it.
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