Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commerce_oci_checkout
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
commerce_oci_checkout
Commits
1b0eacdd
Commit
1b0eacdd
authored
1 year ago
by
Eirik Morland
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3389631
: phpstan/PHP unit issues
parent
0c90b934
No related branches found
No related tags found
1 merge request
!5
Issue #3389631: phpstan issues
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/src/FunctionalJavascript/OciCheckoutTest.php
+3
-4
3 additions, 4 deletions
tests/src/FunctionalJavascript/OciCheckoutTest.php
tests/src/Kernel/OciKernelTest.php
+26
-2
26 additions, 2 deletions
tests/src/Kernel/OciKernelTest.php
with
29 additions
and
6 deletions
tests/src/FunctionalJavascript/OciCheckoutTest.php
+
3
−
4
View file @
1b0eacdd
...
...
@@ -32,7 +32,7 @@ class OciCheckoutTest extends CommerceWebDriverTestBase {
/**
* {@inheritdoc}
*/
public
function
setUp
()
{
public
function
setUp
()
:
void
{
parent
::
setUp
();
$variation
=
$this
->
createEntity
(
'commerce_product_variation'
,
[
...
...
@@ -44,7 +44,6 @@ class OciCheckoutTest extends CommerceWebDriverTestBase {
],
]);
/** @var \Drupal\commerce_product\Entity\ProductInterface $product */
$this
->
product
=
$this
->
createEntity
(
'commerce_product'
,
[
'type'
=>
'default'
,
'title'
=>
'My product'
,
...
...
@@ -95,8 +94,8 @@ class OciCheckoutTest extends CommerceWebDriverTestBase {
// Should not decode to false.
$this
->
assertTrue
((
bool
)
$json
);
// Should be 2 items of this SKU.
$this
->
assertEqual
(
$json
->
{
"NEW_ITEM-QUANTITY"
}
->
{
"1"
},
"2.00"
);
$this
->
assertEqual
(
$json
->
{
"NEW_ITEM-PRICE"
}
->
{
"1"
},
'39.990000'
);
$this
->
assertEqual
s
(
$json
->
{
"NEW_ITEM-QUANTITY"
}
->
{
"1"
},
"2.00"
);
$this
->
assertEqual
s
(
$json
->
{
"NEW_ITEM-PRICE"
}
->
{
"1"
},
'39.990000'
);
}
}
This diff is collapsed.
Click to expand it.
tests/src/Kernel/OciKernelTest.php
+
26
−
2
View file @
1b0eacdd
...
...
@@ -20,25 +20,47 @@ class OciKernelTest extends CartKernelTestBase {
*/
protected
$product
;
/**
* Variation1.
*
* @var \Drupal\commerce_product\Entity\ProductVariationInterface
*/
protected
$variation1
;
/**
* Variation2.
*
* @var \Drupal\commerce_product\Entity\ProductVariationInterface
*/
protected
$variation2
;
/**
* Modules to enable.
*
* @var array
*/
p
ublic
static
$modules
=
[
p
rotected
static
$modules
=
[
'commerce_oci_checkout'
,
];
/**
* {@inheritdoc}
*/
public
function
setUp
()
{
public
function
setUp
()
:
void
{
parent
::
setUp
();
$variation_storage
=
$this
->
entityTypeManager
->
getStorage
(
'commerce_product_variation'
);
$product_storage
=
$this
->
entityTypeManager
->
getStorage
(
'commerce_product'
);
$product
=
$product_storage
->
create
([
'type'
=>
'default'
,
'title'
=>
'product'
,
]);
$product
->
save
();
$variation1
=
$variation_storage
->
create
([
'product_id'
=>
$product
,
'type'
=>
'default'
,
'title'
=>
'Variation 1'
,
'sku'
=>
strtolower
(
$this
->
randomMachineName
()),
'price'
=>
[
'number'
=>
'39.99'
,
...
...
@@ -47,7 +69,9 @@ class OciKernelTest extends CartKernelTestBase {
]);
$variation1
->
save
();
$variation2
=
$variation_storage
->
create
([
'product_id'
=>
$product
,
'type'
=>
'default'
,
'title'
=>
'Variation 2'
,
'sku'
=>
strtolower
(
$this
->
randomMachineName
()),
'price'
=>
[
'number'
=>
'22.33'
,
...
...
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