Commit Graph

339 Commits

Author SHA1 Message Date
Jeff Stieler 91a86efed9 Add test coverage for register_legacy_settings(). 2016-07-26 10:24:15 -07:00
Jeff Stieler b4eaa12f7a Break “legacy” setting to “new” conversion into it’s own method. 2016-07-26 10:24:15 -07:00
Jeff Stieler 51cae9c441 Add test for register_legacy_group() and coverage annotations. 2016-07-26 10:24:15 -07:00
Jeff Stieler 09f7723457 Add initial test file for WC_Register_Legacy_Settings, with test for constructor. 2016-07-26 10:24:15 -07:00
Jeff Stieler cca2a0ff5e Reuse WC Admin Setting’s save_fields() instead of duplicating code for sanitizing saved values. 2016-07-26 10:24:15 -07:00
Jeff Stieler 83d252b6d3 Remove namespace from Settings API unit test file.
This fails builds on PHP 5.2.x.
2016-07-26 10:24:15 -07:00
Jeff Stieler 95990e32ca Fix unit tests. 2016-07-26 10:24:15 -07:00
Justin Shreve 3de423b5c2 Wrap up settings api 2016-07-26 10:24:15 -07:00
Justin Shreve 5de870bb08 Wrap up settings endpoints for updating, finish tests. 2016-07-26 10:24:15 -07:00
Justin Shreve 46028e0151 Refactor down to two concepts - settings groups and settings. Fix up tests, and start working on returning actual settings and their values. 2016-07-26 10:24:15 -07:00
Justin Shreve 8fee6bd3b9 Add a test for settings groups, make sure any bad keys/values are filtered out, update docs. 2016-07-26 10:24:15 -07:00
Justin Shreve 12aa11d5be Misc cleanup. 2016-07-26 10:24:15 -07:00
Justin Shreve 19d3bc4737 Add a permissions check to the locations endpoints and fill out the tests for them. 2016-07-26 10:24:15 -07:00
Justin Shreve 21b66f94ff More setting location tests. 2016-07-26 10:24:15 -07:00
Justin Shreve 5ee4b5d4dd Add the ability to get data on a single location. 2016-07-26 10:24:15 -07:00
Justin Shreve 11a3c89a2f Make /settings/locations work properly. Add skeleton for tests and add register_routes test. 2016-07-26 10:24:15 -07:00
Justin Shreve a9bb988873 Initial /settings API controller and /settings/locations route. Loads the WP-API and registers our namespace temporarily until WP-API is loaded by WC core. 2016-07-26 10:24:15 -07:00
Justin Shreve 671dc8168d Add new file for creating new unit test files for testing WP-API based WC endpoints.
Add WP-API's test-spy-rest-server class to new vendor folder in our test framework.
Create a new unit test case class to extend of of. This can also be a future home for new asserts or methods related to the API tests.
2016-07-25 11:19:44 -07:00
Manos Psychogyiopoulos 17c6108832 ensure WC_ROUNDING_PRECISION is defined and use it as a low precision boundary in wc_get_rounding_precision() 2016-07-21 12:14:12 +03:00
Justin Shreve ec2c82347f Move WP-APIs test server code to a vendor directory, make sure it matches the version of the other vendor files. 2016-07-19 11:38:18 -07:00
Justin Shreve 57fd38c1a8 Misc cleanup of descriptions and some error strings. 2016-07-19 11:24:05 -07:00
Jeff Stieler 6f36179fe6 Rename WC_Rest_Settings_Groups_Controller to WC_Rest_Settings_Controller. 2016-07-19 10:41:22 -07:00
Jeff Stieler f56a79c74b Rename WC_Rest_Settings_Controller to WC_Rest_Settings_Options_Controller. 2016-07-19 10:41:22 -07:00
Jeff Stieler cf65ff53c5 Add test coverage for all WP_Error-returning cases in the Settings API. 2016-07-19 10:41:22 -07:00
Jeff Stieler ca15237332 Add test coverage for register_legacy_settings(). 2016-07-19 10:41:22 -07:00
Jeff Stieler 1fc539992c Break “legacy” setting to “new” conversion into it’s own method. 2016-07-19 10:41:22 -07:00
Jeff Stieler 6c53cfa167 Add test for register_legacy_group() and coverage annotations. 2016-07-19 10:41:22 -07:00
Jeff Stieler 3747505d83 Add initial test file for WC_Register_Legacy_Settings, with test for constructor. 2016-07-19 10:41:22 -07:00
Jeff Stieler 1cde743121 Reuse WC Admin Setting’s save_fields() instead of duplicating code for sanitizing saved values. 2016-07-19 10:41:22 -07:00
Jeff Stieler a53040f186 Remove namespace from Settings API unit test file.
This fails builds on PHP 5.2.x.
2016-07-19 10:41:22 -07:00
Jeff Stieler fde3318b41 Fix unit tests. 2016-07-19 10:41:22 -07:00
Justin Shreve 6bb546e11c Wrap up settings api 2016-07-19 10:41:22 -07:00
Justin Shreve 05a2644066 Wrap up settings endpoints for updating, finish tests. 2016-07-19 10:41:22 -07:00
Justin Shreve fa5425109e Refactor down to two concepts - settings groups and settings. Fix up tests, and start working on returning actual settings and their values. 2016-07-19 10:41:22 -07:00
Justin Shreve f425a3735a Add a test for settings groups, make sure any bad keys/values are filtered out, update docs. 2016-07-19 10:41:22 -07:00
Justin Shreve 06e787a26d Misc cleanup. 2016-07-19 10:41:22 -07:00
Justin Shreve 6c2be482ca Add a permissions check to the locations endpoints and fill out the tests for them. 2016-07-19 10:41:22 -07:00
Justin Shreve eb4291f699 More setting location tests. 2016-07-19 10:41:22 -07:00
Justin Shreve 9369d55ff4 Add the ability to get data on a single location. 2016-07-19 10:41:22 -07:00
Justin Shreve c6b0debe26 Make /settings/locations work properly. Add skeleton for tests and add register_routes test. 2016-07-19 10:41:22 -07:00
Justin Shreve fc076eb57e Initial /settings API controller and /settings/locations route. Loads the WP-API and registers our namespace temporarily until WP-API is loaded by WC core. 2016-07-19 10:41:22 -07:00
Claudio Sanches 7778583340 Fixed wrong number of decimal precision, closes #11368 2016-07-11 17:26:54 +02:00
Claudio Sanches 7d9d091767 Fixed mixed tabs and spaces 2016-07-11 16:56:35 +02:00
Claudio Sanches c59a5c0c31 Say hello to woocommerce.com 2016-07-05 19:52:16 -03:00
Claudio Sanches f0e1881520 Merge pull request #11313 from antoscarface/fix-product-variable-unit-test-helper
Set product post with 'variable' product type term.
2016-06-30 15:18:05 -03:00
Claudio Sanches 08f95481e0 Normalize the "Read more" button text, closes #11319 2016-06-30 15:16:26 -03:00
Claudio Sanches 18b1b8c238 Disable empty my account endpoints, closes #11274 2016-06-30 13:58:10 -03:00
Antonino Scarfì 44ae333f82 Set product post with 'variable' product type term. 2016-06-30 17:42:03 +02:00
Mike Jolley a942cfade8 Make sure page ID is > 0
Closes #11305
2016-06-30 12:23:41 +01:00
Mike Jolley a22859ae32 Abstract unit tests 2016-06-23 15:52:12 +01:00
Mike Jolley 13d293dd25 abstract total unit tests 2016-06-22 17:02:22 +01:00
Mike Jolley 46439ddba5 Refund unit tests 2016-06-22 16:31:05 +01:00
Mike Jolley 9da9d3bf69 Unit test conditional functions 2016-06-22 15:38:28 +01:00
Mike Jolley 9fc3e24647 getter unit tests 2016-06-22 14:28:00 +01:00
Mike Jolley 8287b13cf1 Address and CRUD unit tests 2016-06-22 14:07:42 +01:00
Mike Jolley 9c7abaedcb Fixed unit tests 2016-06-22 12:29:23 +01:00
Claudio Sanches 73c5f91622 Fixed unit tests for account menus 2016-06-14 21:49:32 -03:00
Claudio Sanches 5a1388ee97 [TESTS] For REST API functions 2016-06-13 22:58:45 -03:00
Mike Jolley 9d220450f0 Fix unit test 2016-06-01 12:39:52 +01:00
Mike Jolley 854793e5ea Fix unit test by using available gateway 2016-05-27 11:29:19 +01:00
Claudio Sanches e39274e753 HTTPS for everybody 2016-05-26 22:48:49 -03:00
Mike Jolley 18b45f55cd @claudiosmweb unregister_shipping_methods didn't unset correctly - this fixes unit tests 2016-05-26 13:03:40 +01:00
Claudio Sanches 1727d043a0 Tests for wc_get_shipping_method_count() 2016-05-25 18:29:38 -03:00
Mike Jolley 7680a3ef89 Clear cache in tests 2016-05-25 12:36:25 +01:00
Claudio Sanches d43145d979 Fixed tests for wc_get_account_menu_items()
cc @mikejolley
2016-05-24 19:11:21 -03:00
Mike Jolley a02ac79339 Change range symbol to ... to avoid conflicts with postcodes with hyphens 2016-05-23 17:30:37 +01:00
Mike Jolley e00c3450c5 Discount rounding logic improvements
Instead of rounding the single item discount amount, this rounds the
line to the store DP setting before running tax logic.

