Commit Graph

1298 Commits

Author SHA1 Message Date
claudiulodro 8cf36aa0d2 New shortcode features for products block 2018-03-01 10:05:22 -08:00
Mike Jolley bec084ac16
Merge pull request #18493 from liquidweb/tests/api-system-status
Add tests for the "add_order_indexes" system status tool
2018-03-01 12:03:29 +00:00
Mike Jolley 8faedcb849
Merge pull request #18489 from liquidweb/tests/reports
Add tests around order reporting
2018-03-01 12:02:59 +00:00
Rodrigo Primo 0f79567d06 Merge branch 'master' into update/improve-get-downloads 2018-02-28 13:34:11 -03:00
Claudiu Lodromanean 5346f63abc
Merge pull request #19159 from woocommerce/fix/19124
Use subtotal for discounts in admin/orders
2018-02-27 11:27:01 -08:00
Mike Jolley 6b722e1120 Update tests to use subtotal as a basis for the discounts. 2018-02-27 18:57:28 +00:00
Claudio Sanches e2e8a7bfd1 Fixed PHPUnit path 2018-02-27 14:24:40 -03:00
Claudio Sanches 1fcb5e8be3 Force PHPUnit 6 in Travis 2018-02-27 14:20:13 -03:00
Claudio Sanches 5a19861544 Run composer in all tests 2018-02-27 14:11:17 -03:00
Claudio Sanches 1239ab033f Use phpunit installed by composer while running tests on travis 2018-02-27 14:06:06 -03:00
Caleb Burks 4a4aa84e26 Add a test 2018-02-22 15:06:53 -05:00
Mike Jolley 7c61f05bb1
Merge pull request #18620 from woocommerce/fix/get-downloads-order-by
Fix: properly set orderby and order when calling WC_Customer_Download_Data_Store::get_downloads()
2018-02-19 14:44:21 +00:00
Mike Jolley d5a1463e3e
Merge pull request #18595 from woocommerce/update/add-ext-object-cache-to-system-status
Display whether or not external object cache is enabled
2018-02-19 14:40:14 +00:00
Mike Jolley 5feed3e0cc Merge branch 'master' into update/add-ext-object-cache-to-system-status 2018-02-19 14:39:31 +00:00
Steve Grunwell 7878a9582f Merge branch 'master' into tests/api-system-status 2018-02-15 23:16:58 +00:00
Steve Grunwell 19a35d630a Merge branch 'master' into tests/reports 2018-02-15 23:12:10 +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
Mike Jolley 8fb8039b23
Merge pull request #18818 from woocommerce/fix/prevent-unsupported-downgrade
Don't call WC_Install::install() on downgrades
2018-02-06 12:46:42 +00: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
Claudio Sanches 0755038e8d
Merge pull request #18505 from liquidweb/feature/post-system-status-tool-hook
Add a hook after executing a REST system status tool
2018-02-02 14:19:03 -02:00
Mike Jolley db54911443
Merge pull request #18752 from woocommerce/refactor/background-processing
Introduced new WC_Background_Process abstract class
2018-02-01 16:18:56 +00:00
Claudio Sanches b811dbbaec Applied new WC_Background_Process class 2018-02-01 11:42:34 -02:00
Mike Jolley 2ed9691c14 Fix shop on homepage with unsupported themes 2018-02-01 11:15:46 +00:00
Mike Jolley c8b14b6f76 Increase precision from 4 to 6 2018-01-30 15:00:53 +00:00
Rodrigo Primo 2feacfb47a Display whether or not external object cache is enabled
This commit adds a new line to the section "WordPress environment" of the system status page to indicate whether or not WP external object cache is enabled.
2018-01-29 15:56:01 -02:00
Rodrigo Primo 75fc594013 Manually fix coding standard violations that can't be fixed with phpcbf 2018-01-29 15:55:43 -02:00
Rodrigo Primo a15ecc1601 Automatically fix coding standard violations using phpcbf 2018-01-29 15:53:54 -02:00
Rodrigo Primo 9c4c006baa Fix: set orderby and order when calling WC_Customer_Download_Data_Store::get_downloads()
This commit fixes a bug in WC_Customer_Download_Data_Store::get_downloads() that made impossible to change the order in which the query returned the results. This method accepts the arguments `order_by` and `order` but it was ignoring them and always using the default values ('permission_id' and 'ASC' respectively).

