Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
87 stars 33 forks source link

HPOS: Fix remaining non-HPOS compatible tests #455

Closed prettyboymp closed 1 year ago

prettyboymp commented 1 year ago

Fixes #391

Description

This updates the remaining unit tests that were previously marked as incomplete in #449 to be compatible with HPOS.

With this applied, there are still 4 remaining failing tests with HPOS enabled that are caused by bugs in source code that will need to be address separately.

1) WCS_Functions_Test::test_wcs_get_subscription

452

2) WCS_Functions_Test::test_2_wcs_get_subscriptions

453

3) WCS_Functions_Test::test_5_wcs_get_subscriptions

452

454

4) WCS_Order_Functions_Test::test_wcs_get_subscription_orders

448

How to test this PR

Run the unit tests with HPOS enabled and disabled.

  1. HPOS disabled: ./vendor/bin/phpunit
  2. HPOS enabled: HPOS=1 ./vendor/bin/phpunit
prettyboymp commented 1 year ago

Looks like I'll need to revert the changes to use expectNotToPerformAssertions(). I didn't realize we're using older PHPUnit version for PHP < 7.3.