woocommerce/tests/unit-tests
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
..
account Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
admin/reports Fixed failing tests 2019-07-18 22:42:31 -03:00
attributes Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
cart Remove exception for PHP 5.2 2019-07-18 23:02:30 -03:00
core menu_order test 2019-04-24 10:45:33 +01:00
countries Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
coupon Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
crud Fix PHPCS errors 2019-07-19 10:19:23 -03:00
customer Updated unit tests 2019-05-09 17:28:32 -03:00
discounts Merge branch 'master' into fix/23340 2019-07-09 16:32:43 -03:00
exporter unpdate unit tests for product export 2018-12-13 13:54:51 -04:00
formatting Fixed Netherlands postcode formatting (#24284) 2019-08-09 15:00:40 -03:00
gateways Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
geolocation Add geolocation::get_ip_address tests 2018-06-11 11:10:11 +02:00
importer Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
integrations Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
libraries Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
log Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
order Check for max discount to be -ve to prevent overwriting fee. 2019-09-03 20:45:33 +05:30
order-items Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
packages Add integration tests 2019-06-25 15:57:44 +01:00
page-functions Add unit tests for wc_get_endpoint_url() 2019-08-01 17:23:11 -03:00
payment-tokens Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
privacy Removed unnecessary parameter. Also removed from tests. 2018-06-07 21:25:13 +06:00
product Add more tests to test more expected combinations as well as test the negatives. 2019-07-12 15:10:20 +02:00
session Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
settings Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
setup Fix unit test for new scenarios 2019-05-16 16:26:34 +02:00
shipping-zones phpcs fixes 2019-01-09 16:33:38 -02:00
shortcodes Fix failing unit tests due to changes in #24111 2019-07-10 08:48:33 +02:00
tax Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
templates Merge pull request #23535 from woocommerce/fix/23518 2019-05-10 10:43:28 +02:00
totals Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00
util Remove methods assertIsWPError() and assertNotWPError() from WC_Unit_Test_Case 2019-07-19 10:56:58 -03:00
webhooks Merge pull request #22760 from woocommerce/performance/webhook-loading 2019-02-19 09:58:06 +00:00
widgets Fix PHPCS violations in tests/ using PHPCBF 2019-05-01 19:05:00 -03:00