Commit Graph

1028 Commits

Author SHA1 Message Date
Jon Surrell 0f63e5bfdb Add severity level tests 2016-12-29 11:58:42 +01:00
Jon Surrell 822981c009 Improve handle signature
The signature of WC_Log_Handler::handle mirrors log messages which is more intuitive.
Method docblocks have also been improved and are more complete.
2016-12-29 11:58:42 +01:00
Jon Surrell e7d6a9a48b Rotate logs
WC_Log_Handler_File now includes log rotation.
Add and improve tests.
2016-12-29 11:58:42 +01:00
Jon Surrell 7359cca4a9 Add specific file log handler tests 2016-12-29 11:58:42 +01:00
Jon Surrell ad03597a3d Simplify default log entry format
Remove punctuation. Space separate values:

TIMESTAMP LEVEL MESSAGE
2016-12-29 11:58:42 +01:00
Jon Surrell e722870aa4 Fix tests for PHP 5.2 2016-12-29 11:58:42 +01:00
Jon Surrell 8600ccc6de Restructure log tests to own directory
Also moves parent::tearDown to end of tearDown
Fix phpcs problems.
2016-12-29 11:58:42 +01:00
Jon Surrell fe02d44e31 Defauly log file level is DEBUG 2016-12-29 11:58:42 +01:00
Jon Surrell 7ba54d8617 Add test for log() === [level_short_method]() 2016-12-29 11:58:42 +01:00
Jon Surrell 227651df77 Add `setMethods` to test mocks
This may improve php 5.2 test failures
2016-12-29 11:58:42 +01:00
Jon Surrell 83aad2ba2e Use older test mock syntax for legacy compatibility. 2016-12-29 11:58:42 +01:00
Jon Surrell c5c0563f7c Restore deprecated functions WC_Logger::clear & WC_Logger::remove
Also updates clear test to supply required argument.
2016-12-29 11:58:42 +01:00
Jon Surrell fda6ab57bc Fix tests for compatibility with PHP5 2016-12-29 11:58:42 +01:00
Jon Surrell 55963b09a8 Extract anonymous functions to improve test compatibility. 2016-12-29 11:58:42 +01:00
Jon Surrell 3ef2ae611d Cleanup "A" test log file 2016-12-29 11:58:42 +01:00
Jon Surrell c418623fed Add tag context test for file log handler 2016-12-29 11:58:42 +01:00
Jon Surrell 44ea69c579 Adds tests for bubbling, etc.
Add tests teardown to cleanup log files
Fix errors in log handlers
2016-12-29 11:58:42 +01:00
Jon Surrell 7e79746302 Update tests for WC_Logger 2016-12-29 11:58:42 +01:00
Jon Surrell 4000ba6aea Use strict `assertTrue` and `assertFalse` over `assertEquals( true|false )` 2016-12-20 23:33:35 +01:00
Mike Jolley e5c18fd6e4 Fix currency check unit tests 2016-12-19 15:11:25 +00:00
Claudio Sanches 0da2f70e13 Fixed coding standards 2016-12-15 15:11:08 -02:00
Mike Jolley ac1c9b5b7b Fix test 2016-12-14 11:07:39 +00:00
Mike Jolley b5f9d6b6eb Merge percent and cart percent coupon types 2016-12-14 11:07:08 +00:00
Justin Shreve ec30c308c3 Add CLI tests 2016-12-08 14:13:10 -08:00
Mike Jolley 47fbae4d26 Product Visibility Taxonomies (#12527)
* Convert visibility and featured to taxonomy

* Comment

* Add missing tax_queries

* Only check SKU after read.

* Added visibility term for outofstock products to speed those queries up al

* wc_bool_to_string
2016-12-08 10:56:45 +00:00
Mike Jolley b0ef92c30e Better conditional for travis 2016-12-07 19:48:35 +00:00
Mike Jolley 50dd4bb774 Another travis test 2016-12-07 19:44:46 +00:00
Mike Jolley 5139c811d6 Merge pull request #12533 from woocommerce/rest-api-4.7
[2.6] API Fixes for 4.7
2016-12-07 18:51:47 +00:00
Mike Jolley fcf0ab0ba5 Tweak travis code to reduce test times. 2016-12-07 18:44:18 +00:00
Mike Jolley a6a4650809 Fix theme test 2016-12-07 13:46:01 +00:00
Mike Jolley 6a7ceab462 Fix tests by casting to array 2016-12-07 11:37:11 +00:00
Mike Jolley 44ee5f7ed3 Ensure products have different timestamps in tests. 2016-12-06 10:46:48 +00:00
Mike Jolley 84a930a607 Variations are returned newest to oldest in tests. Ensure dates differ. 2016-12-05 18:51:29 +00:00
Mike Jolley 8e81526bfc Set menu order so products return in correct order for tests. 2016-12-05 15:43:08 +00:00
Mike Jolley 162aa986b6 Fix tests 2016-12-05 14:21:09 +00:00
Mike Jolley 5f64f1bf0a Customer tests for role 2016-11-25 14:48:21 +00:00
Mike Jolley 086d8bce1d Fix is_callable 2016-11-25 14:48:20 +00:00
Mike Jolley 9087a45f29 Remove attribute_ prefix rather than add so that get_attributes has better return values, and don't show duplicate data in cart. 2016-11-24 14:20:48 +00:00
Mike Jolley 4ca49ba999 Fix tests 2016-11-23 16:27:18 +00:00
Mike Jolley d7dfdd3d10 Wrap all deprecation calls. 2016-11-23 16:15:00 +00:00
Claudio Sanches 1c9c26cda6 Fixed syntax for old versions of PHP 2016-11-23 12:56:08 -02:00
Claudio Sanches 8d19832937 Fixed coding standards 2016-11-22 23:47:13 -02:00
Mike Jolley 885dad605a Interface naming 2016-11-22 13:54:51 +00:00
Justin Shreve dd0a2317f1 Fix up data tests and some coding standards issues 2016-11-22 04:05:05 -08:00
Justin Shreve 174aa38be6 Start moving meta to normal stores, instead of a separate meta store. 2016-11-22 04:05:05 -08:00
Justin Shreve f3140889d5 Move meta handling saving/getting logic to a data store, and fix cache handling for meta to reduce queries. 2016-11-22 04:03:57 -08:00
Justin Shreve 8d551c01e6 Merge pull request #12403 from woocommerce/order-item-data-store
Order Item Data Store
2016-11-22 03:39:53 -08:00
Mike Jolley cecfac6318 Product false test 2016-11-22 10:52:18 +00:00
Justin Shreve b20b3590c8 First pass at order items 2016-11-21 10:56:21 -08:00
Mike Jolley 32de28355a Merge branch 'master' into order-data-store
# Conflicts:
#	includes/admin/meta-boxes/class-wc-meta-box-order-data.php
2016-11-21 14:45:46 +00:00
Kevin Killingsworth 919fdb7aed Add a test for variation attributes on update
This adds a test to exhibit issue #12416, which strips attributes from a
variation upon update from the CRUD object.
2016-11-21 01:45:17 -06:00
Mike Jolley 5d9a9b4dec Fix tests 2016-11-18 11:14:09 +00:00
Mike Jolley 29ddaca8e8 Merge branch 'update/shipping-zone-data-store'
# Conflicts:
#	includes/api/class-wc-rest-products-controller.php
#	tests/unit-tests/product/data-store.php
2016-11-16 15:11:13 +00:00
Mike Jolley ecc503c2c7 Merge branch 'product-crud-test-fixes'
# Conflicts:
#	includes/class-wc-data-store.php
#	woocommerce.php
2016-11-16 15:09:32 +00:00
Justin Shreve 23a325ca8d Make sure we error out on read if a zone is not found. 2016-11-16 04:53:23 -08:00
Justin Shreve 735c1b7a14 Finish moving queries to the shipping zone data store, update usage of deprecated get_zone_id, legacy updates. 2016-11-16 04:53:23 -08:00
Justin Shreve 61d1b29789 Shipping Zone Data Store 2016-11-16 04:53:23 -08:00
Mike Jolley 76b32c9aa5 WIP - Product CRUD (#12065)
* Created function to get the catalog visibility options

* First methods for WP_Product crud

* Product set methods

* Fixed several erros while setting data

* First methods for WP_Product crud

* Product set methods

* Fixed several erros while setting data

* Hardcode the get_type per product class

* Initial look through getters and setters and abstract data

* Missing var

* Add related product functions and deprecate those in class.

* No need to exclude ID

* Fixed coding standards and improved the docblocks

* Get cached terms from wc_get_related_terms()

* Fixed wrong variable in wc_get_related_terms

* Use count() instead of sizeof()

* Sanitize ids later

* Remove unneeded comments

* wc_get_product_term_ids instead of related wording and use in other places.

get_the_terms is used here and also handles caching, something
wp_get_post_terms does not.

* Clean up the abstract product class a bit, deprecate two functions we have renamed, make update & create work properly, and add some tests for it.

* Bump template version

* Handle PR feedback: Remove duplicate regular_price update, allow changing of post status for products, remove deprecation for get_title since we might still offer it as a function

* Made abstract function useful

* External Product CRUD

* _virtual meta should be 'no', not taxable, in product unit test helper

* Grouped product class

* Tests

* Move children to meta and update test

* Use get_upsell_ids

* Spacing in query

* Moving and refactoring methods

* Availability html

* Tidy/add todos

* Rename method

* Put back review functions (still todo)

* missing $this

* get_price_including_tax/excluding_tax functions

* wc_get_price_to_display

* Price handling

* [Product CRUD] Variable (#12146)

* [Product CRUD] Variable Products

* Handle PR feedback.

* [Product CRUD] Grouped Handling (#12151)

* Handle grouped product saving

* Update routine

* [Product CRUD] Product crud terms (#12149)

* Category and tag id handling

* Replace template functions

* Remove todo

* Handle default name in save function

* Product crud admin save routine (#12174)

* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Spacing

* Fix comment

* wc_implode_text_attributes helper function

* [Product CRUD] Product crud admin use getters (#12196)

* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Move settings into new files

* Refactor panels and use getters

* Use getters for variation panel

* Revert save variation changes for now

* Add todos

* Fix downloads

* REST API CRUD Updates

* Additional API updates/fixes. Added some todos

* Fix final failing tests and implementing setters/getters and attributes functionality.

* Fix comparison for is_on_sale and remove download_type from WC_Product.

* Add a wc_get_products wrapper.

* Remove the download type input from the product data metabox for downloadable products. (#12221)

* [Product CRUD] Variations - setters, getters and admin. (#12228)

* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* Feedback fixes

* Implement CRUD in the legacy REST API

* Handle PR feedback

* [Product CRUD] Getter setter proxy methods (#12236)

* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* get_prop implementation in abstract and data classes

* Implement set_prop

* Change handling

* Array key exists

* set_object_read

* Use get_the_terms() instead of wp_get_post_terms()

wp_get_post_terms() is a wrapper around wp_get_object_terms() which does not
use the object cache, and generates a database query every time it is used.

get_the_terms() however can use data from the object cache if present.

* Allow WP_Query to preload post data, and meta in wc_get_products()

Allow WP_Query to bulk query for post data and meta if more than
just IDs are requested from wc_get_products(). Reduces query count
significantly.

* [Product CRUD] Variable, variation, notices, and stock handling (#12277)

* No longer needed

* Remove old todos

* Use getters in admin list

* Related and upsells update for CRUD

* Fix notice in gallery

* Variable fixes and todos

* Context

* Price sync

* Revert variation attributes change

* Return parent data in view context

* Defer term counting

* wc_find_matching_product_variation

* Stock manage tweaks

* Stock fixes

* Correct id

* correct id

* Better sync

* Data logic setter fix

* feedback

* First methods for WP_Product crud

* Product set methods

* Fixed several erros while setting data

* Hardcode the get_type per product class

* Initial look through getters and setters and abstract data

* Missing var

* Fixed coding standards and improved the docblocks

* Get cached terms from wc_get_related_terms()

* Fixed wrong variable in wc_get_related_terms

* Use count() instead of sizeof()

* Add related product functions and deprecate those in class.

* No need to exclude ID

* Sanitize ids later

* Clean up the abstract product class a bit, deprecate two functions we have renamed, make update & create work properly, and add some tests for it.

* Remove unneeded comments

* wc_get_product_term_ids instead of related wording and use in other places.

get_the_terms is used here and also handles caching, something
wp_get_post_terms does not.

* Handle PR feedback: Remove duplicate regular_price update, allow changing of post status for products, remove deprecation for get_title since we might still offer it as a function

* External Product CRUD

* _virtual meta should be 'no', not taxable, in product unit test helper

* Bump template version

* Made abstract function useful

* Grouped product class

* Tests

* Move children to meta and update test

* Use get_upsell_ids

* Spacing in query

* Moving and refactoring methods

* Availability html

* Tidy/add todos

* Rename method

* Put back review functions (still todo)

* missing $this

* get_price_including_tax/excluding_tax functions

* wc_get_price_to_display

* Price handling

* [Product CRUD] Variable (#12146)

* [Product CRUD] Variable Products

* Handle PR feedback.

* [Product CRUD] Grouped Handling (#12151)

* Handle grouped product saving

* Update routine

* [Product CRUD] Product crud terms (#12149)

* Category and tag id handling

* Replace template functions

* Remove todo

* Handle default name in save function

* Product crud admin save routine (#12174)

* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Spacing

* Fix comment

* wc_implode_text_attributes helper function

* [Product CRUD] Product crud admin use getters (#12196)

* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Move settings into new files

* Refactor panels and use getters

* Use getters for variation panel

* Revert save variation changes for now

* Add todos

* Fix downloads

* REST API CRUD Updates

* Additional API updates/fixes. Added some todos

* Fix final failing tests and implementing setters/getters and attributes functionality.

* Fix comparison for is_on_sale and remove download_type from WC_Product.

* Add a wc_get_products wrapper.

* Remove the download type input from the product data metabox for downloadable products. (#12221)

* [Product CRUD] Variations - setters, getters and admin. (#12228)

* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* Feedback fixes

* Implement CRUD in the legacy REST API

* Handle PR feedback

* [Product CRUD] Getter setter proxy methods (#12236)

* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* get_prop implementation in abstract and data classes

* Implement set_prop

* Change handling

* Array key exists

* set_object_read

* Use get_the_terms() instead of wp_get_post_terms()

wp_get_post_terms() is a wrapper around wp_get_object_terms() which does not
use the object cache, and generates a database query every time it is used.

get_the_terms() however can use data from the object cache if present.

* [Product CRUD] Variable, variation, notices, and stock handling (#12277)

* No longer needed

* Remove old todos

* Use getters in admin list

* Related and upsells update for CRUD

* Fix notice in gallery

* Variable fixes and todos

* Context

* Price sync

* Revert variation attributes change

* Return parent data in view context

* Defer term counting

* wc_find_matching_product_variation

* Stock manage tweaks

* Stock fixes

* Correct id

* correct id

* Better sync

* Data logic setter fix

* feedback

* Prevent notices

* Handle image_id from parent

* Fix error

* Remove _wc_save_product_price

* Remove todo

* Fixed wrong variation URLs

* Fixed undefined $image_id in WC_Product_Variation::get_image_id()

* Allow wc_rest_prepare_date_response() handle timestamps

* Updated get methods on REST API for variations

* Use variations CRUD to save variations metadata

* [Product CRUD] Abstract todos (#12305)

* Get dimensions and weights, with soft deprecation

* Product attributes

* Ratings

* Fix read method

* Downloads

* Feedback

* Revert "[Product CRUD] Abstract todos (#12305)"

This reverts commit 9a6136fcf8.

* Remove deprecated get_variation_id()

* New default attributes method

* [Product CRUD] Product Datastore (#12317)

* Fix up tests in the product/* folder.

* Handle data store updates for grouped, variable, external, simple, and general data store updates for products.

* Variations & variable changes.

* Update -functions.php calls to use data store.

* Add an interface for the public product data store methods.

* Finished product factory tests

* Correctly delete in the api, fix up some comments, and implement an interface for the public variable methods.

* Fix up delete in all versions of the api

* Handle feedback

* Match protected decloration to parent

* Product crud abstract todos (#12316)

* Get dimensions and weights, with soft deprecation

* Product attributes

* Ratings

* Fix read method

* Downloads

* Feedback

* Fix up store

* Fixed method returning in write context

* Fix error in variation admin

* Check for parent value - fixes tax class

* Remove old/complete todos

* Allow set tax class as "parent"

* Removed duplicated sync

* Fixed wrong variation URLs

* Fixed undefined $image_id in WC_Product_Variation::get_image_id()

* Allow wc_rest_prepare_date_response() handle timestamps

* Updated get methods on REST API for variations

* Use variations CRUD to save variations metadata

* Remove deprecated get_variation_id()

* New default attributes method

* Fixed method returning in write context

* Allow set tax class as "parent"

* Removed duplicated sync

* Fixed coding standards

* TODO is not accurate.

* Should pass WC_Product instancies to WC_Comments methods (#12327)

* Use new method in abstract order class to prevent headers sent issue in tests

* Fixed variable description in REST API

* Updated how create initial product variation

* Fixed a few fatal errors and warnings in Products CRUD (#12329)

* Fixed a few fatal errors and warnings in Products CRUD

* Fixed sync functions

* Add variations CRUD to legacy API (#12331)

* Apply crud to variable products in legacy API v1

* New REST API do not need fallback for default attributes

* Apply variations CRUD to legacy API v2

* Legacy v2 - save default attributes

* Variations in legacy API v2 do not have descriptions

* Fixed legacy API v2 variations params

* Applied variations CRUD to legacy API v3

* Sync before save in legacy apis

* Punc

* Removed API todos

* Removed test

* Products endpoint tweaks (#12354)

* Var type already normalized on CRUD

* Let Product CRUD handle with validation, sanitization and conditional checks

* Set downloads using WC_Product_Download

* Stop try catch exceptions more than one time

* Handle WC_Data_Exception in legacy API

* Complete remove products when fails on creating

* On creating I mean!

* Already have a method to complete delete products

* Fixed standards using WP CodeSniffer

* get_the_terms() returns false when empty

* get_manage_stock returns boolean

@claudiosanches

* Merge conflict

* Variations API endpoint fixes

* Product CRUD improvements (#12359)

* args is not used any more - remove todo

* Added test for attributes

* wc_get_price_excluding_tax usage

* parent usage

* Fix rating counts

* Test fixes

* Cleanup after tests

* Make sure status transition code runs even during API calls, not just in admin.

* Default visibility

* Fix attribute setting in API

* Use get name instead of get title

* variation id usage

* Improved cross sell templates

* variation_data

* Grouped product sync

* Notices

* Sync is not needed in API

* Delete

* Rename interfaces

* Update counts in data store
2016-11-16 12:38:24 +00:00
Mike Jolley af3496402d Merge branch 'master' into product-crud
# Conflicts:
#	includes/class-wc-data-store.php
#	woocommerce.php
2016-11-16 12:37:57 +00:00
Mike Jolley 599a2ad296 Product CRUD improvements (#12359)
* args is not used any more - remove todo

* Added test for attributes

* wc_get_price_excluding_tax usage

* parent usage

* Fix rating counts

* Test fixes

* Cleanup after tests

* Make sure status transition code runs even during API calls, not just in admin.

* Default visibility

* Fix attribute setting in API

* Use get name instead of get title

* variation id usage

* Improved cross sell templates

* variation_data

* Grouped product sync

* Notices

* Sync is not needed in API

* Delete

* Rename interfaces

* Update counts in data store
2016-11-16 12:17:00 +00:00
Mike Jolley eade55041c Delete args 2016-11-15 18:11:25 +00:00
Mike Jolley c18f6efeb4 Conflicts from master 2016-11-15 11:52:05 +00:00
Mike Jolley dc60ea4c23 Merge branch 'master' into customer-data-store
# Conflicts:
#	includes/class-wc-data-store.php
#	woocommerce.php
2016-11-14 18:21:30 +00:00
Mike Jolley 00ed627b29 Data stores 2016-11-14 18:18:08 +00:00
Justin Shreve 944e5d658b Handle feedback 2016-11-14 09:08:46 -08:00
Justin Shreve 370166a6b0 Payment Token Data Store 2016-11-14 06:20:41 -08:00
Justin Shreve 4b33f11bf2 Move queries from coupon-functions.php to the coupon data store. 2016-11-14 02:31:04 -08:00
Claudio Sanches 3dfb4c98e3 Fixed coding standards 2016-11-11 15:19:40 -02:00
Mike Jolley 3d58459246 Remove old/complete todos 2016-11-11 16:28:47 +00:00
Justin Shreve 90e43d97de [Product CRUD] Product Datastore (#12317)
* Fix up tests in the product/* folder.

* Handle data store updates for grouped, variable, external, simple, and general data store updates for products.

* Variations & variable changes.

* Update -functions.php calls to use data store.

* Add an interface for the public product data store methods.

* Finished product factory tests

* Correctly delete in the api, fix up some comments, and implement an interface for the public variable methods.

* Fix up delete in all versions of the api

* Handle feedback

* Match protected decloration to parent
2016-11-11 14:31:15 +00:00
Justin Shreve 8612ce877c Merge pull request #12284 from woocommerce/system-status-security-section
New system status security section
2016-11-10 00:53:48 -08:00
Claudio Sanches c58bef1fa4 Include tests for security endpoint 2016-11-09 22:29:17 -02:00
Mike Jolley b9d60965d2 Conflicts 2016-11-09 16:53:23 +00:00
Mike Jolley 09ea4ba91f [Product CRUD] Variable, variation, notices, and stock handling (#12277)
* No longer needed

* Remove old todos

* Use getters in admin list

* Related and upsells update for CRUD

* Fix notice in gallery

* Variable fixes and todos

* Context

* Price sync

* Revert variation attributes change

* Return parent data in view context

* Defer term counting

* wc_find_matching_product_variation

* Stock manage tweaks

* Stock fixes

* Correct id

* correct id

* Better sync

* Data logic setter fix

* feedback
2016-11-09 16:10:37 +00:00
Justin Shreve e551a846b8 Implement CRUD in the legacy REST API 2016-11-09 16:05:50 +00:00
Mike Jolley 5f4dbdb733 [Product CRUD] Variations - setters, getters and admin. (#12228)
* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* Feedback fixes
2016-11-09 16:05:49 +00:00
Justin Shreve a8742a2bcc Add a wc_get_products wrapper. 2016-11-09 15:47:23 +00:00
Justin Shreve 37c8e62fcf Fix final failing tests and implementing setters/getters and attributes functionality. 2016-11-09 15:47:23 +00:00
Justin Shreve e31a75d584 Additional API updates/fixes. Added some todos 2016-11-09 15:47:23 +00:00
Justin Shreve bcae6fb1d6 REST API CRUD Updates 2016-11-09 15:47:23 +00:00
Mike Jolley 611ac8b651 [Product CRUD] Product crud terms (#12149)
* Category and tag id handling

* Replace template functions

* Remove todo

* Handle default name in save function
2016-11-09 15:41:48 +00:00
Justin Shreve 5b09c9f063 [Product CRUD] Variable (#12146)
* [Product CRUD] Variable Products

* Handle PR feedback.
2016-11-09 15:41:25 +00:00
Mike Jolley 3e6bee0712 Move children to meta and update test 2016-11-09 15:39:18 +00:00
Mike Jolley 5fc0142ba0 Tests 2016-11-09 15:39:18 +00:00
Justin Shreve 92e016f68e _virtual meta should be 'no', not taxable, in product unit test helper 2016-11-09 15:38:44 +00:00
Justin Shreve 19949d369d External Product CRUD 2016-11-09 15:38:44 +00:00
Justin Shreve 432d736520 Clean up the abstract product class a bit, deprecate two functions we have renamed, make update & create work properly, and add some tests for it. 2016-11-09 15:38:44 +00:00
Mike Jolley ed46abf3a3 [Product CRUD] Variable, variation, notices, and stock handling (#12277)
* No longer needed

* Remove old todos

* Use getters in admin list

* Related and upsells update for CRUD

* Fix notice in gallery

* Variable fixes and todos

* Context

* Price sync

* Revert variation attributes change

* Return parent data in view context

* Defer term counting

* wc_find_matching_product_variation

* Stock manage tweaks

* Stock fixes

* Correct id

* correct id

* Better sync

* Data logic setter fix

* feedback
2016-11-09 12:26:46 +00:00
Justin Shreve b41626c555 Implement Coupon Data Store (#12280)
* Implement a Coupon Data Store using CPTs..

* Handle PR feedback.
2016-11-09 12:21:18 +00:00
Claudio Sanches 8858e74c56 Fixed coding standards and tests 2016-11-08 18:27:21 -02:00
Justin Shreve 1797c76a14 Implement WC_Data_Store and related code & tests. 2016-11-08 01:39:47 -08:00
Claudio Sanches 24efdf7ec2 Updated tests readme.md example URL #12268 2016-11-07 18:00:00 -02:00
René Meye e2399fde2a Fixed referenced line number in Readme. 2016-11-07 08:31:47 +01:00
Justin Shreve 674a203487 Implement CRUD in the legacy REST API 2016-11-03 01:44:30 -07:00
Mike Jolley db0ce210a3 [Product CRUD] Variations - setters, getters and admin. (#12228)
* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* Feedback fixes
2016-11-02 18:50:42 +00:00
Justin Shreve b07879adc6 Add a wc_get_products wrapper. 2016-10-28 10:46:59 -07:00
Justin Shreve e2b90f11f3 Fix final failing tests and implementing setters/getters and attributes functionality. 2016-10-27 09:31:56 -07:00
Justin Shreve 11dfc44778 Additional API updates/fixes. Added some todos 2016-10-27 09:30:15 -07:00
Justin Shreve 7ed100dcac REST API CRUD Updates 2016-10-27 09:30:15 -07:00
Mike Jolley cc768c5406 [Product CRUD] Product crud terms (#12149)
* Category and tag id handling

* Replace template functions

* Remove todo

* Handle default name in save function
2016-10-24 10:32:15 +01:00
Justin Shreve 880dc53ac9 [Product CRUD] Variable (#12146)
* [Product CRUD] Variable Products

* Handle PR feedback.
2016-10-24 08:28:56 +01:00
Mike Jolley d705f4ceff Move children to meta and update test 2016-10-18 19:05:33 +01:00
Mike Jolley 78931220b4 Merge branch 'product-crud' into product-crud-grouped
# Conflicts:
#	tests/framework/helpers/class-wc-helper-product.php
2016-10-18 18:58:08 +01:00
Mike Jolley 2819fadd7f Tests 2016-10-18 18:38:48 +01:00
Justin Shreve c4fb1db46b _virtual meta should be 'no', not taxable, in product unit test helper 2016-10-18 10:23:20 -07:00
Justin Shreve b311caa1bc External Product CRUD 2016-10-18 09:59:02 -07:00
Justin Shreve fde97df50f Clean up the abstract product class a bit, deprecate two functions we have renamed, make update & create work properly, and add some tests for it. 2016-10-17 13:30:05 -07:00
Mike Jolley cfbb8d6601 Use meta as a cache for order/spent methods.
Closes #12080
2016-10-14 15:11:10 +01:00
Bryce Adams ea1f9aea65 Remove last order from customers part of the API (#12081)
Proposed solution to close #12080

* Also removes from tests.
2016-10-14 14:38:35 +01:00
Mike Jolley a6f4332f89 Remove non-existant field from unit test 2016-10-14 12:22:25 +01:00
Claudio Sanches 8339e9ca25 Introduces wc_get_min_max_price_meta_query() function 2016-10-14 11:19:20 +01:00
James Koster 3823b78318 Add/product galleries (#11665)
* register prettyPhoto but don't enqueue. #10721

* Remove lightbox option. #10721

Also registers the prettyPhoto styles instead of enqueueing

* Stip all prettyPhoto related stuff from the templates and tidy up some logic. #10721

* Add flexslider assets #10721

* styling and re-adds `woocommerce_single_product_image_thumbnail_html`. #10721.

* Add zoom functionality. #10721

* Move js to single-product.js. #10721

* styling of the gallery thumbnails when using the `product_page` shortcode. #10721

* Only enable the zoom if the image is large enough. #10721

* Use a 4 column layout by default. #10721

* Make the carousel options filterable. #10721

* rtl styles for gallery. #10721

* Don't zoom on handheld devices. #10721

* markup tweaks in prep for photoswipe

* disable zoom for now

* Add and enqueue photoswipe assets

* add the photoswipe template

* initialise photoswipe - it's alive!

* tidy up js. add title. add separate trigger. #10721

* Move photoswipe functions to single-product.js. #10721

* reactivate the zoom! #10721

* style the photoswipe trigger. #10721

* disable flexslider animation loop. #10721

* js tidy up. #10721

* Fix jshint

* Abstract the product gallery scripts

* Minify

* Fixed conflict with the admin bar

* Photoswipe conflict with admin bar

* Index. #10721

* photoswipe button styles. #10721

* Styling. #10721

* No animation on zoom
* Image width on mobile

* No shadows please. #10721

Looking at you, Twenty Twelve.

* code tidy and add class to placeholder figure. #10721

* simplify rtl query

* photoswipe button styles

* Comma should not be here

* zoom icon #10721

* gallery thumb styles. #10721

* trigger icon. #10721

* Image margins. #10721

* icon hover states. #10721

* Variation handling

* Fix zoom and heights

* Resize after timeout
2016-10-13 15:25:42 +01:00
Claudio Sanches 657c312cae Fix strings case (#12069)
* Fixed case for all _e, esc_attr_e and esc_html_e strings

* Fixed case for all _n_noop strings

* Fixed case for all _x strings

* Fixed case for all __, esc_html__ and esc_attr__ strings

* Fixed a few more strings

* Fixed strings in unit tests

* Fix PayPal Standard case.

* Save Order text
2016-10-12 11:16:30 +01:00
Claudio Sanches 36797a382a Fixed coding standards for tests 2016-10-04 18:57:01 -03:00
Justin Shreve ca10cca69b Merge pull request #11990 from woocommerce/variations-rest-api
Implement Variation Endpoints & Tests
2016-09-29 15:48:36 -07:00
Justin Shreve c1d7111240 Implement separate variation endpoints for managing a product's variations. Also adds tests. 2016-09-29 14:44:14 -07:00
Matty ae75f8b8cd Adjusts all references of 'woothemes' to 'woocommerce' in relevant URLs, excluding the Travis CI integration which correctly uses 'woocommerce/woocommerce'. 2016-09-28 12:17:40 +02:00
Claudio Sanches 34784e5dca Fixed unit tests for wc_get_account_downloads_columns()
cc @mikejolley
2016-09-15 19:56:23 -03:00
Claudio Sanches dec792b731 Stop coveralls for PHP 5.3 2016-09-13 20:55:58 -03:00
Mike Jolley 59dcb30928 comments 2016-09-12 21:51:32 +01:00
Mike Jolley 71d99f3434 Fix comment 2016-09-12 17:33:36 +01:00
Mike Jolley f9b2ed88c2 Merge branch 'pr/11883'
# Conflicts:
#	includes/class-wc-shortcodes.php
2016-09-12 14:53:04 +01:00
Claudio Sanches 7a4e0da1c1 Update tests for wc_format_postcode() 2016-09-09 15:05:44 -03:00
Aristeides Stathopoulos 230c0398b3 fix failing test from master 2016-09-09 19:39:09 +03:00
Justin Shreve c8ddca0635 Merge pull request #11882 from woothemes/settings-and-api-fixes
Settings & API Fixes
2016-09-09 05:52:23 -07:00
Justin Shreve e1e6c682b5 * Stop using _ as a prefix for protected or private vars and functions. We have a keyword for that.
* Introduces set_id and get_id to WC_Data for the CRUD classes to share
2016-09-09 05:36:54 -07:00
Justin Shreve 6fafbe855c Fix register-wp-admin-settings.php tests based on recent changes to handle email registration 2016-09-08 15:38:58 -07:00
Justin Shreve a36b25a68f Add setting validation to the REST API 2016-09-08 15:20:15 -07:00
Justin Shreve b665f5e1c6 Setting IDs do not need to be unique across the entire system.. just the group. 2016-09-08 15:20:15 -07:00
Justin Shreve 49676d1781 Hook up email settings to the API
Add support for option_key when registering settings, so we can also manage settings that are stored in the array of a single option.
2016-09-08 15:20:15 -07:00
Mike Jolley 9cca27f21e Take out admin check
@justinshreve I’m not sure why we had the admin check there, but I’ve
removed it because the setting of WP_ADMIN was breaking unrelated unit
tests. I think we should leave constants alone if possible and just
modify gateways.
2016-09-07 12:37:39 +01:00
Mike Jolley 311c540662 Merge pull request #11833 from aristath/master
Coding Standards (2nd pass)
2016-09-07 10:14:17 +01:00
Justin Shreve fd952e8efa Payment Gateways API 2016-09-05 14:49:29 -07:00
Aristeides Stathopoulos 5280722f21 Squiz.Commenting.InlineComment.SpacingAfter 2016-09-02 05:47:24 +03:00
Aristeides Stathopoulos 15bec47475 Squiz.Commenting.InlineComment.NoSpaceBefore 2016-09-02 05:42:33 +03:00
Aristeides Stathopoulos 39d4d4bd69 Squiz.Commenting.DocCommentAlignment.SpaceBeforeStar 2016-09-02 05:40:36 +03:00
Aristeides Stathopoulos d4e3faf014 PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket 2016-09-02 04:51:31 +03:00
Aristeides Stathopoulos 0516e96843 PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket 2016-09-02 04:33:57 +03:00
Aristeides Stathopoulos bea25afacd Squiz.Commenting.FunctionComment.SpacingAfter 2016-09-02 03:31:26 +03:00
Aristeides Stathopoulos fde1037757 fix failing tests. 2016-09-01 23:50:14 +03:00
Mike Jolley 1b2df3dd3b Merge branch 'pr/11797'
# Conflicts:
#	includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php
#	includes/api/class-wc-rest-coupons-controller.php
#	includes/class-wc-coupon.php
#	tests/unit-tests/api/coupons.php
#	tests/unit-tests/coupon/crud.php
2016-09-01 11:46:05 +01:00
Mike Jolley 402d0ff077 Merge branch 'master' into pr/11797
# Conflicts:
#	includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php
#	includes/api/class-wc-rest-coupons-controller.php
#	includes/class-wc-coupon.php
#	tests/unit-tests/api/coupons.php
#	tests/unit-tests/coupon/crud.php
2016-09-01 11:43:31 +01:00
Mike Jolley 4e14c4abeb Merge pull request #11821 from woothemes/customer-exceptions
Customer CRUD/API exceptions
2016-09-01 10:58:35 +01:00
Justin Shreve 6cb9e1b613 Since we support WP_Query filtering via the API, make sure post_status filtering works too. 2016-08-31 14:39:37 -07:00
Claudio Sanches 06280a7003 HTTPS for google maps 2016-08-31 14:18:55 -03:00
Mike Jolley 19f051c7ff Merge branch 'master' into customer-exceptions 2016-08-31 15:45:27 +01:00
Mike Jolley d9a0d0988b Handle meta data and fix unit tests 2016-08-31 15:43:34 +01:00
Mike Jolley 047242515d Make API and CRUD use consistent keys and make use of data 2016-08-30 17:50:35 +01:00
Mike Jolley 9b805670d1 Exclude 5.3 2016-08-30 14:50:33 +01:00
Mike Jolley 6fad572eb7 Attempt to stop travis error
cc @gedex
2016-08-30 13:37:39 +01:00
Mike Jolley 499e190efb Merge pull request #11785 from woothemes/coupon-exceptions
Coupon Exceptions and REST/CRUD improvements
2016-08-30 11:44:19 +01:00
Justin Shreve de4296dd15 Add some missing API pieces:
* Value was missing from the settings schema (but was still present in the response).
* Added delete endpoint for shipping zones.
* Corrected permissions check/error for shipping zone methods.
2016-08-29 10:22:29 -07:00
Aristeides Stathopoulos 7aa3a0fc9e move scripts 2016-08-27 19:52:45 +03:00
Aristeides Stathopoulos c0b43e6370 attempt to run PHPCS on travis 2016-08-27 17:18:14 +03:00
Aristeides Stathopoulos f2730eea02 WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd 2016-08-27 08:57:05 +03:00
Aristeides Stathopoulos 7c589cf7e1 WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceAfterCloseParenthesis 2016-08-27 07:53:52 +03:00
Aristeides Stathopoulos 82f3cc221e WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis 2016-08-27 07:23:02 +03:00
Aristeides Stathopoulos d430dabb37 Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines 2016-08-27 07:04:18 +03:00
Aristeides Stathopoulos 741f2b954a Squiz.WhiteSpace.SuperfluousWhitespace.EndLine 2016-08-27 07:01:22 +03:00
Aristeides Stathopoulos 55075ce3a4 WordPress.Arrays.ArrayDeclaration.IndexNoNewline 2016-08-27 06:35:20 +03:00
Aristeides Stathopoulos 17961f6484 WordPress.Arrays.ArrayDeclaration.ValueNoNewline 2016-08-27 06:04:10 +03:00
Aristeides Stathopoulos 72ee94d11b WordPress.Arrays.ArrayDeclaration.SpaceBeforeComma 2016-08-27 05:46:40 +03:00
Aristeides Stathopoulos 730069db06 WordPress.Arrays.ArrayDeclaration.SpaceAfterKeyword 2016-08-27 05:39:16 +03:00
Aristeides Stathopoulos 58b9df6564 WordPress.Arrays.ArrayDeclaration.NoSpaceAfterOpenParenthesis 2016-08-27 05:23:54 +03:00
Aristeides Stathopoulos ec8a0b288b PHPCS: WordPress.Arrays.ArrayDeclaration.NoCommaAfterLast 2016-08-27 05:08:49 +03:00
Aristeides Stathopoulos b063bcfe4c last item in a multiline-array should end in a comma 2016-08-27 04:46:45 +03:00
Mike Jolley 8eef062079 Merge pull request #11781 from woothemes/shipping-method-api
Shipping Methods API
2016-08-26 16:51:55 +01:00
Mike Jolley b0672a000a Fixed unit tests 2016-08-26 16:44:00 +01:00
Mike Jolley ed01282340 Made data match schema 2016-08-26 15:20:44 +01:00
Mike Jolley f5cc89eec2 Merge pull request #11762 from woothemes/WC_Data_Exception
WC Data Exceptions
2016-08-26 10:57:41 +01:00
Mike Jolley 9bd57414c5 Remove set and get prop - no longer need the extra overhead since functions won't return wp_error now. 2016-08-26 10:48:17 +01:00
Mike Jolley b4d6deba83 Remove var dump 2016-08-26 10:21:50 +01:00
Justin Shreve 147c18c197 Add the ability to update/create/delete shipping method instances 2016-08-25 20:34:26 -07:00
Justin Shreve 3ceb189118 Add GET /shipping_methods and GET /shipping_methods/METHOD_ID
Also adds tests.
2016-08-25 11:48:17 -07:00
Mike Jolley 6a2f87ca34 multisite sets username lowercase 2016-08-25 17:43:25 +01:00
Mike Jolley 627b08ba37 Test coverage 2016-08-25 17:42:47 +01:00
Mike Jolley 887ba3b55f Run api tests as admin 2016-08-25 14:58:14 +01:00
Mike Jolley 077f57f139 Merge branch 'master' into WC_Data_Exception 2016-08-25 11:03:14 +01:00
Mike Jolley 90137f128b Update unit test 2016-08-25 10:58:11 +01:00
Claudio Sanches d4d1a95f21 Merge pull request #11765 from woothemes/system-status-tools-options
Remove checkbox options in system status tools
2016-08-24 14:19:19 -03:00
Claudio Sanches 2b7e725928 Tests for wc_get_coupon_code_by_id() 2016-08-24 14:17:58 -03:00
Mike Jolley 49283e5576 uninstall_data replaced with constant. 2016-08-24 17:34:13 +01:00
Mike Jolley d9798f7226 Set reading to prevent exceptions during DB load 2016-08-24 14:37:19 +01:00
Claudio Sanches 5e069a4f4e Merge pull request #11756 from woothemes/update/coupon-api-crud
Update Coupon API to use CRUD
2016-08-23 19:51:27 -03:00
Mike Jolley b727acd96e Implement get and set prop methods 2016-08-23 18:48:48 +01:00
Mike Jolley 42ce6443e8 Remove backslash 2016-08-23 11:15:41 +01:00
Justin Shreve 7da590e422 Coupon Tests:
* Move tests for legacy endpoints to a legacy test folder.
* Create a test class to test the WC-API coupons endpoint.
2016-08-22 13:50:32 -07:00
Claudio Sanches 38e1be71eb ID first for all elements in the REST API
cc @mikejolley
2016-08-22 16:58:34 -03:00
Mike Jolley 39f4a1cdca Swaps meta_id for id across crud and api 2016-08-22 19:37:34 +01:00
Mike Jolley a8e47992a6 Put back add_product for convenience. Fix unit tests. 2016-08-22 18:00:52 +01:00
Mike Jolley 3d696266d2 Set_address 2016-08-22 17:03:59 +01:00
Mike Jolley c88984eb0e Replace add methods 2016-08-22 16:48:19 +01:00
Mike Jolley fdd7e797ba API get refunds 2016-08-22 13:15:15 +01:00
Claudio Sanches a8c0216225 [TESTS] Fixed customer tests 2016-08-20 14:30:04 -03:00
Claudio Sanches 80ee7016f8 Fixed conflicts 2016-08-19 20:31:59 -03:00
Claudio Sanches d60d3d5b1e Merge branch 'order-crud-api' 2016-08-19 02:07:10 -03:00
Claudio Sanches 33f155b971 Fixed indentation 2016-08-19 01:53:50 -03:00
Claudio Sanches 5da47e532f Fixed unit tests and standards 2016-08-19 01:51:25 -03:00
Mike Jolley 03110e755f Unit tests 2016-08-18 17:24:44 +01:00
Mike Jolley 99be0167b4 Order type doesn't appear to be used anywhere, and I'd expect other plugins extending orders to have their own classes anyway making this a bit pointless.
@thenbrent
2016-08-16 13:02:22 +01:00
Mike Jolley e99798f16e Date modified is read only and set by WP after update 2016-08-16 11:57:25 +01:00
Mike Jolley 62b3939aa7 Add test to ensure user was deleted 2016-08-16 10:56:52 +01:00
Mike Jolley c55170698e More namespaces removed 2016-08-16 10:50:24 +01:00
Mike Jolley fe9962bbb6 PHP 5.2 does not support namespace
cc @justinshreve
2016-08-16 10:14:36 +01:00
Mike Jolley de7e522835 Remove customer order queries for performance reasons and offer get_last_order() method instead.
Same for order counts - these don’t need to be populated after read,
only when needed. cc @justinshreve
2016-08-16 10:04:52 +01:00
Mike Jolley 83dca89d0c Correct customer escaping and tests 2016-08-15 16:53:48 +01:00
Mike Jolley fc386f054b Delete order after running test 2016-08-15 11:15:03 +01:00
Mike Jolley f03d439259 Unit test fixes 2016-08-15 11:02:55 +01:00
Mike Jolley eec9ce5b41 Revert addition of _delete_extra_meta_data
This essentially removes the ability to delete meta which is not great.

@justinshreve you added this in
https://github.com/woothemes/woocommerce/commit/e3b1f6dbc9558bae606fa76e
6941175582a301b7 - can you tell me what problems it was causing you so
we can add a different fix if needed?
2016-08-12 16:41:06 +01:00
Justin Shreve a610c6a804 Update the Customers API to use the WC_Customer CRUD Class
Also:
* Introduces Tests for the Customer REST API
* Fixes a few API and test issues from recent CRUD changes
* Adds some missing billing_ and shipping_ meta data functions to Customer CRUD
2016-08-11 10:30:44 -07:00
Justin Shreve 35cae38aa2 Fix issues from PR review: sanitize/escape fixes in wp-admin, remove modes. 2016-08-09 10:14:47 -07:00
Justin Shreve b198e6d65b Add the ability to see and update system status modes (shipping debug, template debug, uninstall...) 2016-08-09 09:51:30 -07:00
Justin Shreve 9dbd365be8 First pass at system status tools. Fully functioning endpoints for listing tools, listing data about a specific tool, and executing a tool. 2016-08-09 09:51:30 -07:00
Mike Jolley 4ac4bcaa08 Merge branch 'master' into WC-CRUD
# Conflicts:
#	tests/unit-tests/cart/cart.php
2016-08-09 11:08:21 +01:00
Mike Jolley cfe28c9b25 Made WC_Logger pluggable via wc_get_logger function.
Closes #11474
2016-08-08 13:59:23 +01:00
Mike Jolley 1c592b3872 Merge pull request #11208 from woothemes/orders-crud-classes
Orders crud classes
2016-08-05 15:44:15 +01:00
Mike Jolley 152134ed5e Add unit test for #11626 2016-08-05 12:11:35 +01:00
Mike Jolley ccad4d2df3 Merge pull request #11561 from woothemes/add/product-reviews-create-and-update
Add tests, create, update, delete, and batch to the Product Reviews API
2016-08-05 11:16:42 +01:00
Justin Shreve 59a68e11e3 Remove test for number of meta, since we don't delete extra meta bits anymore. The test for content is enough. 2016-08-04 13:17:53 -07:00
Justin Shreve f4353f6aa9 Don't save to the database if we are working with sessions, save to the session when save() is called instead. 2016-08-04 11:39:34 -07:00
Justin Shreve 47c299583d Merge pull request #11618 from woothemes/update/wp-admin-system-status
Update wp-admin's system status page to share backend code with the API
2016-08-04 10:55:19 -07:00
Mike Jolley 8867368b97 Fix unit tests 2016-08-04 17:24:23 +01:00
Mike Jolley 1bc9da3e91 Merge branch 'master' into WC-CRUD
# Conflicts:
#	includes/class-wc-coupon.php
2016-08-04 12:10:04 +01:00
Justin Shreve 8df6ff3c7b Convert wp-admin's system status page to use the same backend code as the API. 2016-08-03 10:50:47 -07:00
Mike Jolley 837e08143b Merge branch 'master' into orders-crud-classes
# Conflicts:
#	includes/abstracts/abstract-wc-order.php
2016-08-03 12:32:27 +01:00
Justin Shreve 7529b0b3e9 Code cleanup 2016-08-02 10:30:43 -07:00
Justin Shreve a305da25ef Add batch support to the product reviews endpoint. 2016-08-02 10:30:43 -07:00
Justin Shreve b8ec255ea8 First pass at a product reviews REST API that supports creating/updating/deleting product reviews. 2016-08-02 10:30:43 -07:00
Justin Shreve 9396c5436b Make sure that the create shipping zone uses the correct permissions function. Also makes sure creating the shipping zone returns 201, with the location of the new entity, like other endpoints. 2016-08-02 10:26:26 -07:00
Justin Shreve 9a03eb4407 Use the new API test base for shipping zone tests. 2016-08-02 10:10:47 -07:00
Justin Shreve 1ba2c6e4d6 Line break on spy-server 2016-08-02 10:10:47 -07:00
Justin Shreve 33e0b367ac Add new line at end of files. 2016-08-02 10:10:47 -07:00
Jeff Stieler 105064ad26 Test coverage for getting a single shipping zone method. 2016-08-02 10:10:47 -07:00
Jeff Stieler e007bc1778 Test coverage for all shipping zone methods endpoint. 2016-08-02 10:10:47 -07:00
Jeff Stieler cdc90f5633 Test coverage for shipping zone method routes. 2016-08-02 10:10:47 -07:00
Jeff Stieler b9a0367cfa Test coverage for update shipping zone locations endpoint. 2016-08-02 10:10:47 -07:00
Jeff Stieler e5fac4911e Test coverage for requesting shipping zone locations with an invalid ID. 2016-08-02 10:10:47 -07:00
Jeff Stieler 0db15c5328 Add test coverage for shipping zone locations retrieval endpoint. 2016-08-02 10:10:47 -07:00
Jeff Stieler 9946d028f2 Add “described by” link to shipping zones endpoint response. 2016-08-02 10:10:47 -07:00
Jeff Stieler 9b564b87b1 Add test coverage to single shipping zone retrieval endpoint. 2016-08-02 10:10:47 -07:00
Jeff Stieler 6a9ba5b9f3 Add test coverage for shipping zone update endpoint. 2016-08-02 10:10:47 -07:00
Jeff Stieler e037cf661e Add test coverage to shipping zone creation endpoint. 2016-08-02 10:10:47 -07:00
Jeff Stieler 3492f397d4 Add test coverage for shipping zone schema endpoint. 2016-08-02 10:10:47 -07:00
Jeff Stieler e4ccede35f Test coverage for /shipping/zones.
Covers success, shipping disabled, and insufficient permissions cases.
2016-08-02 10:10:47 -07:00
Jeff Stieler bbe5ffc295 Add helper method to create shipping zones during testing. 2016-08-02 10:10:47 -07:00
Jeff Stieler 2a7e81a809 Initial Shipping Zones unit test coverage, testing route registration. 2016-08-02 10:10:47 -07:00
Jeff Stieler 2267e62fe0 Add REST API testing bootstrap. 2016-08-02 10:10:47 -07:00
Justin Shreve 72f01d9c0a Merge pull request #11548 from woothemes/system-status-api
Add system status info REST API endpoint
2016-08-02 10:08:45 -07:00
Fredrik Forsmo 9d07cf59b1 Use long array syntax instead of short array syntax 2016-08-01 18:08:42 +02:00
Fredrik Forsmo 88d8140110 Add tests for `wc_site_is_https`
Add callback url to `wc_site_is_https` test
2016-08-01 14:31:54 +02:00
Mike Jolley e735903c04 Unit tests for wc_add_to_cart_message
For #11563
2016-08-01 11:42:19 +01:00
Justin Shreve 5d95b76e1a Rename the endpoint from system-status to system_status (matches the rest of WC endpoints). 2016-07-27 14:06:14 -07:00
Justin Shreve e436e96654 Add missing textdomains, remove wc_ prefix from a few fields, spacing/coding standard fixes. 2016-07-27 13:59:16 -07:00
Justin Shreve 041b5745b4 Finish system status tests 2016-07-27 12:19:14 -07:00
Justin Shreve 817ed71d2a Test file rename 2016-07-27 10:29:45 -07:00
Justin Shreve 8c682d7510 Test base 2016-07-27 10:29:45 -07: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
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 78142a8ebb Merge branch 'master' into WC-CRUD
# Conflicts:
#	includes/class-wc-checkout.php
#	includes/class-wc-coupon.php
#	includes/class-wc-customer.php
#	tests/unit-tests/cart/cart.php
#	tests/unit-tests/cart/functions.php
#	tests/unit-tests/coupon/coupon.php
#	woocommerce.php
2016-06-13 15:01:58 +01: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
Mike Jolley 1238a37124 Merge pull request #10576 from justinshreve/coupon-crud
Coupon CRUD
2016-03-18 11:12:32 +00:00
Justin Shreve e65ab6adec start transfering things to billing_ prefix 2016-03-17 12:39:29 -07:00
Justin Shreve 15e37ab66a Add meta handling to WC_Customer and fix some missing code with first and last name. 2016-03-17 12:03:23 -07:00
Justin Shreve 7f0e0c8f0c Finish proper integetration with WC_Data's meta methods. 2016-03-17 11:14:15 -07:00
Justin Shreve 0f1f6dddd1 Finish customer crud tests 2016-03-17 09:41:12 -07:00
Justin Shreve 8dbe673c89 Fix loading meta fields that are not address fields. Add some tests related to CRUD, and add stubs for the rest of the tests we will add. 2016-03-17 09:41:12 -07:00
Justin Shreve aa590f3845 Implement remaining customer get/setters, and start on tests. 2016-03-17 09:41:12 -07:00
Justin Shreve eb22c8b57d Initial start of WC_Customer CRUD refactor, start moving some logic to legacy class, implement WC_Data, and finally a functioning read() that works with passed DB customer info AND sessions. 2016-03-17 09:41:12 -07:00
Justin Shreve f65c9305bf Update WC_Coupon to use the new WC_Data class and meta methods. 2016-03-17 09:38:56 -07:00
Justin Shreve 90b9192c0c Combine standard getters and setters into one test to reduce code. 2016-03-17 09:19:29 -07:00
Justin Shreve 60085e582a Fix some comments/spacing issues. 2016-03-17 09:19:29 -07:00
Justin Shreve f973b9d122 Make some improvements to metadata. Don't return [0] array, allow setting custom meta with a WC_Coupon method. Fix up some tests. 2016-03-17 09:19:29 -07:00
Justin Shreve 69973d520e Update version strings 2016-03-17 09:19:28 -07:00
Justin Shreve 57f918fb03 Add Coupon REST API tests to verify nothing breaks API wise -- full set of tests even though we are just changing GET endpoints (increases test coverage) 2016-03-17 09:19:28 -07:00
Justin Shreve 0268a67c4b Address a few of the feedback items from the PR:
* Switch all coupon fields to _data
* Move coupon custom fields to _meta_data
* Shorten the 'yes' -> true checks
* Add a test for getting custom fields
2016-03-17 09:19:28 -07:00
Justin Shreve 50e1bc7117 Add tests for the getter/setter methods 2016-03-17 09:19:28 -07:00
Justin Shreve 7a0c8d146b Add the ability to create coupons via code (so things like Points & Rewards will still work). 2016-03-17 09:19:27 -07:00
Justin Shreve 3eacb992bc Address issues from Mike's Feedback:
* Rename individual use, free shipping, and exclude sale items to match their meta names closer.
* Sanitize emails when using set_email_restrictions
* Remove some unnecessary explict true checks
* Move ID into _data with the rest of the fields
* Fixed some spacing issues
2016-03-17 09:19:27 -07:00
Justin Shreve 447462b274 Allow access to coupon properties directly to allow for back-compat usage, but throw a deprecated notice. Also adds a test to make sure these properties work as they should. 2016-03-17 09:19:27 -07:00
Justin Shreve d738dec05d Coupon CRUD (WIP). 2016-03-17 09:19:27 -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
Claudio Sanches 1d2f4d21e1 [TESTS] Fixed write context fatal error 2016-02-11 17:47:03 -02:00
Claudio Sanches 3235ba177c Allow phpunit to check php syntax 2016-02-11 17:44:44 -02:00
Mike Jolley fab8a871aa Merge branch 'master' into shipping-zones
# Conflicts:
#	assets/css/admin.css
#	includes/admin/class-wc-admin-assets.php
2016-02-10 14:12:39 +00:00
Mike Jolley 75c264837f Justins feedback/code tidy 2016-02-10 13:21:16 +00:00
jamez 5256cf47dc Canada Postal code validation
Added Postal Code validation for Canada (country-code=CA).  Also added
to the validation unit test for valid and invalid postal code examples.
2016-02-09 12:39:09 -05:00
Mike Jolley 352184cc06 Merge branch 'master' into shipping-zones
# Conflicts:
#	assets/css/admin.css
#	i18n/languages/woocommerce.pot
#	includes/abstracts/abstract-wc-payment-gateway.php
#	includes/abstracts/abstract-wc-shipping-method.php
#	includes/admin/settings/class-wc-settings-shipping.php
#	includes/wc-core-functions.php
#	uninstall.php
2016-02-05 14:58:48 +00:00
Shiva Poudel 27532a80ba Fix - Unit test for woocommerce currencies 2016-01-27 12:02:43 +05:45
Claudio Sanches 2cc13b6409 Fixed unit tests #10114 2016-01-21 20:19:03 -02:00
Joey Kudish ece376bac1 weight/dim normalization: allow custom from unit
Add a third optional parameter to the weight and dimension normalization
functions in order to be able to specify a specific "from unit" instead
of using the site option. This allows arbitrary conversions between
different units of measure; which is particularly useful for extensions
that need to perform arbitrary unit conversions (e.g. shipping extension
that specifies custom box formats).

Also includes updated tests.
2016-01-12 22:48:56 -08:00
Mike Jolley bdb8de7785 Zone unit tests 2016-01-08 14:53:24 +00:00
Mike Jolley a33b9b9750 Unit tests for shipping zones 2016-01-08 13:56:01 +00:00
Mike Jolley 97d47fb576 Move zones to main settings 2016-01-05 11:23:15 +00:00
Shiva Poudel 4146558fd6 Updated the currency code for 'Lao Kip'
See: https://en.wikipedia.org/wiki/ISO_4217
2015-12-17 11:52:38 +05:45
Claudio Sanches a7333a6e10 Fixed unittest dependencies 2015-12-15 16:41:07 -02:00
Claudio Sanches 4f6c17a6a1 Fixed test for get_woocommerce_currencies() 2015-12-09 16:38:57 -02:00
Takashi Irie d88ba80f84 Edits for Twnety Sixteen 2015-11-23 11:55:50 +00:00
Claudio Sanches 5893875b0c Removed period for file headers 2015-11-03 11:53:50 -02:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Mike Jolley 92310feb98 Merge pull request #9457 from woothemes/9251-wc-cart-functions
Moving some methods from WC_Cart to new functions
2015-10-30 13:12:55 +00:00
Claudio Sanches 0ff88deb98 Improved wc_coupons_enabled() name and description 2015-10-29 17:23:10 -02:00
Claudio Sanches a7028e7734 Fixed tests for get_woocommerce_currencies() 2015-10-28 16:24:17 -02:00
Claudio Sanches f3694cf17b Fixed tests for the new cart and coupons functions 2015-10-28 16:09:53 -02:00
Jeff Stieler 513e95838b Use the same default WP test lib directory as the updated test installer script.
The previous version of WP-CLI’s install.sh didn’t take environmental variables into account.
2015-10-20 10:24:46 -06:00
Jeff Stieler 3d232cb736 Use proper tests checkout for WP_VERSION=latest
See https://github.com/wp-cli/wp-cli/issues/2129 for more info.
2015-10-20 09:40:00 -06:00
Akeda Bagus f3dfdd20da Assert log line format and its log message instead of log line equality.
Timestamp is not reliable to assert during the test.
2015-09-12 21:18:41 +07:00
Claudio Sanches cc12253339 Make travis use php lint in all files 2015-08-20 15:08:02 -03:00
Shiva Poudel 376320f4eb Corrected docblock for scrutinizer ocular 2015-08-19 20:34:05 +05:45
Ramon van Belzen ff2feed3f3 Update travis.sh 2015-08-19 09:47:50 +02:00
Claudio Sanches c324c66acc Fixed tests for #8835 2015-08-14 15:39:20 -03:00
George Stephanis c938fa24da More missing esc_attr calls, :( 2015-08-05 15:17:52 -04:00
Claudio Sanches 0361a10e26 Removed instances of WC_Order in favor to wc_get_order(), closes #8689 2015-07-30 15:07:34 -03:00
Claudio Sanches 7d4a531703 Fixed tests for variable products 2015-07-28 13:07:48 -03:00
Shiva Poudel f543430476 Unit Test class instance of Integrations 2015-07-20 16:55:58 +05:45
Claudio Sanches 409dd81ab9 Fixed unit tests for WC_Cart::get_remove_url() 2015-07-14 12:02:32 -03:00
Claudio Sanches ac8f18a721 Fixed unit tests
@mikejolley
2015-07-08 23:40:29 -03:00
Mike Jolley ac6cc96d35 Customer needs to be defined 2015-07-07 12:51:05 +01:00
Mike Jolley 6773b74770 Unit test - customer_address is geolocated 2015-07-07 12:36:06 +01:00
Claudio Sanches c13409150f Fixed tests for get_woocommerce_currencies()
@mikejolley
2015-06-29 15:13:42 -03:00
Justin Shreve 0a9d00bab6 Update the version number check for test_get_woocommerce_api_url 2015-06-19 13:42:10 +00:00
Mike Jolley 1f79a116e9 Fix create_simple_flat_rate helper 2015-06-16 14:48:06 +01:00
Justin Shreve 651b65f28e Add a unit test for get_variation_id so we know we are getting back the IDs that we want 2015-06-09 13:02:02 +00:00
Claudio Sanches d5c5d5e394 Fixed unit tests for wc_get_price_thousand_separator() and wc_get_price_decimal_separator() 2015-06-01 11:03:19 -03:00
Claudio Sanches eff9b5ec18 Fixed test for wc_format_list_of_items 2015-05-28 10:28:49 -03:00
Claudio Sanches 9826273f8f Merge pull request #7910 from SiR-DanieL/unit-tests
More unit tests
2015-05-28 10:27:10 -03:00
Mike Jolley 5ef335b169 Merge pull request #8215 from JeroenSormani/order-tests
Order tests
2015-05-28 12:44:17 +01:00
Claudio Sanches ef8c3dd267 Fixed testes for wc_price() 2015-05-27 13:26:26 -03:00
JeroenSormani 7dde4f58c7 WC_Helper_Order class convert tab alignment to spaces 2015-05-23 10:57:06 +02:00
JeroenSormani 280904f9b4 WC_Helper_Order order total correct 2015-05-23 10:54:14 +02:00
JeroenSormani 59a4ca5fa6 Add WC_Helper_Order class 2015-05-23 10:52:06 +02:00
JeroenSormani b95b22d144 Add wc_get_order() tests + Order helper class 2015-05-23 10:48:07 +02:00
Claudio Sanches 8a9ab7ffea Fixed get_woocommerce_api_url() for the new API versions numbers and
fixed the tests

@mikejolley
2015-05-05 09:01:34 -03:00
Mike Jolley 5786f89b3c Update unit test for c37c1bd9fa 2015-05-01 15:28:17 +01:00
Nicola Mustone f41e101b3f test wc_processing_order_count, wc_orders_count 2015-04-14 16:47:04 +02:00
Nicola Mustone 839b5a4aa5 Tests for wc_format_list_of_items, wc_cart_totals_subtotal_html, wc_cart_totals_coupon_label 2015-04-14 16:37:10 +02:00
Nicola Mustone f5d5bf0a00 typo 2015-04-14 15:40:47 +02:00
Nicola Mustone d4508bed9c adding data provider notes in the README 2015-04-14 15:40:20 +02:00
Nicola Mustone 0347a4005f added data providers 2015-04-14 15:34:35 +02:00
Mike Jolley 2ddd07b252 FIx fixed product discount 2015-04-10 10:55:40 +01:00
Nicola Mustone d4ff494a3f test wc_get_price_decimals, wc_get_price_decimal_separator, wc_get_price_thousand_separator 2015-04-09 17:35:35 +02:00
Nicola Mustone 58f86eddf9 test wc_sanitize_tooltip 2015-04-09 17:24:58 +02:00
Nicola Mustone bf1407a60d added filters to test_wc_placeholder_img 2015-04-09 17:14:59 +02:00
Nicola Mustone ce41820fbf test wc_placeholder_img 2015-04-09 17:10:00 +02:00
Nicola Mustone 68e36f625a test wc_delete_product_transients 2015-04-09 17:00:07 +02:00
Nicola Mustone b8850724d3 tests now check for empty arrays first 2015-04-09 16:56:45 +02:00
Nicola Mustone 5815b5f155 test wc_get_featured_product_ids 2015-04-09 16:50:28 +02:00
Nicola Mustone 51c4019c76 test wc_get_product_ids_on_sale 2015-04-09 16:43:18 +02:00
Nicola Mustone 50abebac89 tests WC_Validation 2015-04-08 17:56:02 +02:00
Nicola Mustone bc2bbf07c5 test wc_get_log_file_path 2015-04-08 17:55:54 +02:00
Nicola Mustone 8c52135c26 test wc_get_log_file_path 2015-04-08 17:55:40 +02:00
Nicola Mustone 1f8e512b01 tests WC_Logger 2015-04-08 17:55:19 +02:00
Barry Kooij 017c3b341e Merge pull request #7655 from SiR-DanieL/unit
Begin tests WC_Validation
2015-04-08 13:15:18 +02:00
Mike Jolley 37507ec451 Merge pull request #7654 from SiR-DanieL/patch-4
Fix documentation for unit tests
2015-04-08 12:12:53 +01:00
Claudio Sanches b697a714a7 Fixed the testes for wc_get_weight() 2015-03-11 14:23:47 -03:00
Nicola Mustone c72e44401a begin tests WC_Validation 2015-03-06 18:27:18 +01:00
Nicola Mustone c15091d294 no longer using formatting-functions.php 2015-03-06 17:43:02 +01:00
Barry Kooij f699f5102c Unit Tests: Fix Product\Functions tests 2015-03-06 16:59:19 +01:00
Barry Kooij 75e9f93891 Unit Test: Product_Simple fixes.
Related #7624
2015-03-06 16:55:11 +01:00
Barry Kooij d6b970a61d Namespace the Unit Tests 2015-03-06 16:32:40 +01:00
Nicola Mustone d20047430b more tests 2015-03-05 17:32:53 +01:00
Nicola Mustone eefdfac91d delete product if not empty 2015-03-05 17:32:45 +01:00
Nicola Mustone 1b941941a2 wrong tearDown 2015-03-04 18:25:29 +01:00
Nicola Mustone 36ece7a7f8 test WC_Product_Simple 2015-03-04 18:23:25 +01:00
Nicola Mustone 99c35e83eb added more product functions tests 2015-03-04 16:48:11 +01:00
Nicola Mustone 3615e75de1 helper methods to get and delete a dummy product 2015-03-04 09:33:05 +01:00
Nicola Mustone 72c2d37478 restore _manage_stock properly 2015-03-04 09:25:15 +01:00
Nicola Mustone c916037f10 test wc-product-functions.php 2015-03-04 09:00:33 +01:00
Nicola Mustone 42107fa37b fix option name 2015-03-03 12:47:13 +01:00
Nicola Mustone a18d2bd158 localize status in test_wc_get_order_status_name 2015-03-03 12:42:58 +01:00
Nicola Mustone e602082056 test order-functions 2015-03-03 12:38:05 +01:00
Nicola Mustone 9877d49207 test_wc_trim_string 2015-03-03 12:37:57 +01:00
Nicola Mustone f1f8759c41 test_wc_is_valid_url 2015-03-03 12:37:49 +01:00
Nicola Mustone 060bce3f00 delete created product 2015-03-02 17:11:42 +01:00
Nicola Mustone 6ac167ac36 wc-cart-functions - unit tests begin 2015-03-02 17:06:03 +01:00
Mike Jolley 3623d82881 Fix compound tax unit test #7525 2015-02-23 11:03:06 +00:00
Paul Kilmurray cb12623fa7 Compound tax calculation test
There is either an error in the calculation for compound taxes, or
there is something wrong with my understanding of how compound taxes
should work - I’m definitely not discounting the later.

Given a price of $9.99 exclusive of tax, applying a 10% tax will give
9.99 + 0.999 = 10.989. Then applying a compound tax of 2% should give
10.989 + 0.2198 = 11.2088.

The result of the WC_Tax::calc_tax on the 2% compound tax is 0.1998
which seems to be in error.

Likewise for prices exclusive of tax.

Note: rounding to 4 decimal places on all calculations
2015-02-23 14:40:10 +08:00
shivapoudel db012b03df Cleanup WC_Unit_Test_Case 2015-02-04 22:07:52 +05:45
shivapoudel b207391041 Unit Test docblock comment for setUp 2015-02-04 22:03:01 +05:45
shivapoudel 23a94dea1d Tweaks roles typo 2015-02-03 22:07:58 +05:45
Jeroen Sormani cd1e706327 Merge remote-tracking branch 'upstream/master' 2015-01-11 10:30:03 +00:00
Claudio Sanches c4812461da [Tests] Fixed the WC_Tests_Tax::test_get_shipping_tax_rates() 2015-01-05 14:59:16 -02:00
Claudio Sanches b3cf6435b9 Merge pull request #6927 from purcebr/master
Unit Tests for WC_Customer class
2015-01-05 14:50:54 -02:00
Mike Jolley 6dced09940 Fix test_get_rates unit test 2015-01-05 16:40:31 +00:00
Mike Jolley 7d5e13cea6 Update wc_get_base_location() unit test 2015-01-05 10:26:35 +00:00
Mike Jolley 8df8c9b482 Make 'public', and rewrite, optional for attributes
#6852
2014-12-22 14:16:15 +00:00
Jeroen Sormani a1ee0d7d87 Revert back to original wp_test_dir 2014-12-22 13:34:43 +01:00
Jeroen Sormani 4a3bf7029c Revert back to original wp_test_dir 2014-12-22 13:34:09 +01:00
JeroenSormani d523bd4c82 Replace many asserts with @dataProvider 2014-12-21 21:57:30 +01:00
JeroenSormani 9fad3f2171 Fix to make it work on local machines 2014-12-21 21:47:59 +01:00
Claudio Sanches 82e15ab231 [Tests] Updated the test for wc_get_core_supported_themes() 2014-12-12 10:29:22 -02:00
Bryan Purcell 54d50d8307 Clearing out the cart, and the mock product 2014-12-11 00:00:49 -06:00
Bryan Purcell bc9821253f Refactoring and fixing bugs in WC_Customer Unit Tests 2014-12-10 23:54:06 -06:00