Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions modules/customer/commerce_customer.info
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions modules/customer/tests/commerce_customer_ui.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = [];
Expand Down
3 changes: 2 additions & 1 deletion modules/product/tests/commerce_product_ui.test
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions modules/tax/commerce_tax.info
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 16 additions & 6 deletions modules/tax/tests/commerce_tax_ui.test
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/commerce_base.test
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down