Commit Graph

113 Commits

Author SHA1 Message Date
Mike Jolley 01a3e359c3 Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-06-13 10:18:38 +01:00
Mike Jolley 4df54b4e53 Merge branch 'master' 2018-06-07 11:24:12 +01:00
Mike Jolley 58c5ddc8d0 Remove test 2018-06-07 11:23:11 +01:00
Steve Grunwell 317e7ba29f Revert most of 74a3f1d6
As @claudiosanches pointed out, there isn't much real-world need for `WC_Install::get_tables()` to sort results. Instead, sort the returned value within the `WC_Tests_Install::test_get_tables()` method.
2018-05-11 22:46:46 +00:00
Steve Grunwell 74a3f1d6d8 Sort the results of WC_Install::get_tables()
Since custom tables can be registered within WooCommerce via the 'woocommerce_install_get_tables' filter, it's helpful to ensure that `WC_Install::get_tables()` automatically sorts the table names alphabetically.

This helps avoid false failures when testing a plugin that uses a custom table against the WooCommerce core test suite, as queries like `WC_Tests_Install::test_get_tables()` assumes that tables will be returned in alphabetical order.
2018-05-11 16:18:49 +00:00
claudiulodro 9c1179856d Update unit tests 2018-05-01 09:32:29 -07:00
Rodrigo Primo 597033ca6f Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-04-24 13:47:22 -03:00
Peter Fabian 4538f3fa8f Moved wc_selected to core functions. 2018-04-18 15:54:57 +02:00
Mike Jolley 8721d62b67 update test 2018-04-03 14:37:31 +01:00
Rodrigo Primo d55c0d63b1 Add unit tests group 'core-only'
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.
2018-04-02 15:15:23 -03:00
Steve Grunwell 049876ac8f Add the "woocommerce_install_get_tables" filter to WC_Install::get_tables()
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.
2018-03-16 18:54:17 +00:00
Rodrigo Primo 4229b3c5b2 Rename WC_Validation::is_GB_postcode() to WC_Validation::is_gb_postcode()
To follow WP coding standards
2018-03-13 08:49:40 -03:00
Mike Jolley 21d7dbc612 Merge branch 'master' into update/17252 2018-03-01 15:58:17 +00:00
Rodrigo Primo 5be9d1b118 Remove all WC tables when uninstalling the plugin
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.
2018-02-06 11:19:40 -02:00
Rodrigo Primo 13f703fd32 Don't call WC_Install::install() on downgrades
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.
2018-02-05 14:40:51 -02:00
Rodrigo Primo 16a44964f1 Remove unused code from WC_Tests_Install::test_check_version()
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'.
2018-02-05 14:40:43 -02:00
Rodrigo Primo 13351b3d75 phpcs fixes
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.
2018-02-05 14:40:36 -02:00
Mike Jolley 2ed9691c14 Fix shop on homepage with unsupported themes 2018-02-01 11:15:46 +00:00
Mike Jolley 97673e2de8 Fix wc_notice_count logic and add test 2018-01-10 12:43:48 +00:00
Mike Jolley 73d0c1062c Allow transactions to be forced on 2018-01-03 16:13:08 +00:00
Claudiu Lodromanean df2aded066 WC_Query unit tests (#18180)
* Begin WC_Query tests

* Some tests

* WC_Query unit tests
2017-12-18 12:01:27 -02:00
Gerhard Potgieter 25c4a84491 Add more core-functions unit tests (#18190)
* 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
2017-12-18 11:58:40 -02:00
Mike Jolley 4be91ec900 fixed `role="alert"` tests 2017-12-12 18:29:24 +00:00
Claudio Sanches c6f8e95b97 Merge branch 'master' into feature/webhook-crud 2017-11-28 15:09:10 -02:00
Claudio Sanches bf42bfeb93 Fixed unit tests 2017-11-22 17:00:02 -02:00
Claudio Sanches 9fe0c7261e Merge branch 'master' into feature/webhook-crud 2017-11-16 12:20:22 -02:00
Mike Jolley 6e08ff0284
Merge pull request #17610 from woocommerce/update/17557
Theme support to declare image sizes
2017-11-09 16:04:22 +00:00
MounirHamani 9e3d566038
Update unit test to add new Belarusian currency BYN 2017-11-07 20:04:46 +01:00
MounirHamani fc220a51a9
Update unit test for old Belarusian currency BYR 2017-11-07 18:50:01 +01:00
Mike Jolley 6701917e5a Remove need for wc_get_core_supported_themes 2017-11-07 12:17:03 +00:00
Claudio Sanches 368d958be4 Merge branch 'master' into feature/webhook-crud 2017-10-10 16:13:37 -03:00
Mike Jolley 7d7907fc8e Delete installing transient. 2017-10-05 18:11:25 +01:00
Claudio Sanches d0f9b1061e Unit tests 2017-09-05 16:52:20 -03:00
Claudio Sanches a97eb40c2c Removed empty unit test 2017-08-25 20:29:35 -03:00
claudiulodro b8af7164db Harden + fix plugin updates tests 2017-08-22 15:03:54 -07:00
Mike Jolley aaf4c4b134 fix tests 2017-08-22 13:24:29 +01:00
Claudio Sanches 8c120da100 Test webhook functions 2017-08-17 12:29:34 -03:00
claudiulodro e89bef3d52 Update tests to handle related plugins 2017-08-08 10:31:06 -07:00
claudiulodro c8a7ac8940 Unit tests 2017-08-07 14:31:58 -07:00
claudiulodro ce25737026 Remove test for method that doesnt exist any more 2017-08-02 13:37:27 -07:00
claudiulodro 027e7b1f94 Add restored webhook 2017-04-27 11:44:57 -07:00
Claudiu Lodromanean 448d47a78c Sprinkle some periods 2017-03-28 11:15:00 -07:00
Claudiu Lodromanean 28726570bf Use new_* hooks instead of created_* 2017-03-28 11:05:45 -07:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Claudio Sanches 486a81bf12 Fixed coding standards 2017-02-17 16:10:15 -02:00
Claudiu Lodromanean ba2b767006 Modify tests for PHP 5.2 compat 2017-02-15 13:50:25 -08:00
Claudiu Lodromanean fd9d52a3f7 Modify test for PHP <5.4 compatibility 2017-02-15 12:07:35 -08:00
Claudiu Lodromanean e8579c649c Deprecated hook handler unit tests 2017-02-15 11:34:14 -08:00
Mike Jolley f0049367ae Use mb_ functions and add tests 2017-01-22 01:24:20 +00:00
Jon Surrell b422de03ef Add tests for wc_get_logger
When filter provided class doesn't implement
WC_Logger_Interface, test for wc_doing_it_wrong
and use WC_Logger
2017-01-14 18:45:51 +01:00