This group is used to identify unit tests that will work only when testing WC core. This is necessary since we are using WC core unit tests to test the custom product tables plugin and some tests should be skipped in this context.
This commit adds a new filter, "woocommerce_install_get_tables", to the WC_Install::get_tables() method, enabling WooCommerce extensions to register new, WooCommerce-specific tables, ensuring these tables can be cleaned up automatically should WooCommerce be uninstalled (useful for things like custom table data stores). Nothing gets added by default, but this provides an integration point for plugins like WooCommerce Custom Orders Table.
There were two outdated lists of WC tables. One used to drop tables when WC is uninstalled and another one to drop tables when a site is deleted in a multi site environment. This commit creates a new unified list of WC tables, adds the missing tables to this list and introduces a unit test that will fail if the list gets outdated.
WC doesn't support downgrades but the if condition that decides whether or not to call WC_Install::install() and apply database schema changes was checking if the WC version stored in the database is equal to the WC version in the code. This commit changes the check performed inside the if condition to verify if the WC version stored in the database is smaller than the version in the code. This way `dbDelta()` won't be called automatically by WC and revert database schema changes. This is particulary important for clustered providers where the version of the WC code running in one of the containers could be outdated and trigger a database downgrade.
To test the method WC_Install::check_version() it is not necessary to update the of the option 'woocoommerce_db_version' as this method uses only 'woocommerce_version'.
Removed the print_r() call as phpcs was complaining about it and there is no need to output the version values as phpunit will do that if the test fails.
* Pass through additional args to wc_create_order in test
* Pass extra args to wc_create_order to improve coverage, test WP_Error check of wc_create_order
* wc_get_template_part test
* wc_enqueue_js test
* wc_get_log_file_name test
* wc_get_page_children test
* hash_equals test
* wc_rand_hash test
* wc_transaction_query test
* Fix script test and phpcs stuff
* Fix widget tests
* Move tests to correct file and fix phpcs