Commit d1738ab1 authored by mikelutz's avatar mikelutz Committed by bojanz

Issue #3008971 by mikelutz: Tests are failing on PHP 7.2

parent f75e72f5
......@@ -13,6 +13,7 @@ sudo: false
dist: precise
php:
- 7.2
- 7.1
- 7.0
......
......@@ -116,7 +116,7 @@ class OrderAdminTest extends OrderBrowserTestBase {
$this->assertSession()->pageTextContains('The order has been successfully saved.');
$this->drupalGet('/admin/commerce/orders');
$order_number = $this->getSession()->getPage()->find('css', 'tr td.views-field-order-number');
$order_number = $this->getSession()->getPage()->findAll('css', 'tr td.views-field-order-number');
$this->assertEquals(1, count($order_number), 'Order exists in the table.');
$order = Order::load(1);
......
......@@ -21,7 +21,7 @@ class ProductTypeTest extends ProductBrowserTestBase {
$this->assertNotEmpty(!empty($product_type), 'The default product type is available.');
$this->drupalGet('admin/commerce/config/product-types');
$rows = $this->getSession()->getPage()->find('css', 'table tbody tr');
$rows = $this->getSession()->getPage()->findAll('css', 'table tbody tr');
$this->assertEquals(count($rows), 1, '1 product type is correctly listed.');
}
......
......@@ -31,7 +31,7 @@ class ProductVariationTypeTest extends ProductBrowserTestBase {
$this->assertNotEmpty(!empty($variation_type), 'The default product variation type is available.');
$this->drupalGet('admin/commerce/config/product-variation-types');
$rows = $this->getSession()->getPage()->find('css', 'table tbody tr');
$rows = $this->getSession()->getPage()->findAll('css', 'table tbody tr');
$this->assertEquals(count($rows), 1, '1 product variation type is correctly listed.');
}
......
......@@ -76,7 +76,7 @@ class CouponTest extends CommerceBrowserTestBase {
$this->getSession()->getPage()->fillField('code[0][value]', $code);
$this->submitForm([], t('Save'));
$this->assertSession()->pageTextContains("Saved the $code coupon.");
$coupon_count = $this->getSession()->getPage()->find('xpath', '//table/tbody/tr/td[text()="' . $code . '"]');
$coupon_count = $this->getSession()->getPage()->findAll('xpath', '//table/tbody/tr/td[text()="' . $code . '"]');
$this->assertEquals(count($coupon_count), 1, 'Coupon exists in the table.');
$coupon = Coupon::load(1);
......
......@@ -79,7 +79,7 @@ class PromotionTest extends CommerceBrowserTestBase {
$this->submitForm([], t('Save'));
$this->assertSession()->pageTextContains("Saved the $name promotion.");
$promotion_count = $this->getSession()->getPage()->find('xpath', '//table/tbody/tr/td[text()="' . $name . '"]');
$promotion_count = $this->getSession()->getPage()->findAll('xpath', '//table/tbody/tr/td[text()="' . $name . '"]');
$this->assertEquals(count($promotion_count), 1, 'promotions exists in the table.');
$promotion = Promotion::load(1);
......@@ -123,7 +123,7 @@ class PromotionTest extends CommerceBrowserTestBase {
$this->submitForm($edit, t('Save'));
$this->assertSession()->pageTextContains("Saved the $name promotion.");
$promotion_count = $this->getSession()->getPage()->find('xpath', '//table/tbody/tr/td[text()="' . $name . '"]');
$promotion_count = $this->getSession()->getPage()->findAll('xpath', '//table/tbody/tr/td[text()="' . $name . '"]');
$this->assertEquals(count($promotion_count), 1, 'promotions exists in the table.');
/** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItem $offer_field */
......
......@@ -67,8 +67,8 @@ class StoreTest extends CommerceBrowserTestBase {
}
$this->submitForm($edit, t('Save'));
$this->assertSession()->pageTextContains("Saved the $name store.");
$store_count = $this->getSession()->getPage()->find('css', '.view-commerce-stores tr td.views-field-name');
$this->assertEquals(count($store_count), 1, 'Stores exists in the table.');
$store_count = $this->getSession()->getPage()->findAll('css', '.view-commerce-stores tr td.views-field-name');
$this->assertEquals(2, count($store_count));
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment