Commit Graph

98 Commits

Author SHA1 Message Date
Rodrigo Primo b6e73f528b Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-06-15 14:56:31 -03:00
Mike Jolley 9a550c4a35 Update to correct type in unit test 2018-06-14 16:34:36 +01:00
Mike Jolley 31058ac215 Tests -> CRUD 2018-06-13 16:30:42 +01:00
Gerhard Potgieter ab769eb8a7 Update test_save_default_attributes to make use of propper attributes before checking defaults 2018-06-13 15:49:38 +02:00
Mike Jolley 812586742b Allow only valid default attributes 2018-06-13 14:33:13 +01:00
Mike Jolley c37f724326 Break up tests/test contents 2018-06-13 11:39:28 +01:00
Mike Jolley 01a3e359c3 Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-06-13 10:18:38 +01:00
Rodrigo Primo 3e8cd3f837 Remove unnecessary tests cleanup code
Tests don't need to manually remove data that they create. WP test framework does that automatically after each test is executed.
2018-05-08 16:00:00 -03:00
Rodrigo Primo 47f6104580 Add more unit tests to improve test coverage of functions in includes/wc-stock-functions.php 2018-05-08 15:58:03 -03:00
Rodrigo Primo 41f5985087 Fix PHPCS violations automatically using phpcbf 2018-05-08 15:48:55 -03:00
Rodrigo Primo bf0da0287d Simple placeholders should not be quoted 2018-04-20 09:28:08 -03:00
Rodrigo Primo 9c33f133b6 Fix parameter order when calling PHPUnit_Framework_TestCase::assertEquals()
The first parameter passed to PHPUnit_Framework_TestCase::assertEquals() should be the expected value and the second parameter the actual value and not the other way around.
2018-04-19 17:25:38 -03:00
Rodrigo Primo 94751f2872 Use data store loader instead of hardcoding data store class name
This way plugins extending WC core data stores can still benefit from WC core tests
2018-04-02 15:50:44 -03:00
Rodrigo Primo d55c0d63b1 Add unit tests group 'core-only'
This group is used to identify unit tests that will work only when testing WC core. This is necessary since we are using WC core unit tests to test the custom product tables plugin and some tests should be skipped in this context.
2018-04-02 15:15:23 -03:00
Rodrigo Primo bb553c88ae Merge branch 'master' into feature/product-custom-tables-supporting-changes 2018-03-29 12:05:55 -03:00
Mike Jolley 133ed2d24b Tests 2018-02-28 13:33:24 +00:00
Mike Jolley e905a009d0 CRUD tests 2018-01-18 15:07:05 +00:00
Mike Jolley 6fd40d7e37 Remove transaction tests 2018-01-18 14:48:43 +00:00
Mike Jolley dbdc3af9e5 Tests 2018-01-12 14:20:39 +00:00
Mike Jolley 8a58c1de40 Unit test for get_price_html calls in sequence
Closes #18037
2017-12-06 11:52:55 +00:00
claudiulodro a878b0cde5 Some phpcs 2017-11-22 14:03:26 -08:00
claudiulodro a73436bdcd Merge remote-tracking branch 'origin/master' into HEAD 2017-11-20 14:43:12 -08:00
claudiulodro 03d51e5471 Tweak variable on backorder logic 2017-11-20 11:32:30 -08:00
claudiulodro b64b26d030 Variable products are on backorder if all children are backordered 2017-11-20 11:19:06 -08:00
claudiulodro dddf0ee473 Variable product sync 2017-11-17 08:46:49 -08:00
Claudio Sanches a32fae4191 Fixed WC_Tests_Product_Data::test_product_getters_and_setters tests 2017-11-16 17:23:42 -02:00
claudiulodro be6f9d68bc Automatic transitions for variables 2017-11-15 12:08:19 -08:00
claudiulodro 68e23911ba Automatically transition stock statuses 2017-11-15 10:48:39 -08:00
claudiulodro db117d6344 Backordered products should count as in stock 2017-11-14 14:54:11 -08:00
claudiulodro c312cc35b1 Add new onbackorder stock status 2017-11-14 13:40:03 -08:00
Mike Jolley 6f693d4d1a Upgrade routine 2017-11-07 19:16:44 +00:00
Mike Jolley db4e630600 Replace thumbnail names 2017-11-07 18:48:51 +00:00
Gerhard Potgieter 8045596ed7 Add get_tax_class tests for WC_Product_Variation. Will ensure #17147 never happens again. 2017-10-12 14:46:28 +02:00
mitraval192 2ee59801c2 added secure link 2017-09-11 17:24:55 +05:30
Mike Jolley 1e9e6c461f Unit test for #16653 2017-08-31 11:42:19 +01:00
Mike Jolley 5e2ce54530 update tests 2017-08-07 17:19:19 +01:00
claudiulodro e1fad0d7eb Bring up to date with master 2017-07-28 14:27:19 -07:00
claudiulodro e335724c50 Finalize product query 2017-07-28 11:59:44 -07:00
claudiulodro b2e42fb55f Add visibility test 2017-07-27 08:57:44 -07:00
claudiulodro ec6d11bd67 Just needs visibility support and cleanup 2017-07-25 10:01:24 -07:00
claudiulodro cdbead8961 Clean up and tests 2017-07-24 15:05:23 -07:00
claudiulodro f66198c37d Initial working wc_get_products 2017-07-14 09:50:20 -07:00
claudiulodro 7be2c7dc55 More tests 2017-07-12 14:18:51 -07:00
claudiulodro 753979ec49 WC_Product_Query 2017-07-12 13:58:39 -07:00
Mike Jolley 022c528b3e Remove value renaming code 2017-07-12 15:18:05 +01:00
Mike Jolley 21300951f1 Fix tests due to generated names 2017-05-31 13:48:28 +01:00
Timon Davis af308da6b9 Fix bug #15103 where site operator cannot assign a variation with value of '0' as the default choice on the customer facing form.
The WC_Product::set_default_attributes function uses an array_filter (using the default callback for filtration)
to remove null and false values from the defaults array for a given product.  The issue here is that, in the above use case,
the array_filter will evaluate '0' as 0 and therefore as false.  Ultimately, array_filter then prevents the value from being
recorded, moving forward.

I've added a new filter callback to includes/wc-attribute-functions which will disregard all FALSE PHP equivalents except for
'0' (as a a string).  Also, I've updated the filter_array call in WC_Product::set_default_attributes so that it uses this new callback,
instead of the PHP default. Finally, I've added a phpunit test to assert that, when storing default variations / attributes on a product,
the false/true PHP synonyms are evaluating and storing like one would normally expect, with the exception that (string) '0'
evaluates as true in this special case.

This solution could potentially be broadened to facililate similar rules elsewhere, but the need raised in the bug is specific and
this is a specific solution.
2017-05-18 02:43:14 -07:00
Mike Jolley 24fe8db5eb Fix test 2017-05-08 19:14:33 +01:00
Claudio Sanches e208e35e33 Fixed coding standards in tests 2017-04-20 01:34:58 -03:00
Mike Jolley 5cfed7569c Simplify wc_is_attribute_in_product_name and change separator 2017-04-11 21:12:30 +01:00