Commit Graph

1865 Commits

Author SHA1 Message Date
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
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
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
Peter Fabian 309c48ab0e Deprecated old cache function and replaced it with a new one. 2019-11-28 14:03:57 +01:00
vedanshujain 5ef41f1ecc Empty cart before test to make sure everything in cart exists 2019-11-26 18:21:24 +05:30
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
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
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
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
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
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
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
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