Fixes #10963
Also works with #10573

Includes unit tests
2016-05-23 16:56:31 +01:00
Mike Jolley 26db1bb52b Add test case for #10963 2016-05-23 16:23:51 +01:00
Mike Jolley 83857de24d Fix tax label test 2016-05-16 12:00:03 +01:00
Mike Jolley 57ec0246d5 $ unit test 2016-05-16 11:38:22 +01:00
Mike Jolley 87e9ccd343 Fixed wc_price unit test 2016-05-16 11:14:31 +01:00
Claudio Sanches 63b39e7a74 Fixed tests for WC_Tests_Install::test_in_plugin_update_message 2016-05-10 14:47:38 -03:00
Mike Jolley 0fb69be938 Unit test update - ranges do not expand 2016-04-22 18:04:04 +01:00
Claudio Sanches cfedab0d74 Added Bitcoin/BTC currency
@mikejolley
2016-04-18 20:28:04 -03:00
Claudio Sanches 71aa29d144 Added new 109 currencies
@mikejolley
2016-04-18 20:21:14 -03:00
Claudio Sanches b99fbe560a Fixed tests for currencies 2016-04-05 15:31:15 -05:00
Mike Jolley e2139a5c5e Clear prices transient for variable products after scheduled sale. 2016-03-31 12:03:03 +01:00
Mike Jolley 17d11d76ce Tests failing due to missing SERVER_NAME 2016-03-23 15:35:06 +00:00
Mike Jolley 495aac2df1 Remove backslash 2016-03-23 14:28:45 +00:00
Mike Jolley 2fec0f425a Remove namespaces from tests for 5.2 support 2016-03-23 12:14:13 +00:00
Mike Jolley d4521df9d3 Fix zone test 2016-03-23 11:35:15 +00:00
Mike Jolley d63d062470 Run self update in script to avoid breaking tests on 5.2 2016-03-23 10:46:35 +00:00
Mike Jolley 8d76396eaf Merge pull request #10588 from justinshreve/payment-tokens-wc-data
Convert WC_Payment_Tokens to use the new WC_Data
2016-03-22 14:14:29 +00:00
Justin Shreve 1d35fd6d73 Convert WC_Payment_Tokens (and CC/eCheck tokens) to use the new WC_Data and meta handling code. 2016-03-21 11:06:17 -07:00
Justin Shreve 705213d4f5 Move meta_id into the _meta_data array instead of trying to use them as array keys.
This is so we can just use PHP's keys, instead of trying to add new meta and guess an avaible key.
2016-03-18 12:24:35 -07:00
Justin Shreve 5d6cdd05f1 Finish out tests, make sure to use cprrect meta ID field in order by clause. 2016-03-14 11:12:47 -07:00
Justin Shreve 97c0edf445 Start on tests for testing CRUD meta.
Includes Mock object for testing against the abstract WC_Data.
2016-03-14 11:12:47 -07:00
Justin Shreve ea260254c1 Fix feedback. 2016-03-14 09:41:37 -07:00
Justin Shreve 5dbfc7ae16 Fix Payment Token 'set default' methods. Makes sure we are using the user ID of the payment token, and not the current user.
Also makes sure to properly unset other tokens when a new one is set as default. Finally, we make sure that a user is always set in our payment token tests (which was broken in some WP versions which alerted us to some broken tests).
2016-03-14 09:41:37 -07:00
Mike Jolley 333a391406 Remove wc_get_account_orders_query_args
#10500
2016-03-09 13:26:54 +00:00
Justin Shreve 49c45c6dc1 Make sure the is_default/default token ability works correctly. Also adds a new method for getting a users default token. Fixes up some docblocks. 2016-03-01 11:49:42 -08:00
Justin Shreve c0b74296ff * Remove WC_Payment_Gateway_Form in favor of having a Payment_Gateway_CC and Payment_Gateway_eCheck
* Fix up some comments to match other comments in the WC code base
* Add some missing esc_* functions
* Add a gateway filter to get_customer_tokens + a test for it
2016-03-01 11:49:42 -08:00
Justin Shreve 5d8967c7d7 Prepare a list of payment methods for output on the payment methods "my account" page. 2016-03-01 11:49:40 -08:00
Justin Shreve 8f27a3b3af Full set of tests for the payment token API 2016-03-01 11:49:40 -08:00
Mike Jolley a6cdabff7e [2.5] Multibyte safe trim string
Fixes #10378
2016-02-23 11:40:16 +00:00
Claudio Sanches 7acc0b0c94 Fix unit tests 2016-02-16 13:57:46 -02:00
Claudio Sanches 6993e52ce5 Account functions tests 2016-02-16 13:50:06 -02:00
Matty 53c0f6c712 Adds a test with incorrect values, to ensure the wc_format_country_state_string() function handles this as expected. 2016-02-16 11:05:32 +02:00
Matty 05b2d4597c Adds a unit test for wc_format_country_state_string(). 2016-02-16 09:31:29 +02:00
Claudio Sanches b71dfff8f5 [TESTS] missing ; 2016-02-11 18:01:38 -02:00