One of the assertions of the WC_Customer_Download_Data_Store::get_downloads() test method was modified to make sure the code now works.

This bug was introduced by commit a443419.
2018-01-26 15:55:13 -02:00
Rodrigo Primo 07d00fc58e Make WC_Customer_Download() tests a bit faster
This commit simplifies WC_Customer_Download() tests by using hardcoded values for customer ID and e-mail instead of touching the database and creating a real customer for each test.
2018-01-26 15:44:23 -02:00
Steve Grunwell 16b59b60a0 Merge branch 'master' into feature/post-system-status-tool-hook 2018-01-24 01:45:44 +00:00
Rodrigo Primo 1195cf9eee Improve WC_Customer_Download_Data_Store::get_downloads() performance
This commit improves WC_Customer_Download_Data_Store::get_downloads() performance by changing the way the SQL query is built. Before this change, this method would get all table fields even when just the permission_id field is returned. Now the method will get from the database only the fields that will be returned. The fields retrieved from the database can be controlled using the parameter `$args['return']`:

- 'objects' (default): all fields are retrieved from the database and an array of WC_Customer_Download objects is returned.
- 'ids': gets and return only permision_ids
- comma separated list of fields (new option added by this commit): gets and return only the required fields. Examples: 'user_email,download_id,order_id' or 'order_id,download_count'.
2018-01-22 17:25:26 -02:00
Claudiu Lodromanean 1e2cdb67ad
Merge pull request #18535 from woocommerce/update/disable-all-payment-gateways-by-default
Disable all payment gateways by default
2018-01-22 11:04:21 -08:00
Rodrigo Primo 656356530a Use setUp() method in WC_Customer_Download() tests to remove code duplication 2018-01-22 14:43:28 -02:00
Rodrigo Primo 9eeb4cd0bd Add assertion to check WC_Customer_Download_Data_Store::get_downloads() when called with the 'return' param set to 'ids' 2018-01-22 11:01:00 -02:00
Rodrigo Primo 6bb79681b9 Fix PHPCS violations in class-wc-tests-customer-download.php 2018-01-22 10:59:09 -02:00
Steve Grunwell 183c1e9f9f Add 'public' visibility declarations to coupon test methods 2018-01-22 04:13:13 +00:00
Steve Grunwell 553aede081 Use strict comparison in test_wc_coupons_enabled() 2018-01-22 04:11:02 +00:00
Steve Grunwell 031469f643 Remove an unused variable in the test 2018-01-22 04:10:38 +00:00
Steve Grunwell 21771ebbd3 Ensure that WP_Coupon instances are instantiated with parentheses 2018-01-22 04:10:14 +00:00
Steve Grunwell 7cb8f46b0a *WHITESPACE ONLY* Equal sign and arrow alignment 2018-01-22 04:06:42 +00:00
Steve Grunwell 0766ed6ff7 Fix (or whitelist) coding standards violations in the test bootstrap file 2018-01-22 03:34:13 +00:00
Steve Grunwell bb5417c102 require_once is a language construct, not a function, and thus doesn't require parentheses. 2018-01-22 03:24:52 +00:00
Paul Dechov 0eebd2b72a Update payment gateway default enabled state in tests 2018-01-19 17:42:17 -05:00
Steve Grunwell 4d6a0ecb82 Merge branch 'master' into feature/post-system-status-tool-hook 2018-01-18 21:54:47 +00:00
Brent Sessions a01270f392 Rearranging some variables 2018-01-18 12:36:22 -08:00
Brent Sessions 45bf9d6805 Update install script to account for forked branch 2018-01-18 12:26:46 -08:00
Steve Grunwell 6aeba1d72a Instead of testing the output of the message, verify that the postmeta fields are being re-created. 2018-01-18 18:52:57 +00:00
Brent Sessions e372d55a3c Run e2e tests on Travis builds (#18374) 2018-01-18 16:42:19 -02:00