Commit Graph

2494 Commits

Author SHA1 Message Date
Peter Fabian d3a33f8d05
Merge pull request #24943 from woocommerce/refactor/eu-vat-brexit
Brexit and VAT refactor
2020-02-05 19:41:40 +01:00
Christopher Allford 92708dde1f
Merge pull request #25512 from woocommerce/fix/25438.2
Fixed unnecessary loading when constructing COD payment gateway
2020-02-05 10:02:38 -08:00
Peter Fabian 5ba2cdafa5
Merge pull request #25183 from om4james/webhook-de-duplication
Fix for Duplicate Webhook deliveries
2020-02-05 18:38:15 +01:00
Claudio Sanches 5b9937ad48 Merge branch 'master' into try/add-wc-admin 2020-02-05 13:02:51 -03:00
Claudio Sanches 545a74fe64 Fixed coding standards 2020-02-05 11:55:19 -03:00
Christopher Allford 2f024ff024 Added tab check to COD gateway options loading 2020-02-05 06:49:33 -08:00
Claudio Sanches f5d2c98c3e Updated unit test 2020-02-05 11:16:29 -03:00
Claudio Sanches 74768d8abd Remove test 2020-02-05 11:13:16 -03:00
Rodrigo Primo f539d3e04b Merge branch 'master' into update/emogrifier 2020-02-05 10:01:38 -03:00
Rodrigo Primo ff05b06e6b Merge branch 'master' into update/emogrifier 2020-02-05 09:56:03 -03:00
Peter Fabian 87e42acd56
Merge branch 'master' into try/add-wc-admin 2020-02-05 13:02:20 +01:00
vedanshujain d19c470686 Add sanity test around order and customer permissions 2020-02-05 15:42:15 +05:30
Paul Sealock b7a9056a59 cleanup 2020-02-04 16:01:57 -08:00
Paul Sealock 2619f37b51 phpcs errors 2020-02-04 16:01:57 -08:00
Paul Sealock 4380087608 wc-admin: Include package 2020-02-04 16:01:57 -08:00
Christopher Allford b9ceabaa52 Utilized the constants package to fix the failing tests 2020-02-04 15:50:23 -08:00
Christopher Allford 1d15df860e Merge branch 'master' into fix/25438.2 2020-02-04 15:06:26 -08:00
Christopher Allford 57734ca8ce Merge branch 'master' into refactor/add-jetpack-constants 2020-02-04 14:36:35 -08:00
Garrett Hyder 6295534fbb Adds support for group_description for privacy exporters which was added in WP5.3 through WPCoreChangeset#45825 and WPCoreTracTicket#45491 2020-02-04 12:57:31 -08:00
Rodrigo Primo fb3b977a16 Add test to make sure that negative fees never make order total negative
For some reason unknown to me, the following commit added logic to make
sure that negative fees never make the order total negative: 804feb9333

Probably by accident, commit 4326e39250 changed this logic when `$fees_total += $item->get_total()` was replaced by `$fees_total += $fee_total`:

4326e39250 (diff-9b4164165828b26c4b7aec01c7b17884R1594)

This commit adds a failing test that ensures that the old behavior is
tested. This test needs to be fixed before we merge the changes proposed
in PR #25504.
2020-02-04 15:33:21 -03:00
Rodrigo Primo 08e0936aa6 Improve coverage of WC_Abstract_Order::calculate_totals() test
This commits improves the coverage of the
WC_Abstract_Order::calculate_totals() test by including a fee to the
order used to test the method.
2020-02-04 15:26:52 -03:00
Rodrigo Primo b87d0e26fe Add basic unit test for WC_Abstract_Order::get_total_fees() 2020-02-04 15:13:27 -03:00
Claudio Sanches 94d1b742ad
Merge pull request #25545 from woocommerce/prep/after-3.9
Bumped versions for the upcoming release.
2020-02-04 13:05:27 -03:00
Peter Fabian 4a506ebcf7
Merge pull request #25530 from woocommerce/fix/country-region-label
Fix/country region label
2020-02-04 13:54:22 +01:00
Peter Fabian f57fef5bdd Updated unit tests. 2020-02-04 13:45:28 +01:00
Christopher Allford c5e1fc6c45 Merge remote-tracking branch 'origin/master' into refactor/add-jetpack-constants 2020-02-03 11:50:16 -08:00
Peter Fabian e613056634 This perhaps better represents the spirit of the test. 2020-02-01 14:19:22 +01:00
Christopher Allford 1d1413b4ee Replaced direct access of many constants with the Constants library 2020-01-31 22:18:47 -08:00
Peter Fabian 132ced6039 Fixed test for 4.0. 2020-01-31 21:05:50 +01:00
Peter Fabian 6410ef9156 Updated since tags for the upcoming version. 2020-01-31 18:03:54 +01:00
Christopher Allford b6046930c6 Corrected a misspelled filter name 2020-01-30 18:12:00 -08:00
Christopher Allford 8a046ab0cd Cleaned up the template path replacement and fixed the wc_cache_set positioning 2020-01-30 16:24:07 -08:00
Peter Fabian a9a64fcee0
Merge pull request #25482 from woocommerce/fix/cart-e2e-test
Fix failing cart e2e test: fix setup wizard logic if new onboarding is presented
2020-01-30 12:51:56 +01:00
Julia Amosova 3dfc8f3dc5 Remove unnecessary 2nd setup wizard flow for the new onboarding 2020-01-30 11:29:28 +00:00
Julia Amosova 18d93e321a Update setup wizard test logic 2020-01-30 10:38:10 +00:00
Claudio Sanches 052fbfcb8c Test WC_Email::style_inline() 2020-01-29 17:07:18 -03:00
Christopher Allford 6ad091a9b7 Changed all of the constant accesses into corresponding Automattic\Jetpack\Constants usages 2020-01-28 21:21:29 -08:00
Christopher Allford bb09a8a4ea Prevented the COD payment gateway's "enable_for_methods" option loading outside of correct use-cases
Note: The tests fail in this commit because of the defines. Ran individually there are no problems, but I'm going to make another PR to merge in a package to make testing constants possible, and then come back to fix this after it gets merged.
2020-01-28 14:33:53 -08:00
Claudio Sanches b3ea0b17b4 Merge branch 'master' into refactor/eu-vat-brexit 2020-01-27 13:15:54 -03:00
Julia Amosova 0a5c866bc4 Remove taking screenshots sent to AWS on failed tests 2020-01-24 17:17:52 +00:00
Julia Amosova d4c8719d1f Remove the process of building legacy e2e test site 2020-01-24 17:05:18 +00:00
Julia Amosova eb92d35d96 Remove DB (used for the initial setup) that is no longer needed 2020-01-24 17:05:17 +00:00
Julia Amosova 2415cf1952 Fix setup wizard logic if new onboarding is presented 2020-01-24 14:37:27 +00:00
Julia Amosova 26ade8bb1f Add 1 second wait time between 2 UI blocks / AJAX calls 2020-01-22 16:52:35 +00:00
Rodrigo Primo 4e58f77575
Merge pull request #25322 from woocommerce/pr-25242
Prevent fatal error in set_current_gateway with no WC session
2020-01-17 09:54:03 -03:00
Rodrigo Primo 2668bf6025
Merge pull request #25314 from woocommerce/fix/24746
Removed the lowercase conversion of product search terms
2020-01-16 16:29:07 -03:00
Rodrigo Primo 8aad482bc1 Fix typo 2020-01-16 15:31:50 -03:00
Rodrigo Primo cb85c981ac Merge branch 'master' into pr-25242 2020-01-16 15:30:58 -03:00
Claudio Sanches bccb93fa3c
Merge pull request #25378 from woocommerce/fix/25361
Add license key support to MaxMind GeoLite2 database downloads
2020-01-15 20:51:14 -03:00
Rodrigo Primo 793dba81f1 Fix failing unit test
This commit fixes the unit test
WC_Tests_API_Functions::test_wc_rest_upload_image_from_url_should_return_error_when_invalid_image_is_passed() which was failing due to a change in a WordPress core message with the following error:

```
2) WC_Tests_API_Functions::test_wc_rest_upload_image_from_url_should_return_error_when_invalid_image_is_passed

Failed asserting that two strings are equal.

--- Expected

+++ Actual

@@ @@

-'Invalid image: File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.'

+'Invalid image: File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini file or by post_max_size being defined as smaller than upload_max_filesize in php.ini.'

/home/travis/build/woocommerce/woocommerce/tests/unit-tests/util/api-functions.php:89
```

