diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 199d232c..089be585 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -8,7 +8,7 @@ jobs: - name: Setup env run: | echo "REPO_NAME=${PWD##*/}" >> $GITHUB_ENV - echo 'USE_PHP_V=8.2' >> $GITHUB_ENV + echo 'USE_PHP_V=8.3' >> $GITHUB_ENV - name: Install MariaDB uses: shogo82148/actions-setup-mysql@v1 diff --git a/modules/customer/commerce_customer.info b/modules/customer/commerce_customer.info index 04283b3d..6f2a338e 100644 --- a/modules/customer/commerce_customer.info +++ b/modules/customer/commerce_customer.info @@ -4,6 +4,8 @@ package = Commerce dependencies[] = system (>=1.31.1) dependencies[] = addressfield dependencies[] = commerce +dependencies[] = commerce_checkout dependencies[] = entity + backdrop = 1.x type = module diff --git a/modules/customer/tests/commerce_customer_ui.test b/modules/customer/tests/commerce_customer_ui.test index cbef2f10..f770cd9a 100644 --- a/modules/customer/tests/commerce_customer_ui.test +++ b/modules/customer/tests/commerce_customer_ui.test @@ -405,7 +405,7 @@ class CommerceCustomerUITest extends CommerceBaseTestCase { // Fill in the billing address information $billing_pane = $this->xpath("//select[starts-with(@name, 'customer_profile_billing[commerce_customer_address]')]"); - //$this->backdropPostAJAX(NULL, array((string) $billing_pane[0]['name'] => 'US'), (string) $billing_pane[0]['name']); + $this->backdropPostAJAX(NULL, array((string) $billing_pane[0]['name'] => 'US'), (string) $billing_pane[0]['name']); // Check if the country has been selected correctly, this uses XPath as the // ajax call replaces the element and the id may change @@ -430,8 +430,10 @@ class CommerceCustomerUITest extends CommerceBaseTestCase { // Check the customer profile at database level. $orders = commerce_order_load_multiple(array($order->order_id), array(), TRUE); + $order = reset($orders); - $profile = commerce_customer_profile_load($order->data['profiles']['customer_profile_billing']); + + $profile = commerce_customer_profile_load($order->commerce_customer_billing['und'][0]['profile_id']); $address = $profile->commerce_customer_address['und'][0]; $test = []; diff --git a/modules/product/tests/commerce_product_ui.test b/modules/product/tests/commerce_product_ui.test index 80d40609..a40e1d44 100644 --- a/modules/product/tests/commerce_product_ui.test +++ b/modules/product/tests/commerce_product_ui.test @@ -326,7 +326,8 @@ class CommerceProductUIAdminTest extends CommerceBaseTestCase { $this->backdropGet('admin/commerce/products/' . $product->product_id . '/delete'); $this->pass('Assertions for trying to delete a product associated to a line item:'); - $this->assertText(t('This product is referenced by a line item and therefore cannot be deleted. Disable it instead.', array('@order_num' => $order->order_id)), t('Product delete restriction message is displayed correctly')); + $this->assertText(t('This product is referenced by a line item', array('@order_num' => $order->order_id)), t('Product delete restriction message is displayed correctly')); + $this->assertText(t('and therefore cannot be deleted. Disable it instead.', array('@order_num' => $order->order_id)), t('Product delete restriction message is displayed correctly')); $this->assertFieldByXPath('//input[@id="edit-submit" and @disabled="disabled"]', NULL, t('Delete button is present and is disabled')); } diff --git a/modules/product_reference/commerce_product_reference.module b/modules/product_reference/commerce_product_reference.module index df047ed2..372f5f3e 100644 --- a/modules/product_reference/commerce_product_reference.module +++ b/modules/product_reference/commerce_product_reference.module @@ -279,7 +279,7 @@ function commerce_product_reference_form_commerce_product_product_delete_form_al if ($entity_type == 'commerce_line_item') { // Load the referencing line item. $line_item = reset($data); - $line_item = commerce_line_item_load($line_item->line_item_id); + $line_item = commerce_line_item_load($line_item->entity_id); // Implement a soft dependency on the Order module to show a little // more information in the non-deletion message. diff --git a/modules/tax/commerce_tax.info b/modules/tax/commerce_tax.info index c22e3b14..d189a627 100644 --- a/modules/tax/commerce_tax.info +++ b/modules/tax/commerce_tax.info @@ -4,6 +4,7 @@ package = Commerce dependencies[] = commerce dependencies[] = commerce_line_item dependencies[] = commerce_price +dependencies[] = commerce_product_ui dependencies[] = commerce_product_pricing dependencies[] = entity dependencies[] = rules diff --git a/modules/tax/tests/commerce_tax_ui.test b/modules/tax/tests/commerce_tax_ui.test index a988745e..56588a95 100644 --- a/modules/tax/tests/commerce_tax_ui.test +++ b/modules/tax/tests/commerce_tax_ui.test @@ -14,6 +14,8 @@ class CommerceTaxUIAdminTest extends CommerceBaseTestCase { * Normal user (without admin or store permissions) for testing. */ protected $normal_user; + protected $store_admin; + protected $site_admin; /** * Tax type. @@ -40,6 +42,7 @@ class CommerceTaxUIAdminTest extends CommerceBaseTestCase { // User creation for different operations. $this->store_admin = $this->createStoreAdmin(); + $this->site_admin = $this->createSiteAdmin(); $this->normal_user = $this->backdropCreateUser(array('access checkout', 'view own commerce_order entities')); // Create a dummy tax type for testing. @@ -599,13 +602,17 @@ class CommerceTaxUIAdminTest extends CommerceBaseTestCase { // Create a tax rate VAT Type. $tax_rate = $this->createDummyTaxRate(array('type' => 'vat')); - // Create a new product and product display. - $product_type = $this->createDummyProductDisplayContentType(); - $this->backdropGet('admin/structure/types/manage/' . $product_type->name . '/display/default'); $product = $this->createDummyProduct(); $product_wrapper = entity_metadata_wrapper('commerce_product', $product); $product_node = $this->createDummyProductNode(array($product->product_id)); + // Create a new product and product display. + $product_type = $this->createDummyProductDisplayContentType(); + + $this->backdropLogin($this->site_admin); + $this->backdropGet('admin/structure/types/manage/' . $product_type->name . '/fields'); + + //$this->backdropLogout(); // Login with normal user. $this->backdropLogin($this->normal_user); @@ -616,6 +623,7 @@ class CommerceTaxUIAdminTest extends CommerceBaseTestCase { $products = commerce_product_load_multiple(array($product->product_id), array(), TRUE); $product = reset($products); $price_component = commerce_product_calculate_sell_price($product); + $this->assertText(trim(commerce_currency_format($price_component['amount'], $price_component['currency_code'])), t('Amount with taxes corresponds with the amount displayed in the product display page')); $components = commerce_price_component_load($price_component, $tax_rate['price_component']); $tax_component = reset($components); @@ -629,12 +637,14 @@ class CommerceTaxUIAdminTest extends CommerceBaseTestCase { // Create a tax rate VAT Type. $tax_rate = $this->createDummyTaxRate(array('type' => 'vat')); - // Create a new product and product display. - $product_type = $this->createDummyProductDisplayContentType(); - $this->backdropGet('admin/structure/types/manage/' . $product_type->name . '/display/default'); $product = $this->createDummyProduct(); $product_node = $this->createDummyProductNode(array($product->product_id)); + // Create a new product and product display. + $product_type = $this->createDummyProductDisplayContentType(); + $this->backdropLogin($this->site_admin); + $this->backdropGet('admin/structure/types/manage/' . $product_type->name . '/fields'); + // Login with store admin user. $this->backdropLogin($this->store_admin); diff --git a/tests/commerce_base.test b/tests/commerce_base.test index 489244b1..880a0b13 100644 --- a/tests/commerce_base.test +++ b/tests/commerce_base.test @@ -16,7 +16,7 @@ class CommerceBaseTestCase extends BackdropWebTestCase { protected $store_customer; protected $fields; protected $checkout_url; - protected $profile = 'minimal'; + protected $profile = 'standard'; protected $product; protected $product_node; protected $other_user;