Commit Graph

295 Commits

Author SHA1 Message Date
Mike Jolley e735903c04 Unit tests for wc_add_to_cart_message
For #11563
2016-08-01 11:42:19 +01:00
Justin Shreve ef2715b237 Merge pull request #11082 from woothemes/settings-api
Add REST API Endpoints for Settings
2016-07-26 14:22:42 -07:00
Justin Shreve 9adce86239 Use the new REST unit test base class 2016-07-26 14:19:50 -07:00
Justin Shreve 5bdf2fb9e4 Remove call to spy server 2016-07-26 13:58:22 -07:00
Justin Shreve 28611544b8 Remote spy-server 2016-07-26 13:57:30 -07:00
Justin Shreve 55b37b3338 Rename helper class from 'legacy' to be more descriptive of whats happening. Registering wp-admin settings to the REST API. 2016-07-26 11:27:48 -07:00
Justin Shreve 838c27438e Merge branch 'settings-api' of https://github.com/woothemes/woocommerce into settings-api 2016-07-26 11:11:09 -07:00
Justin Shreve 02915e6056 Rename helper class from 'legacy' to be more descriptive of whats happening. Registering wp-admin settings to the REST API. 2016-07-26 11:08:29 -07:00
Justin Shreve 48e6be6dcf Move WP-APIs test server code to a vendor directory, make sure it matches the version of the other vendor files. 2016-07-26 10:24:15 -07:00
Justin Shreve 226fdb870b Misc cleanup of descriptions and some error strings. 2016-07-26 10:24:15 -07:00
Jeff Stieler 2fcb15d9cf Rename WC_Rest_Settings_Groups_Controller to WC_Rest_Settings_Controller. 2016-07-26 10:24:15 -07:00
Jeff Stieler f168f356bc Rename WC_Rest_Settings_Controller to WC_Rest_Settings_Options_Controller. 2016-07-26 10:24:15 -07:00
Jeff Stieler a0f227a17c Add test coverage for all WP_Error-returning cases in the Settings API. 2016-07-26 10:24:15 -07:00
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