(https://travis-ci.org/woocommerce/woocommerce/jobs/637353161#L402)

This test only fails when using WordPress nightly build (the yet to be
released WP 5.4).

To fix this problem, this commit adds an if statement to check for different error
messages depending on the WordPress version that is being used to run
the tests. In the future, we might want to refactor this test to remove
its dependency to a WordPress error message to make it more robust and
stable.
2020-01-15 11:17:49 -03:00
Claudio Sanches 992e13fb08 Updated implementation of geolite2 2020-01-14 16:24:07 -03:00
Christopher Allford 7a5083e47b Revert "Added a database option to allow for selecting different MaxMind databases"
This reverts commit d32c470cea.
2020-01-13 14:41:24 -08:00
Christopher Allford d32c470cea Added a database option to allow for selecting different MaxMind databases 2020-01-13 14:10:08 -08:00
Christopher Allford 6d3a3053c5 Moved the database file into the woocommerce_uploads folder 2020-01-13 08:53:43 -08:00
Christopher Allford 645affb7f3 Removed permanently failing unit test for deprecated GeoLite2 library integration 2020-01-13 08:17:11 -08:00
Christopher Allford 4f6aec61fd Added support for a randomized MaxMind database file prefix 2020-01-13 08:16:44 -08:00
vedanshujain f0f3b21a36 Added unit tests for setting current gateway 2020-01-13 14:18:59 +05:30
Claudio Sanches f253c87096 Fixed unit tests 2020-01-10 17:14:44 -03:00
Claudio Sanches 49aed6f6ca Remove alternatives for deprecated methods 2020-01-10 16:31:27 -03:00
Claudio Sanches 48547143f4 Fixed integration ID 2020-01-10 15:02:56 -03:00
Christopher Allford f5cbca5beb Added unit tests for the MaxMind integration class 2020-01-10 02:47:43 -08:00
Christopher Allford 19ded6609d Refactored the MaxMind database class to not use static methods in order to make testing the integration class easier 2020-01-10 02:09:51 -08:00
Christopher Allford bbbfc3bfab Moved the MaxMind geolocation lookup into the integration class 2020-01-09 23:46:25 -08:00
Christopher Allford f91ff82806 Moved the loading of the database class into the integration 2020-01-09 21:29:47 -08:00
Christopher Allford bf057927ae Moved the loading of integration classes into the WC_Autoloader 2020-01-09 15:46:01 -08:00
Christopher Allford 3e597e6f68 Replaced the Geolocation database fetching functionality with MaxMind integration 2020-01-09 00:31:51 -08:00
Christopher Allford f23c26a9f9 Fixed a permissions conflict caused by the dummy GeoLite2 archive's date
The test would fail if the web server had stored the data already!
2020-01-08 22:56:07 -08:00
Christopher Allford 95e59fc777 Made the database service class methods static for convenience \ 2020-01-08 21:59:04 -08:00
Christopher Allford 1eb49ef8b8 Added filterable support for fetching the database path
This replaces the corresponding geolocation class functionality. We are deprecating the woocommerce_geolocation_local_database_path filter in favor of the woocommerce_maxmind_geolocation_databse_path filter. Since we want the option to turn this into a feature plugin, it's wise to make sure nothing is too generic.
2020-01-08 21:48:05 -08:00
Christopher Allford 46d7f16b19 Added support for downloading and extracting the GeoLite2 database 2020-01-08 21:09:35 -08:00
Christopher Allford a477f9367d Added support for creating default integrations 2020-01-08 21:05:14 -08:00
Claudio Sanches 85a077b939 Coupon race condition prevention 2020-01-06 19:44:24 -03:00
Claudio Sanches 2ce4a60ff1
Remove old unit test 2020-01-06 19:37:47 -03:00
Vedanshu Jain d76c5b734c
Merge pull request #25300 from woocommerce/fix/25274-docker-mount-dir
E2E Tests: mount directory instead of copy.
2019-12-26 17:36:14 +05:30
vedanshujain 42dd1bf32b Add an address so that shipping can be calculated 2019-12-26 14:04:52 +05:30
vedanshujain 31726d1a37 Update version numbers 2019-12-26 13:55:43 +05:30
Christopher Allford ac22406763 Fixed the unit tests broken by the requirement that a valid address must be set to calculate shipping rates 2019-12-26 13:55:43 +05:30
Christopher Allford 027257f624 Changed the dummy postal code in the order helper to a valid one 2019-12-26 13:55:42 +05:30
Christopher Allford c54fa91145 Added unit tests for checking whether a package is shippable or not 2019-12-26 13:55:41 +05:30
Christopher Allford e800b40ad6 Made packages with incomplete destinations unshippable 2019-12-26 13:55:41 +05:30
Christopher Allford 874be93c14 Removed the lowercase conversion of product search terms
When searched in a case sensitive manner, the conversion to lowercase causes uppercase matches that would have been found to be lost. This change increases the tolerance of the OR search format while also removing this unintended side-effect.
2019-12-24 15:00:40 -08:00
Jeff Stieler 7c0511baaa Fix typo in docker service name. 2019-12-23 13:14:14 -05:00
Jeff Stieler 5c67310e48
Fix typo in test installation instructions. (#25298) 2019-12-23 11:32:54 -05:00
Rodrigo Primo 487f96d844 Fix WordPress.DateTime.CurrentTimeTimestamp vilations
This commit fixes all violations of the WordPress.DateTime.CurrentTimeTimestamp sniff automatically using phpcbf.
2019-12-20 14:23:05 -03:00
Rodrigo Primo 62d6b05b58 Fix Generic.Formatting.MultipleStatementAlignment violations
This commit fixes all violations of the Generic.Formatting.MultipleStatementAlignment sniff automatically using phpcbf.
2019-12-20 14:21:08 -03:00
Rodrigo Primo 94373f78ea Fix WordPress.Arrays.MultipleStatementAlignment errors automatically using phpcbf 2019-12-20 13:51:26 -03:00
Julia Amosova 8854d0d074 Update comments in `run-e2e-CI.sh` 2019-12-20 00:10:44 +00:00
Julia Amosova 9397565d22 Add max amount of time waiting for the Docker container to be built 2019-12-19 22:48:03 +00:00
vedanshujain ff2a8a58f2 Commented out flaky test 2019-12-17 19:13:19 +05:30
vedanshujain 9b7343d23b Applied coding standards 2019-12-17 19:13:19 +05:30
vedanshujain 53bfcea110 Use same filter for stocks and coupon for consistency. 2019-12-17 19:13:19 +05:30
vedanshujain 72545c44b7 Add support for `_held_for_checkout` records to improve performance.
This will also improve transactional stability and avoid race conditions by providing a way to lock usage counts.
2019-12-17 19:13:19 +05:30
Julia Amosova 1658dd3962 Make setup wizard test more stable 2019-12-15 22:55:39 +00:00
Julia Amosova f9a9fbc2c7 Pass jest exit code to npm 2019-12-15 22:34:35 +00:00
Julia Amosova 88fa2885fc Update jest version 2019-12-15 19:13:28 +00:00
Julia Amosova 4e134f8ec4 Testing Docker build on Travis 2019-12-15 17:54:33 +00:00
Julia Amosova c1b358929b Add page creation & check for Docker container status to run e2e tests 2019-12-15 16:44:40 +00:00
Julia Amosova 5645f5882a Add check for Docker container to be built on Travis when post is created 2019-12-15 16:04:06 +00:00
Julia Amosova 14afe36204 Add check for Docker container to be built on Travis 2019-12-15 15:32:26 +00:00
Julia Amosova 53dcdd77b3 Update Docker + Travis setup 2019-12-15 13:09:29 +00:00
Julia Amosova cff1272b7e Add check for new setup wizard flow & fix ship to different address click 2019-12-11 17:15:37 +00:00
Julia Amosova 90ddb08765 Merge branch 'new/puppeteer-screenshot-tester' into new/front-end-checkout-e2e-test 2019-12-11 14:54:39 +00:00
Julia Amosova 29671dd9ec Resolving conflict with master branch 2019-12-11 14:53:07 +00:00
Julia Amosova 900289c191 Update the way `ship to different address` checkbox is set 2019-12-11 12:27:41 +00:00
Julia Amosova 47ecd75479 Wait for Recommended section elements to be visible in the obw test 2019-12-11 12:18:31 +00:00
Julia Amosova c7d4989f01 Update clicks in obw and checkout tests & productIsInCheckout function 2019-12-11 12:02:44 +00:00
Claudio Sanches 2975b3a7b7 Rate limit feature 2019-12-11 01:38:19 -03:00
Claudio Sanches f7632de06e
Merge pull request #25164 from om4james/webhook-delete-cache
Delete cached webhook data when a webhook is deleted
2019-12-10 22:45:42 -03:00
Claudio Sanches 523c72f265 Fix WordPress nightly unit tests (#25198)
* Remove images after uploaded in WC_Tests_Product_Data

* Remove attachment after test

* Fixed image_id
2019-12-10 13:57:52 -03:00
Claudio Sanches 104f40c36e
Merge pull request #24281 from woocommerce/fix/24269
Handle multiple decimal points
2019-12-09 14:07:29 -03:00
Francesco Leanza 59af851069
Merge branch 'master' into fix/25091 2019-12-09 16:46:02 +01:00
Andrej Mernik d20d429e32 Add postcode validation for Slovenia (#25174)
Add postcode validation for Slovenia
2019-12-09 10:09:45 -03:00
Julia Amosova bf8ce8dcd7 Wait for the Recommended section to load in the setup wizard test 2019-12-09 09:51:13 +00:00
Julia Amosova 2477d07b48 Various improvements to e2e tests 2019-12-06 15:06:48 +00:00
Claudio Sanches b4af5f3c89 Updated regex to allow only one decimal point 2019-12-06 11:11:47 -03:00
Claudio Sanches e535a16b48 Fixed unit tests 2019-12-06 11:00:40 -03:00
James Collins 596ac29ba4 phpcs fixes 2019-12-06 10:34:59 +08:00
James Collins 7c5d06c309 Unit test to demonstrate the problem of duplicate webhook deliveries occurring 2019-12-06 09:41:33 +08:00
James Collins 0246b02a94 Merge branch 'master' into webhook-delete-cache 2019-12-06 08:57:54 +08:00
Claudio Sanches 8dbf7edb6f Fixed unit tests 2019-12-05 21:26:03 -03:00
Rodrigo Primo 27915dd696 Exception when WC_Product_Variation is instantiated with the wrong type
This commits changes WC_Product_Variation to raise an exception when the
class is instantiated with an ID that belongs to a post object that is
not a product variation.

This is necessary to avoid problems like the one described in #24956
where passing a variable product ID to WC_Product_Variation would result
in transparently modifying the variable product title and excerpt.
2019-12-05 15:45:48 -03:00
Claudio Sanches d7e2a98aaf
Merge pull request #24828 from woocommerce/fix/24695
Adds shared code between Orders and Cart calculation logic.
2019-12-05 12:39:50 -03:00
Peter Fabian 4dfa68b62d More PHPCS fixes. 2019-12-05 15:46:13 +01:00
Peter Fabian 9b398947dd Fixed the test by sleeping longer. 2019-12-05 15:17:34 +01:00
Peter Fabian 3ba3d5cf1b Made the fail messages unique. 2019-12-05 15:07:03 +01:00
Peter Fabian 7bfbe7a5f1 Removed incorrect comment. 2019-12-05 15:05:38 +01:00
Peter Fabian 0d3074a554 Added rate limiting to Add payment method. 2019-12-05 12:03:02 +01:00
Julia Amosova 62607a918c Resolving conflicts with migration branch 2019-12-04 21:02:34 +00:00
Rodrigo Primo 3af024fc5c
Merge pull request #25031 from woocommerce/feature/24956
Introduced wc_get_product_object() helper
2019-12-04 16:53:04 -03:00
Claudio Sanches e3b2d9f10c Merge branch 'master' into feature/inline-notices 2019-12-04 16:26:10 -03:00
Claudio Sanches 5fdb880831
Merge branch 'master' into feature/24956 2019-12-04 16:18:39 -03:00
Claudio Sanches 8033d5751e Changed wc_get_product_classname function name to wc_get_product_object 2019-12-04 16:15:16 -03:00
Julia Amosova 44a0fa6a25 Resolving conflict with migratin branch 2019-12-04 19:03:35 +00:00
Claudio Sanches a12c25862b
Revert "Add support for '_held_for_checkout` records to prevent race conditions." 2019-12-04 16:03:05 -03:00
Claudio Sanches 0686e6f1cd
Merge pull request #25000 from woocommerce/feature/pay-button-support
Initial support for "pay button"
2019-12-04 16:02:02 -03:00
Rodrigo Primo 4af9a94129 PHPCS fixes 2019-12-04 15:52:20 -03:00
Claudio Sanches adbb4fd2d3
Merge pull request #24937 from jenkoian/wc-placeholder-attrs
Add support for custom attributes to wc_placeholder_img().
2019-12-04 15:42:41 -03:00
Julia Amosova 1a6adfd0db
Merge pull request #24672 from woocommerce/new/front-end-cart-e2e-test
Add new Puppeteer front-end e2e test: cart page
2019-12-04 17:03:10 +00:00
James Collins 7187db66e1 Add unit test 2019-12-04 12:29:40 +08:00
Julia Amosova defbcc456e Adjust `npm install` in travis / docker setup 2019-12-03 22:21:41 +00:00
Julia Amosova 51fcf56ecb Increase wait time for the docker container to start 2019-12-03 21:00:46 +00:00
Claudio Sanches 0c486785ad
Merge pull request #25089 from woocommerce/fix/24009
Add support for '_held_for_checkout` records to prevent race conditions.
2019-12-03 17:47:22 -03:00
Julia Amosova 9e4f55a82f More tweaks to Travis / Docker setup 2019-12-03 20:34:40 +00:00
Julia Amosova d04d862c95 Add npm install to Travis / Docker setup 2019-12-03 19:56:03 +00:00
Claudio Sanches df4eb9c817 Use wc_get_order() in unit tests, and fixed coding standards 2019-12-03 16:44:37 -03:00
Claudio Sanches 988b72e461 Updated filter name to woocommerce_hold_stock_for_checkout
Also fixed coding standards
2019-12-03 16:38:17 -03:00
Julia Amosova 37e367f379 Resolve conflicts with master branch 2019-12-03 18:49:28 +00:00
Julia Amosova 4c8c4a8dbf Adjust Travis + Docker setup 2019-12-03 18:43:33 +00:00
Rodrigo Primo 567b667acf Improve wc_print_notices() test coverage 2019-12-03 15:29:10 -03:00
Claudio Sanches 6a395e2485
Merge pull request #25064 from woocommerce/fix/24315
Optimize variable product duplication slug generation
2019-12-03 15:28:55 -03:00
Claudio Sanches 15ffaeee6b
Merge pull request #25101 from woocommerce/remove-call_user_func_array
Remove a few calls to func_get_args() and call_user_func_array()
2019-12-03 14:51:43 -03:00
Rodrigo Primo 86f59dff09
Merge pull request #24961 from woocommerce/fix/admin-caching-incr
Changed wp_cache invalidation from using increment to using microtime.
2019-12-02 15:32:17 -03:00
Julia Amosova f4afae89c6 Add store owner login in the cart page test 2019-12-02 17:54:45 +00:00
Julia Amosova 3ffaaea6f5 Resolving conflict with migration branch 2019-12-02 17:19:58 +00:00
Julia Amosova 3eb620282e Add store owner logout before running customer my account test 2019-12-02 16:05:22 +00:00
Julia Amosova 3d4dc64d8d Update README with Docker setup details and running tests 2019-12-02 12:43:58 +00:00
Julia Amosova c93c7776f1 Add additional order verification by the store owner 2019-12-02 11:21:01 +00:00
Julia Amosova 435d64919b Add order verification by the store owner 2019-11-30 22:07:29 +00:00
Julia Amosova 6fb8f23ec6 Resolving conflict with migration branch 2019-11-28 16:46:35 +00:00
Julia Amosova 9d219dc5e0 Fix customer login on My Account page 2019-11-28 16:33:43 +00:00
Julia Amosova d65c3c76c3 Resolve additional conflict with migration branch 2019-11-28 14:25:28 +00:00
Peter Fabian 309c48ab0e Deprecated old cache function and replaced it with a new one. 2019-11-28 14:03:57 +01:00
Julia Amosova 3a7aeb04e6 Resolving conflict with migration branch 2019-11-28 12:47:28 +00:00
Julia Amosova 460b2f19e3 Add empty `test:e2e.json` for overriding default variables if needed 2019-11-27 23:46:47 +00:00
Julia Amosova 7b7473f917 Add `npm install` to the Travis implementation for running e2e tests 2019-11-27 00:25:11 +00:00
Julia Amosova 314c613462 Update `default.json` with default Docker test site details 2019-11-26 23:50:08 +00:00
Julia Amosova 843ceead48 Update setup-wizard test & WP Docker image version 2019-11-26 23:06:43 +00:00
vedanshujain 8c2c83d488 Use `wc_round_tax_total` to make it consistent with how we round taxes.
When price includes taxes, we round down. This patch uses the correct method to round taxes depending on the mode instead of plain rounding.
2019-11-27 03:13:39 +05:30
Julia Amosova a7e582b1bb Update docker-compose file & setup running e2e tests on Travis CI 2019-11-26 20:34:00 +00:00
vedanshujain 5ef41f1ecc Empty cart before test to make sure everything in cart exists 2019-11-26 18:21:24 +05:30
vedanshujain 60cd7b3651 Refactor Order Class to use shared calculation logic.
We added a trait to move shared logic betweem Orders and Cart. This commit refactors Order class to use that shared logic.
Also adds a test for a failing case.
2019-11-25 17:53:14 +05:30
Julia Amosova b1738068a4 Fix the way usage tracking pop-up window is handled 2019-11-24 15:40:23 +00:00
Julia Amosova 05175254ed Update admin and customer user details in docker compose file 2019-11-24 13:49:39 +00:00
Julia Amosova 882315182b Remove test:e2e.json file from the code base 2019-11-24 13:18:57 +00:00
Julia Amosova 2818a3c67d Add config file to store variables needed to run e2e tests 2019-11-24 13:08:48 +00:00
Julia Amosova 5efae398fe Finish remaining work on the setup-wizard e2e test 2019-11-24 11:38:13 +00:00
Julia Amosova 798e668895 Resolving conflict with feature branch 2019-11-23 18:11:37 +00:00
Julia Amosova d2fa44518a Resolving conflict with master branch 2019-11-23 18:03:04 +00:00
Julia Amosova 6dea34770f Introduce Docker compose file & setup-wizard e2e test 2019-11-23 17:40:29 +00:00
Julia Amosova 5c57759dbc Implement @jest/test-sequencer in order to run tests in specific order 2019-11-22 14:56:58 +00:00
Julia Amosova 59499da8ef Update products in the checkout verification & address filling functions 2019-11-22 12:33:08 +00:00
Julia Amosova 6f0617825a Resolving conflicts with feature branch 2019-11-21 17:21:58 +00:00
Julia Amosova 5e083cfdbf Change the way navigation between My Account pages is done 2019-11-21 16:52:29 +00:00
Rodrigo Primo 6cd08dc7bd Use the spread operator instead of call_user_func_array() in WC_Data_Store
This commit replaces a call to call_user_func_array() in WC_Data_Store::__call() with argument unpacking using the spread operator which was introduced in PHP 5.6. This change should improve WooCommerce performance a tiny bit since WC_Data_Store::__call() is called somewhat frequently and call_user_func_array() has a bad performance reputation. I added one unit test to make sure this change doesn't break the functionality of the altered method.
2019-11-21 11:52:47 -03:00
Rodrigo Primo fa875a4d25 Fix PHPCS errors in tests/framework/class-wc-dummy-data-store.php 2019-11-21 11:52:07 -03:00
Rodrigo Primo ed1c4b11b8 Fix PHPCS errors in WC_Tests_Data_Store class file 2019-11-21 10:41:27 -03:00
Rodrigo Primo 44b09cb15a Remove unused test method 2019-11-21 10:40:38 -03:00
vedanshujain 70a54d0639 Added Unit Tests for `held_for_checkout` records. 2019-11-21 18:11:37 +05:30
Francesco Leanza dd3427958b Fixed order totals calculation if it contains taxable and non-taxable products and percentage coupons
Added PHPUnit tests
2019-11-21 11:28:22 +01:00
Christopher Allford 753f39ff27 Added unique slug generation for variable product duplication
The standard wp_unique_post_slug() function will run one query per name collision, leading to a large number of queries being made when a product template is duplicated repeatedly. We can avoid this by doing the unique generation ourselves.
2019-11-18 13:49:41 -08:00
Maxime Jobin 61256ad208
Use the $username variable
This test could fail if time() does not return the same value twice.
2019-11-16 11:09:59 -05:00
Christopher Allford 4120fe1cd8 Added tests to product duplication 2019-11-15 21:12:22 -08:00
Claudio Sanches e95dcfb68a Added unit tests for wc_get_product_classname() 2019-11-13 15:30:03 -03:00
Claudio Sanches d8fed95403 Convert all notice data into HTML data 2019-11-07 20:34:49 -03:00
Claudio Sanches 830e612420 Updated notice tests 2019-11-07 20:25:32 -03:00
Claudio Sanches fdd391e10e Introduced wc_get_pay_buttons() function 2019-11-07 17:23:38 -03:00
Claudio Sanches ced207633c Added unit tests for pay button support 2019-11-07 17:23:19 -03:00
Julia Amosova ddbd688bd4 Introduce postID after creating simple and variable products 2019-11-06 22:17:44 +00:00
Julia Amosova bef04b37f4 Resolve conflicts with feature branch 2019-11-06 17:00:48 +00:00
Julia Amosova 937ec06900 Refactor clicking on different menu tabs of My Account page 2019-11-06 16:32:11 +00:00
Gerhard f03c82d749 Fix method call and unit test 2019-10-31 11:28:19 +02:00
Gerhard 7c6eb45518 Add unit tests for WC_Countries::get_european_union_countries and WC_Countries::get_vat_countries 2019-10-31 09:43:05 +02:00
Ian Jenkins 2340f269cf Add support for custom attributes to wc_placeholder_img().
When displaying a list of images you often want a specific class to be
attached to each image, therefore you pass through a custom class using
the attr parameter. Unfortunately this doesn't get passed through to a
placeholder image should one be needed. This means that, for example, if
you're custom class center an image or something, it won't be honoured
for placeholders, which can lead to some wonky image listings.

You can work around this currently by leverging the
`woocommerce_product_get_image` filter, but it's a bit gnarly as you
need to do some regexing or string splitting or something and checking
class names and what not. This provides a much easier way, by
supporting custom attrs on placeholder images as is the case for non
placehodler images.
2019-10-30 15:08:19 +00:00
Julia Amosova 1b54fa78c9 Merge branch 'new/puppeteer-screenshot-tester' of https://github.com/woocommerce/woocommerce into new/puppeteer-screenshot-tester 2019-10-25 18:10:49 +02:00
Julia Amosova 0c7c88b662 Fix failing new variable product test 2019-10-25 18:10:15 +02:00
Julia Amosova 88bfb1af50 Resolve conflicts with migration branch 2019-10-25 14:05:32 +02:00
Claudio Sanches 061b0f0b91 Fixed quotes style 2019-10-25 08:56:55 -03:00
Julia Amosova bcd74e80f7 Resolve conflicts with migration branch 2019-10-25 12:09:22 +02:00
Julia Amosova 4ce07e9387 Remove `moveToTrash` variable 2019-10-25 11:40:54 +02:00
Julia Amosova ec294e74fc Resolve conflicts with migration branch 2019-10-25 11:25:14 +02:00
Julia Amosova ae924fba0a Resolve conflicts with migration branch 2019-10-25 09:34:31 +02:00
Julia Amosova 2d6b560d41 Modify verification method once customer is logged in 2019-10-20 22:46:35 +01:00
Julia Amosova 747f9f6fc3 Resolve conflicts with migration branch 2019-10-20 22:17:08 +01:00
Julia Amosova 7c95f52050 Change verification method after deleting existing tax classes 2019-10-20 21:52:53 +01:00
Julia Amosova 1850348dc3 Merge branch 'new/puppeteer-screenshot-tester' into new/wp-admin-settings-tax-e2e-test 2019-10-20 21:13:26 +01:00
Julia Amosova 3664e70547 Merge branch 'new/puppeteer-screenshot-tester' into new/wp-admin-settings-gen-product-e2e-test 2019-10-20 17:10:34 +01:00
Julia Amosova 98fc901b93 Resolve conflicts with migration branch 2019-10-20 16:57:41 +01:00
Julia Amosova 11a8cbdf79 Merge branch 'master' into new/puppeteer-screenshot-tester 2019-10-18 00:16:22 +01:00
Julia Amosova d444dbdaf4 Add variations creation verification 2019-10-17 15:55:50 +01:00
Vedanshu Jain cb12010627
Merge pull request #24295 from woocommerce/fix/24096
Remove %20 from fields in External Products form
2019-10-03 00:15:52 +05:30
Claudio Sanches 8758fbdbdc Fixed unit tests for wc_query_string_form_fields() 2019-10-02 11:23:31 -03:00
Peter Fabian 7ea9fdec62 Added unit test for special case of attribute value 0. 2019-10-02 15:06:22 +02:00
Peter Fabian e45fe949c1 Added unit test & updated other affected tests. 2019-10-02 14:59:42 +02:00
Julia Amosova 76ccc248aa Add new Puppeteer front-end e2e test: checkout page 2019-09-24 15:44:10 +01:00
Julia Amosova 409775287e Add new Puppeteer front-end e2e test: cart page 2019-09-24 12:56:02 +01:00
Julia Amosova f970111721 Introduce store owner logout flow 2019-09-24 11:39:24 +01:00
Julia Amosova 504de0012c Add new Puppeteer front-end e2e test: single product page 2019-09-24 10:47:47 +01:00
Julia Amosova 0e826b1bcd Add new front-end e2e test: my account page 2019-09-20 15:28:14 +01:00
Julia Amosova 5b04c7115f Update settings saved verification function 2019-09-04 17:34:33 +01:00
Julia Amosova 40219168c0 Add verification of settings after they've been saved 2019-09-04 17:29:13 +01:00
Julia Amosova d43ac30ba0 Add verification of settings after they've been saved 2019-09-04 13:12:37 +01:00
vedanshujain 6f2d64dcb4 Check for max discount to be -ve to prevent overwriting fee.
When we refund fee and some other line item whose value is more than fee in a single requst, value of line item will overwrite refund fee.

This is because where we check to make sure that we do not discount more than total possible value (to prevent negative total), we do not account for the fact that sometimes the cart could contain refund items. In those cases max_discount * -1 will always be larges then fees total.

This commit adds a check to make sure that max discount * -1 is indeed negative before overwriting fee total.
2019-09-03 20:45:33 +05:30
Julia Amosova 6989ae76c7 Add `setCheckbox` & `unsetCheckbox` functions 2019-09-03 12:55:25 +01:00
Julia Amosova b7201e1363 Add new Puppeteer e2e test: tax settings 2019-08-30 12:53:45 +01:00
Julia Amosova e069afb149 Add 2 new Puppeteer e2e tests: settings general & product 2019-08-30 12:03:57 +01:00
Julia Amosova 0b8d8d0e68 Add 2 new Puppeteer e2e tests: new coupon & new order 2019-08-29 17:09:42 +01:00
Julia Amosova 560f64d212 Remove Selenium e2e tests & add Puppeteer new product e2e test 2019-08-27 13:22:24 +01:00
Julia Amosova b3b3b15f6d Add development mode for running e2e tests 2019-08-23 18:02:13 +01:00
Rodrigo Primo 132d785c65
Merge pull request #24242 from woocommerce/update-contributing-docs
Update WooCommerce developer documentation
2019-08-23 10:54:37 -03:00
Rodrigo Primo 18c83e7e4d Remove word "simply" from documentation
It can have a negative implication for the reader if they don't know how to do it
2019-08-23 10:46:22 -03:00
Julia Amosova 337b134c10 Implement Puppeteer architecture & add basic test 2019-08-23 11:34:07 +01:00
Claudio Sanches 1b2b9d528a Fixed Netherlands postcode formatting (#24284)
* Fixed Netherlands postcode formatting

Trim all spaces, fixes issues when postcode is empty.

* Always trim spaces

* Updated unit test for test_wc_format_postcode()
2019-08-09 15:00:40 -03:00
Gerhard 9c7e1d43b0 Update unit tests for wc_string_to_bool to test for camel case as well as uppercase values. 2019-08-06 14:12:42 +02:00
Gerhard 862c43c553 xvfb needs to be started in before_script 2019-08-05 14:43:54 +02:00
Claudio Sanches 162c5dd8a2 Updated tests for wc_query_string_form_fields() 2019-08-01 17:30:39 -03:00
Rodrigo Primo 833c5016ea Add unit tests for wc_get_endpoint_url() 2019-08-01 17:23:11 -03:00
Claudio Sanches 83c0e69637 Update wc_format_decimal() tests to check for multiple decimals points 2019-07-31 19:54:58 -03:00
Rodrigo Primo 9752c1f8a0 Update tests documentation
Update tests documentation as PHPUnit now should be installed and called using composer instead of
globally. This commit also includes some other minor changes to the
tests documentation like updating the link of the service used for code
coverage reports.
2019-07-26 14:48:05 -03:00
Gerhard e0371b70e8 Make config flexible to work on local and travis 2019-07-26 09:36:30 +02:00
Gerhard a6eda46b97 npm run 2019-07-25 15:55:33 +02:00
Gerhard e8dff32c88 Use correct variable to trigger visual regression test 2019-07-25 15:28:07 +02:00
Gerhard af39fb7e5f Hook up new run-vis-regression.sh script, do not run unit tests on vis regression tests 2019-07-25 13:12:24 +02:00
Gerhard 5db83f1699 First go at setting up travis to run vis regression tests. 2019-07-24 13:20:41 +02:00
Gerhard b5aa45bf54 Add basic screenshot testing framework using jest-puppeteer and jest-image-snapshot, include basic test with a screenshot. 2019-07-23 15:08:36 +02:00
Rodrigo Primo a8f6a94cda Remove methods assertIsWPError() and assertNotWPError() from WC_Unit_Test_Case
Those two methods are already declared in the class WP_UnitTestCase, so there is
no need to declare them again in the class WC_Unit_Test_Case. The only
caveat is that assertIsWPError() is called assertWPError() in
WP_UnitTestCase so it was necessary to update all of its usages.
2019-07-19 10:56:58 -03:00
Rodrigo Primo 16442956e8 Fix PHPCS errors 2019-07-19 10:19:23 -03:00
Claudio Sanches 5eb11ea77a Remove exception for PHP 5.2 2019-07-18 23:02:30 -03:00
Claudio Sanches 80f1e2fba2 Remove all support for PHP 5.2 in Travis 2019-07-18 23:01:14 -03:00
Claudio Sanches 16041d9247 Fixed failing tests 2019-07-18 22:42:31 -03:00
Claudio Sanches 96c7255fc0 Fixed SpeedTrapListener include 2019-07-18 22:24:40 -03:00
Claudio Sanches 67212d1303 Updated PHPUnit to 7.5.14 2019-07-18 22:02:58 -03:00
Peter Fabian cb9d94ed9b
Merge pull request #24147 from woocommerce/revert-23705-fix/23696
Revert "Prevent negative prices on products"
2019-07-15 11:28:25 +02:00
Gerhard Potgieter 238a5576d0
Merge pull request #24139 from woocommerce/fix/failing-e2e-timeouts
Be sure to run grunt in travis
2019-07-15 09:07:36 +02:00
Gerhard Potgieter 52f1eb4060
Revert "Prevent negative prices on products" 2019-07-15 08:50:11 +02:00
Gerhard e5ae8f10ae Update e2e test for variations to accomodate new missing price message on variations. 2019-07-14 17:47:30 +02:00
Gerhard 0e50e2319c Cleaning up 2019-07-14 17:16:31 +02:00
Gerhard 712969981c Remove extra folder 2019-07-14 17:04:59 +02:00
Gerhard 689d66dae3 npm install, debugging info 2019-07-14 17:01:38 +02:00
Gerhard d3cc901612 Params needs to be first 2019-07-14 16:56:07 +02:00
Gerhard abee4e68c2 Use TRAVIS_BUILD_DIR constant 2019-07-14 16:17:57 +02:00
Gerhard a04f182edb Do not install branch from zip, rather used checked out copy instead. 2019-07-14 16:12:16 +02:00
Gerhard ba1b684f33 Plugin folder auto renamed to woocommerce 2019-07-14 15:57:11 +02:00
Claudio Sanches 77191a97f8
Merge pull request #23705 from woocommerce/fix/23696
Prevent negative prices on products
2019-07-12 12:56:34 -03:00
Claudio Sanches 60c18ce544
Merge pull request #23067 from woocommerce/pr/23043
Allow matching of "any" attributes in find_matching_product_variation…
2019-07-12 12:40:53 -03:00
Gerhard ebe9648fed Branch is manually installed, must go to branch directory and compile from there. 2019-07-12 17:06:45 +02:00
Gerhard bd06f94d01 Introduce grunt e2e-build task and exclude jshint from that. 2019-07-12 16:28:31 +02:00
Gerhard 7ab046bee4 Move grunt call to run-e2e-ci.sh 2019-07-12 16:14:11 +02:00
Gerhard b1514ca9a0 Run grunt in travis before_script 2019-07-12 16:09:55 +02:00
Gerhard aad5b2863a Add more tests to test more expected combinations as well as test the negatives. 2019-07-12 15:10:20 +02:00
Claudio Sanches c63cd802aa
Merge pull request #23957 from woocommerce/feature/feature-plugin-packages
Include external feature plugins as packages
2019-07-10 15:47:48 -03:00
Gerhard Potgieter 49adf8169b
Merge pull request #23672 from woocommerce/fix/23366-2
Auto generate usernames when a username is blacklisted by WP
2019-07-10 15:44:44 +02:00
Mike Jolley c928188831 Update from master 2019-07-10 12:57:02 +01:00
Gerhard 98c24b1090 Merge branch 'master' into pr/23043 2019-07-10 10:34:52 +02:00
Gerhard 5122641be0 Add wc update cli call to the e2e test install. This should fix outdated/missing tables and routines. 2019-07-10 09:20:37 +02:00
Gerhard 22bb52f9be Fix failing unit tests due to changes in #24111 2019-07-10 08:48:33 +02:00
Claudio Sanches 6e6ca196f9
Merge branch 'master' into fix/23340 2019-07-09 16:32:43 -03:00
Rodrigo Primo 34e5018137
Merge pull request #23262 from woocommerce/fix/23257
CSV Import - check if sku or id column exists when updating products from csv
2019-07-09 14:25:03 -03:00
Claudio Sanches 2fa5396cfc Fixed coding standards 2019-07-09 12:43:03 -03:00
Claudio Sanches 32996d2fdd Merge branch 'master' into pr/23043 2019-07-09 12:39:40 -03:00
Gerhard Potgieter a7b6d7bfa4
Merge pull request #24024 from woocommerce/fix/23917/code
Round late when rounding at subtotal to reduce rounding error.
2019-07-09 11:05:40 +02:00
Gerhard 7038c73ab4 Merge branch 'master' into update/exclude-compiled-assets-from-git 2019-07-09 10:57:40 +02:00
Claudio Sanches a4b8184464
Merge pull request #23950 from parmarhardip/fix-23944
Currency changes applied for 'São Tomé and Príncipe dobra' and 'Mauritanian ouguiya'
2019-07-08 16:12:53 -03:00
Claudio Sanches da99bc8ca0 Merge branch 'master' into feature/feature-plugin-packages 2019-07-08 14:33:21 -03:00
vedanshujain 8ab6cb2b5a Round late when rounding at subtotal to reduce rounding error.
We were earlier rounding different tax rate values while they are merged, even if rounding at subtotal setting is enabled. This increases the rounding error, especially when prices are inclusive of taxes, and thus there is a chance that the total will be slightly different from when add the original values. For egs: https://github.com/woocommerce/woocommerce/issues/23917 .

This commit changes this behavior to round *after* we have summed all the precise unround values. Similar for items prices, we now round as late as possible, if rounding at subtotal is enabled.
2019-07-04 22:34:29 +05:30
Gerhard Potgieter 12fbfa5677
Merge pull request #22927 from woocommerce/update/22895
Allow "Thanks" wording in emails to be reworded by admin
2019-07-04 12:43:00 +02:00
Gerhard 29bb165aca Apply unit tests 2019-07-04 11:50:33 +02:00
Gerhard 88442fea1e Update unit tests to match new placeholder text 2019-07-04 11:36:12 +02:00
Peter Fabian 8c0bf2795f Install sniffs only when running PHPCS. 2019-07-04 10:17:39 +02:00
Rodrigo Primo 737f6af5e8 Introduce file type check for tax rate importer 2019-07-02 10:44:21 -03:00
Rodrigo Primo 7324e480e7 Fix phpcs violations 2019-07-02 10:43:52 -03:00
Rodrigo Primo bb78174c33 Remove references to apigen from configuration files
Commit d6bd82865c removed apigen from
WooCommerce core repository as we are moving it to its own repository (https://github.com/woocommerce/woocommerce-api-docs). This
commit removes the apigen from configuration files. In most cases, it is
just removing the apigen directory from the exclude list of things like
PHPCS and Code Climate.
2019-06-28 10:20:30 -03:00
Mike Jolley a0a58cfb15 update from master 2019-06-26 15:26:47 +01:00
Mike Jolley 9a8e8dacff Add integration tests 2019-06-25 15:57:44 +01:00
Mike Jolley de06195ae9 Remove API unit tests 2019-06-25 14:25:31 +01:00
Claudio Sanches fe4dfea8eb
Merge pull request #23771 from woocommerce/fix/23756
Fix Top rated shortcode results
2019-06-24 12:18:57 -03:00
Claudio Sanches 606c0417a9
Merge pull request #23837 from woocommerce/fix/23834
Make NL postcode validation more flexible
2019-06-24 12:17:53 -03:00
MD0123-Hardip 9890ab4164 unit testing changes 2019-06-20 11:37:38 +05:30
Claudio Sanches eedc871bea Update unit tests for wc_format_phone_number() 2019-06-19 17:44:01 -03:00
Mike Jolley 191eb4865b Namespaced v3 tests to v4 2019-06-10 12:36:11 +01:00
Mike Jolley 91647f3051 ProductReviews/Products tests 2019-06-07 17:16:28 +01:00
Mike Jolley 95b72e56f5 Progress adding unit tests from core + wc-admin 2019-06-07 16:32:42 +01:00
Mike Jolley f68e5d1080 Add tests 2019-06-06 17:34:11 +01:00
Claudio Sanches 2f7ec9506f New tests for is_postcode with NL postcodes 2019-05-28 20:55:51 -03:00
Gerhard Potgieter b2ed079520 Manual orders coupon usage limits by email (#23775)
* Add functionality to wp-admin order to check for coupon usage based on email addresses, similar to how WC_Cart handles this seperately, included unit tests.

* Only do the coupon by email usage check if order is from a guest. Fix issue with unit test.
2019-05-27 11:45:29 -03:00
Gerhard f6d9faa062 Introducde wc_load_cart to dynamically load the cart, this allows for functionality outside of frontend to initialise the cart. 2019-05-22 12:24:31 +02:00
Claudio Sanches 8af5117bf4 Fixed unit tests and coding standards 2019-05-20 17:27:25 -03:00
Gerhard Potgieter afd7e72c03
Merge pull request #23690 from woocommerce/update/obw-stripe
Update OWB Payment Gateway structure
2019-05-16 18:26:29 +02:00
Gerhard ddcef3b34c Fix unit test for new scenarios 2019-05-16 16:26:34 +02:00
Gerhard Potgieter 30ce9ff6a3
Merge pull request #23689 from woocommerce/add/get_used_coupon_codes
Deprecate get_used_coupons in favor of get_coupon_codes
2019-05-15 15:34:40 +02:00
Rodrigo Primo 47188f05cb Fix unit tests after changes in the default enabled payment gateways 2019-05-14 19:46:38 -03:00
Rodrigo Primo c8b55ff62d Improve WC_Admin_Setup_Wizard::get_wizard_in_cart_payment_gateways() tests
This commit moves two functions declared inside a test method to their
own protected methods inside the same test class to make it easier to
read the tests and it fixes the order of the parameters for the calls to
Assert::assertEquals(). The first parameter passed to this method should
be the expected value and the second parameter should be the actual
value and not the opposite.
2019-05-14 18:38:53 -03:00
Rodrigo Primo ba792a6589 Fix PHPCS errors 2019-05-14 18:34:21 -03:00
Claudio Sanches 33249f3f3d Updated unit tests for wc_format_decimal() 2019-05-14 13:21:42 -03:00
Gerhard Potgieter b7facc0674
Merge pull request #23663 from danielbitzer/add_get_coupons_method
Add WC_Abstract_Order::get_coupons()
2019-05-14 11:35:21 +02:00
Gerhard 486321161c Update usage of get_used_coupon_codes to get_coupon_codes 2019-05-14 11:21:27 +02:00
Daniel Bitzer 3024043bb4 Add unit test for WC_Abstract_Order::get_coupons() 2019-05-14 15:46:49 +09:30
Gerhard 31acfbcb4a Deprecate WC_Abstract_Order::get_used_coupons in favor of WC_Abstract_Order::get_used_coupon_codes, this reflects the actual data being returned better. 2019-05-13 14:40:54 +02:00
Gerhard Potgieter d2c7d8c86e
Merge pull request #23535 from woocommerce/fix/23518
Fix: parameter values should be converted back as well when building form fields
2019-05-10 10:43:28 +02:00
Claudio Sanches 4c028c13ba Updated unit tests 2019-05-09 17:28:32 -03:00
Gerhard 9300c3436b Run grunt css and js before running e2e tests 2019-05-07 10:56:46 +02:00
Rodrigo Primo 18ee70918b Fix PHPCS violations in tests/ using PHPCBF
This commit fixes all 1533 PHPCS errors that PHPCBF can fix automatically in the tests/ directory. Before this change there was a total of 3106 PHPCS errors in the WooCommerce repository and now there is 1573 errors.
2019-05-01 19:05:00 -03:00
Rodrigo Primo 45c2c78ea2 Fix: parameter values should be converted back as well when building form fields
PR #23196 added a workaround to `parse_str()` limitation when dealing with full-stops, pluses, and spaces in the parameter key. This workaround involved temporarily replacing those three characters with placeholders before calling `parse_str()` and then replacing back to the original form. This commit fixes a bug in this logic that was replacing back only parameters keys and not parameters values.

For example, if the query string is `?query.parameter=foo.bar`, the resulting <input> field contained `foo{dot}bar`, instead of the expected `foo.bar`.
2019-04-26 13:58:27 -03:00
Rodrigo Primo e21430703c Remove redundant calls to var_export() in test_wc_query_string_form_fields()
It is not necessary to use the $message parameter of assertEquals() to output the value of $actual_html, as PHPUnit already output this variable value in case of error.
2019-04-26 11:49:30 -03:00
Mike Jolley 9bf2081869
Merge pull request #23477 from woocommerce/fix/23466
Default category sorting order should be overwritten if defined by get_terms
2019-04-24 16:00:33 +01:00
Mike Jolley 8ffc4fca71 menu_order test 2019-04-24 10:45:33 +01:00
Mike Jolley 8fe68400be name_num tests 2019-04-24 10:44:22 +01:00
Mike Jolley 3945aae94e Test cases for sorting 2019-04-24 10:38:38 +01:00
Mike Jolley a4ba20681e added failing test 2019-04-23 11:48:24 +01:00
Mike Jolley f306d3fc11
Merge pull request #23266 from woocommerce/fix/23234
Switch to subquery for sale product query
2019-04-18 12:36:22 +01:00
Mike Jolley cafd81e6e5
Merge pull request #23329 from woocommerce/fix/23327
Non int value handling in wc_let_to_num
2019-04-18 11:30:57 +01:00
Mike Jolley ceefe98bd0
Merge pull request #23297 from dkjensen/master
Remove tags from product titles when building PayPal request URL
2019-04-18 11:23:55 +01:00
Mike Jolley b686150655
Merge pull request #23196 from woocommerce/fix/23195
Replace full stops before running through `parse_str`
2019-04-18 11:01:59 +01:00
Mike Jolley 630cae2483 phpcs for discounts class 2019-04-17 16:53:02 +01:00
Mike Jolley 29c3f63628 Failing test case for 23340 2019-04-17 16:41:04 +01:00
Gerhard 8ca0bd7b4d Add logic to wc_let_to_num to handle non int values, added unit tests to cover these scenarios 2019-04-17 10:30:49 +02:00
Timmy Crawford e12e4aaa25
Merge pull request #23304 from woocommerce/fix/link-all-variations
[3.6] Fix logic in link all variations
2019-04-15 11:16:22 -07:00
Timmy Crawford 438d22762e
Merge pull request #23246 from franticpsyx/issue-23245
Introduce IN and NOT IN clauses in `WC_Product_Data_Store_CPT::search_products
2019-04-15 11:08:32 -07:00
Rodrigo Primo 60a006d96a Add unit test to cover WC_Tests_Product_CSV_Importer::import() when updating products 2019-04-15 12:00:49 -03:00
Rodrigo Primo 93f2050a2c phpcs fixes 2019-04-15 11:59:55 -03:00
Mike Jolley 6c6785c844
Merge pull request #23269 from marcochiesi/patch-1
Added validation for Italian postcodes
2019-04-15 14:10:01 +01:00
Mike Jolley 1504f8af3e
Merge pull request #23011 from Tofandel/patch-2
Improve the speed of the admin dashboard by only updating transients once per class
2019-04-15 14:03:31 +01:00
Mike Jolley d0c6c54989 Moved link/create code to data store with new unit test
This code was not testable within ajax code, so moved to the data stores.
2019-04-15 11:59:57 +01:00
David Jensen 23bda4503e Add comment 2019-04-12 14:49:17 -07:00
David Jensen ac6da3cb55 Unit test strip HTML from product title when building PayPal request URL 2019-04-12 14:44:38 -07:00
Marco Chiesi 92c356021c
Added missing parameter comments 2019-04-11 01:12:27 +02:00
Marco Chiesi 2a784a3003
Added missing doc comments (coding standards) 2019-04-11 01:03:48 +02:00
Marco Chiesi cba442283c
Fixed wrong tests for Italian postcodes 2019-04-11 00:33:30 +02:00
Ian Jenkins dd67ee2e28 Minor fixes for things noticed when running tests locally.
Was using a directory other than /tmp for temp dir and it was failing,
this was the changes I had to make.
2019-04-10 23:01:44 +01:00
Mike Jolley d3e2d725e7 prevent test showing content 2019-04-10 13:50:42 +01:00
Manos Psychogyiopoulos 2fbb7bda5c Check coding stds 2019-04-10 13:02:52 +03:00
Manos Psychogyiopoulos c1b7c55768 Add exclude param tests 2019-04-10 12:47:31 +03:00
Manos Psychogyiopoulos a9f86ef202 Add include param tests 2019-04-10 12:47:19 +03:00
Manos Psychogyiopoulos e6f25b04d8 Add limit param tests 2019-04-10 12:47:06 +03:00
Timmy Crawford ef4f0f0c0f
Merge pull request #23197 from woocommerce/fix/23182
[3.6] Fix backwards compatibility issues for wc_get_template function w/ tests
2019-04-08 10:19:16 -07:00
Mike Jolley 1cd2959087 unset rather than prevent the template being included. 2019-04-03 16:08:12 +01:00
Mike Jolley 7feae340f2 Add tests 2019-04-03 11:58:15 +01:00
Mike Jolley 2e9ce0a061 unit tests 2019-04-02 15:18:06 +01:00
Mike Jolley c5b31cee3d Unit test for counts 2019-04-02 11:45:58 +01:00
Mike Jolley ad49085571 Append random number to reduce recusion 2019-03-27 12:22:15 +00:00
Mike Jolley 94466460ad Tests 2019-03-26 11:09:30 +00:00
Rodrigo Primo 61a096d871 Fix PHPCS in the Travis builds
PR https://github.com/woocommerce/woocommerce/pull/23082 made some changes to the Travis configuration and one of those changes broke the PHPCS when running inside Travis with the following error:

```
ERROR: Referenced sniff "WooCommerce-Core" does not exist
```

For example: https://travis-ci.org/woocommerce/woocommerce/jobs/509471213#L659

This problem went unnoticed during the PR review as no PHP file was modified in it and thus there was no file for PHPCS to check.

This commit fixes the error above by installing the Composer package `woocommerce/woocommerce-sniffs` which is the package that provides `WooCommerce-Core` sniffs and which installs `wp-coding-standards/wpcs` as one of its requirements. I couldn't find an easy way to make this work installing `woocommerce/woocommerce-sniffs` globally so that is why this commit also removes the `global` parameter when calling composer.
2019-03-21 15:23:42 -03:00
Gerhard e9e64dc30a Use vendor bin folder for calling phpunit 2019-03-19 15:41:43 +02:00
Gerhard 441c79ee41 Fix syntax error in shell script 2019-03-19 15:31:49 +02:00
Gerhard 0a1eb076ea Add PHPUnit call fallback for 5.2 specifically 2019-03-19 15:23:36 +02:00
Gerhard a59969ca53 Do not try to run composer on PHP 5.2 and default to phpunit command instead of specifying path, travis will first try and look for in the composer dirs. 2019-03-19 14:30:54 +02:00
Gerhard d391e87fc7 Update PHPUnit location 2019-03-19 13:47:26 +02:00
Gerhard dc99c30772 Move phpunit call after first params 2019-03-19 13:33:21 +02:00
Gerhard b105550b47 Changes to travis, globally install phpunit and wpcs when required, cache vendor and composer cache directories 2019-03-19 13:14:42 +02:00
Claudio Sanches a425e92672 Removed legacy "Orders index" tool 2019-03-15 11:34:32 +00:00
Adrien Foulon 8bae56d51a
Remove '_' prefix from function 2019-03-13 18:01:53 +01:00
Mike Jolley e2e124f365
Merge pull request #22083 from woocommerce/feature/variation-search
Added storing attribute values as post_excerpt for variations.
2019-03-13 15:09:19 +00:00
Adrien Foulon 7099aa5d1a
Change function call to static 2019-03-13 13:48:39 +01:00
Peter Fabian 2b8d2cf3dd PHPCS on test file. 2019-03-13 13:30:59 +01:00
Peter Fabian 0aa9a09d18 Enforced attribute order to make result unambiguous. 2019-03-13 12:36:46 +01:00
Adrien Foulon a316101358
Fix tests 2019-03-13 11:58:59 +01:00
Peter Fabian 918ea3c5aa Added test for attribute_summary. 2019-03-12 18:40:04 +01:00
Mike Jolley 20d7603dd6 Merge branch 'fix/21034' 2019-03-12 13:47:08 +00:00
Mike Jolley c39f447ff4 Merge branch 'fix/22937' 2019-03-12 13:27:13 +00:00
Mike Jolley 0877e7d8f7
Merge pull request #22954 from woocommerce/add/blocks-rest-api
Merge blocks branch: add 8 product blocks and related API endpoints
2019-03-11 15:18:20 +00:00
Mike Jolley fbda3a91d8 Merge feature/add-tracks into master 2019-03-11 15:15:50 +00:00
Mike Jolley db6a73d474 Make create_attribute helper use core functions 2019-03-11 14:59:10 +00:00
Mike Jolley e55bb84e8b
Merge pull request #22718 from woocommerce/experiment/product-sorting-index
Performance: product sorting lookup table
2019-03-11 13:27:10 +00:00
Kelly Dwan 845300c975 Update test names and comments to reflect correct user role 2019-03-08 15:16:59 -05:00
Mike Jolley 15ca2144d3
Merge pull request #22773 from woocommerce/performance/delete-empty-meta
Performance: delete empty meta
2019-03-08 10:22:31 +00:00
Mike Jolley e7c8db0796
Merge pull request #22887 from woocommerce/update/22882-additional-system-status-values
Additional System Status Options
2019-03-08 10:15:45 +00:00
Mike Jolley a3c2dcd8f2 Update from master 2019-03-08 09:50:56 +00:00
Kelly Dwan 39a8bbf54c Fix space/tab issue for phpcs 2019-03-07 12:32:55 -05:00
Claudio Sanches 14b96f0026 Fixed a typo 2019-03-07 14:23:17 -03:00
Claudio Sanches 7938e352e3 Fixed coding standards 2019-03-07 14:16:07 -03:00
Claudio Sanches ef50a1d5a4 Introduced unit tests for wc_sanitize_phone_number 2019-03-07 14:14:39 -03:00
Mike Jolley 598ac86e95 Tests 2019-03-07 11:08:29 +00:00
Timmy Crawford 85713c4c1a Updates per feedback. 2019-03-06 17:26:18 -05:00
Timmy Crawford 2b59c5db64 REST API: Add Blocks Products Controller 2019-03-06 17:26:17 -05:00
Timmy Crawford e17d835e66 REST API: Add wc-blocks/v1/products/categories 2019-03-06 17:26:16 -05:00
Timmy Crawford afdde006f1 Remove some copied 'terms' in the test file. 2019-03-06 17:26:16 -05:00
Timmy Crawford f4e17ddcee REST API: Add wc-blocks/v1/products/attributes controller. 2019-03-06 17:26:15 -05:00
Timmy Crawford f2fa01d585 PHPCS fixes. 2019-03-06 17:26:15 -05:00
Timmy Crawford c1313d433c Updates per feedback. 2019-03-06 17:26:14 -05:00
Timmy Crawford 4311670956 REST API: wc-blocks/v1/products/attributes/%d/terms 2019-03-06 17:26:13 -05:00
Mike Jolley edb378fcea Tweak test (test_wc_format_coupon_code) now the format function matches titles 2019-03-06 11:53:20 +00:00
Mike Jolley 16a0a3e27e Update from master 2019-03-05 19:03:01 +00:00
Mike Jolley d9d458ce07 Clear cache in tests 2019-03-05 18:19:50 +00:00
Gerhard 5ce0ea762a Missed PHPCS fix 2019-03-05 14:33:10 +02:00
Paul Sealock d968b95b53 Add opt in/out to settings page 2019-03-05 11:06:45 +13:00
Mike Jolley 5af9d968e5 Update from master 2019-03-01 10:29:17 +00:00
Rodrigo Primo 25f0023d38 Fix PHPCS violations automatically using phpcbf 2019-02-27 18:09:11 -03:00
Mike Jolley cc8e516f7a
Merge pull request #22786 from woocommerce/improve/user-registration
Improve user's display_name generation during checkout
2019-02-27 12:55:56 +00:00
nishitlangaliya ee621eec8a fix: filter prefix changed and unit test added for fn:wc_get_product_stock_status_options 2019-02-25 19:03:57 +05:30
Claudio Sanches 79847ccb93 Fixed coding standards 2019-02-20 16:30:46 -03:00
Claudio Sanches 3ac5f32a8b Updated tests for wc_create_new_customer 2019-02-20 16:29:10 -03:00
Mike Jolley 7def966e4f Impoved JSON handling 2019-02-20 12:00:47 +00:00
Mike Jolley d45734b6f3 Tweak indexes tests to test shipping indexes correctly 2019-02-19 15:35:28 +00:00
Mike Jolley 07eadfeb72
Merge pull request #22760 from woocommerce/performance/webhook-loading
Performance: webhook loading
2019-02-19 09:58:06 +00:00
Mike Jolley 2529cd60cd
Merge pull request #22731 from woocommerce/update/21952
Prevent webhooks for drafts and correct create vs updated for manual orders
2019-02-19 09:50:51 +00:00
Claudio Sanches c01e334500 Fixed coding standards 2019-02-18 17:59:34 -03:00
Mike Jolley 4fd2a9f77e Update from master 2019-02-18 15:04:58 +00:00
Mike Jolley 519b29d734 Tests 2019-02-15 12:25:04 +00:00
Mike Jolley 08e8c76eab Update tests 2019-02-15 12:16:59 +00:00
Mike Jolley 84299ff5ed Update the tests 2019-02-13 17:56:41 +00:00
Mike Jolley 0e21b3f4ce Tests 2019-02-07 20:35:45 +00:00
Mike Jolley b2c33b8e34 Merge branch 'master' into performance/slow-term-queries 2019-02-07 13:49:48 +00:00
Mike Jolley 889cf64ac4 Merge branch 'performance/wc-get-product-class' 2019-02-07 13:34:18 +00:00
Mike Jolley 4b485eba13 Fixed unit tests 2019-02-06 21:00:07 +00:00
Claudio Sanches 82c1f8f81b
Merge pull request #22634 from outis/fix-sed-pw
Fix sed pw
2019-02-06 14:43:32 -02:00
Mike Jolley 72314f9dbc Contains was backwards 2019-02-05 14:21:06 +00:00
Mike Jolley cafe8b6b57 Tests check the image URL is contained rather than exact string 2019-02-05 14:11:07 +00:00
Mike Jolley 34dbf96847
Merge pull request #22410 from woocommerce/remove/simplify-commerce
Remove simplify commerce gateway from core
2019-02-04 11:23:23 +00:00
Galen Wright-Watson 00610db7fe Update: docmented install script's handling of metacharacters in passwords. 2019-02-01 14:45:29 -08:00
Mike Jolley de8ff9b719 phpcs 2019-02-01 14:38:47 +00:00
Mike Jolley 3697f5104a fix uncat display 2019-02-01 13:08:04 +00:00
Galen Wright-Watson 8627fc39b9 Update: install script-escape forward & backward slashes and ampersand in supplied password. 2019-01-31 13:09:24 -08:00
Mike Jolley 1e3e5a4528
Merge pull request #22580 from woocommerce/fix/22515
recalculate coupons after adding coupon to order
2019-01-31 14:38:59 +00:00
Mike Jolley 133d108bd8
Merge pull request #22269 from Prospress/fix/22247
convert user creation GMT datestamp to local datetime in API
2019-01-31 12:56:40 +00:00
Toby Robles 59d4a81f1a
Peruvian currency updated 2019-01-30 10:43:52 -05:00
Ron Rennick 28710a522e phpcs sniff fixes for orders.php 2019-01-27 20:57:58 -04:00
Ron Rennick d888f456f8 remove line item subtotal adjustment from api coupon unit test 2019-01-27 20:49:02 -04:00
Galen Wright-Watson baeccdc547 Fix: #22577-"bad flag in substitute command" if password has a '/' character. Cause: unescaped special characters (forward slash) in variable get interpreted as part of sed script. Soln: escape forward slashes when interpolating into sed script. 2019-01-26 23:53:02 -08:00
Mike Jolley 20330b01bd
Merge pull request #22531 from rellect/fix_ssl_check
Fix ssl check in case shop page no longer exists
2019-01-23 20:18:43 +00:00
Refael Iliaguyev 398bbe3754 sniff fixes 2019-01-23 17:26:17 +02:00
Refael Iliaguyev 8f0f22c11b Fix ssl check in case shop page does not exists. 2019-01-23 16:08:13 +02:00