Nestor Soriano
2b8cac7cf2
Fix the REST API entry point to add coupons to an order.
...
- Check input (no 'id', has 'code') and throw an error if needed
before removing the existing coupons, so an invalid input
won't cause the loss of these existing coupons.
- Also, check that the coupon is actually valid as part of the
input check.
- Cache the coupon objects that are created during the input check,
and apply them directly.
- Don't check if 'coupon_lines' is an array and contains arrays,
that's already done by the REST API engine by looking at the schema.
- Adjust unit tests.
2021-03-24 15:19:34 +01:00
Peter Fabian
1b53b724b2
Fix existing tests.
2021-03-11 17:02:22 +01:00
barryhughes
f79b3f9120
Supporting tests for handling coupon-related order updates (via REST API) | #27290
2021-02-16 10:28:46 -08:00
Christopher Allford
30d2e278b9
Replaced the deprecated `WC_Admin_Note` class
2020-11-12 13:26:30 -08:00
Shiki
30854efc1b
Replace assertStringContainsString with strpos
...
This is to make the PHP 7.0 CI pass.
2020-10-26 13:28:04 -03:00
Shiki
ba3e107cb8
Orders V2 API: Add test for parent_name
2020-10-26 13:28:04 -03:00
Shiki
94ecfcab34
Orders API: Add parent_name to schema
2020-10-26 13:28:04 -03:00
Shiki
c6f82b96a1
Orders API: Add unit test for parent_name line_item property
2020-10-26 13:28:04 -03:00
Shiki
a05316878e
Orders API Tests: Fix failing tests because of the new property
2020-10-26 13:28:04 -03:00
Shiki
3a1b125e3a
Fix coding style
2020-10-26 13:28:04 -03:00
vedanshujain
a332b399d3
Use variable instead of magic constants.
2020-10-14 18:50:44 +05:30
vedanshujain
c01f32a390
Use default value if formatted value is not available
2020-10-14 14:51:19 +05:30
vedanshujain
8e12de5d3c
Merge branch 'fix/api/229-unit-test' of https://github.com/shiki/woocommerce into fix/api/229
2020-10-14 13:53:03 +05:30
Shiki
1be78d1ebf
Use different terms to avoid clash with the similar V2 test
...
I suppose I could have deleted the attribute and term first but I think
this is better and shorter. Maybe.
2020-10-13 22:32:32 +05:30
Shiki
a9bf6b71ac
OrdersV2: Add test for line items meta_data
...
This currently fails because it's not implemented yet.
2020-10-13 22:32:32 +05:30
Shiki
871a9e0b8f
Add line items meta_data schema test for Orders V2 and V3
...
This currently fails because the expected meta_data properties are only
available in V3.
2020-10-13 22:32:32 +05:30
Shiki
c5fd3ed21c
WC_Tests_API_Orders: Add test data for site-level attributes
2020-10-13 22:32:31 +05:30
Shiki
62f1705690
WC_Tests_API_Orders: Rearrange order variable for clarity
2020-10-13 22:32:31 +05:30
Shiki
c16ec9bf54
WC_Tests_API_Orders: Rename first_meta_data to size_*
2020-10-13 22:32:31 +05:30
Shiki
a0d9b49e43
Add unit test for an Order's line item meta data.
2020-10-13 22:32:31 +05:30
Claudio Sanches
7fae819928
Fixed package tag
2020-09-17 14:34:36 -03:00
Claudio Sanches
70c7adfeb7
Fixed usage of package tag in REST API and templates
2020-09-17 11:56:08 -03:00
Shiki
d6600d8338
Version3/orders.php: Re-add assertion for `meta_data`
2020-09-01 14:29:38 -06:00
Shiki
5651befdd9
Version3/orders.php: Remove assertion for `meta_data`
...
The new meta_data output will include keys like `display_key` and
`display_value`. The assertion will be re-added in a later commit.
2020-09-01 14:22:38 -06:00
Shiki
64bd1e0fd5
Fix formatting errors in orders.php
2020-09-01 14:21:14 -06:00
Shiki
ecb2936f9e
Use different terms to avoid clash with the similar V2 test
...
I suppose I could have deleted the attribute and term first but I think
this is better and shorter. Maybe.
2020-08-26 23:51:36 +05:30
Shiki
face3fe27e
OrdersV2: Add test for line items meta_data
...
This currently fails because it's not implemented yet.
2020-08-26 23:51:36 +05:30
Shiki
ad00eb3a98
Add line items meta_data schema test for Orders V2 and V3
...
This currently fails because the expected meta_data properties are only
available in V3.
2020-08-26 23:51:36 +05:30
Shiki
2a01aa968f
WC_Tests_API_Orders: Add test data for site-level attributes
2020-08-26 23:51:36 +05:30
Shiki
dc2a4d1ccc
WC_Tests_API_Orders: Rearrange order variable for clarity
2020-08-26 23:51:36 +05:30
Shiki
00a5c3101e
WC_Tests_API_Orders: Rename first_meta_data to size_*
2020-08-26 23:51:36 +05:30
Shiki
d681a8c7a4
Add unit test for an Order's line item meta data.
2020-08-26 23:51:36 +05:30
Claudio Sanches
a133e56ebd
Fixed unit tests
2020-08-25 16:13:49 -03:00
Ron Rennick
81dae70033
phpcs fixes
2020-08-25 15:41:31 -03:00
Ron Rennick
de79f1a3cd
update unit tests for included Paypal gate name change
2020-08-25 15:36:50 -03:00
vedanshujain
7fa6510c1a
Add a explicit test for null as well
2020-08-13 16:52:16 +05:30
vedanshujain
dd9b9cfae2
Add test for update in date-time field
2020-08-13 16:32:00 +05:30
vedanshujain
4294e06f7a
Add test for variation v2 controller for complex meta object
2020-08-13 15:46:31 +05:30
vedanshujain
826fdde721
Add unit tests for checking that updating complex meta is possible
2020-08-13 13:27:00 +05:30
vedanshujain
2f76e52fa7
Skip test for < 5.3 as feature is not supported.
2020-08-06 14:34:02 +05:30
vedanshujain
55a9687e6d
Make api included structure more linear.
2020-08-06 14:34:02 +05:30