Skip to content
Snippets Groups Projects
Commit 1b0eacdd authored by Eirik Morland's avatar Eirik Morland
Browse files

Issue #3389631: phpstan/PHP unit issues

parent 0c90b934
No related branches found
No related tags found
1 merge request!5Issue #3389631: phpstan issues
......@@ -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->assertEquals($json->{"NEW_ITEM-QUANTITY"}->{"1"}, "2.00");
$this->assertEquals($json->{"NEW_ITEM-PRICE"}->{"1"}, '39.990000');
}
}
......@@ -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
*/
public static $modules = [
protected 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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment