Commit Graph

71 Commits

Author SHA1 Message Date
Rodrigo Primo 6cd08dc7bd Use the spread operator instead of call_user_func_array() in WC_Data_Store
This commit replaces a call to call_user_func_array() in WC_Data_Store::__call() with argument unpacking using the spread operator which was introduced in PHP 5.6. This change should improve WooCommerce performance a tiny bit since WC_Data_Store::__call() is called somewhat frequently and call_user_func_array() has a bad performance reputation. I added one unit test to make sure this change doesn't break the functionality of the altered method.
2019-11-21 11:52:47 -03:00
Rodrigo Primo ed1c4b11b8 Fix PHPCS errors in WC_Tests_Data_Store class file 2019-11-21 10:41:27 -03:00
Rodrigo Primo 44b09cb15a Remove unused test method 2019-11-21 10:40:38 -03:00
Rodrigo Primo 16442956e8 Fix PHPCS errors 2019-07-19 10:19:23 -03:00
Claudio Sanches 16041d9247 Fixed failing tests 2019-07-18 22:42:31 -03:00
Rodrigo Primo 18ee70918b Fix PHPCS violations in tests/ using PHPCBF
This commit fixes all 1533 PHPCS errors that PHPCBF can fix automatically in the tests/ directory. Before this change there was a total of 3106 PHPCS errors in the WooCommerce repository and now there is 1573 errors.
2019-05-01 19:05:00 -03:00
Mike Jolley 3c81096605 Added test 2018-03-01 12:12:26 +00:00
Mike Jolley 3778918a0a Merge branch 'master' into pr/14751
# Conflicts:
#	includes/class-wc-structured-data.php
2017-08-08 15:28:31 +01:00
Claudio Sanches 84be2dd6bb Fixed declaration of WC_Tests_CRUD_Data::onNotSuccessfulTest 2017-07-20 13:32:47 -03:00
claudiulodro 863193bd34 Fix linting problems 2017-07-06 11:12:02 -07:00
Mike Jolley b9757cca00 leave objects alone rather than slashing in the meta api
Has tests. Prevents notices when you pass an object to add_meta_data.
2017-07-04 16:09:21 +01:00
Cesar Rodas b0f3b5a19d Added test_get_meta_data_cache_invalidation_array_to_scalar() unit tests 2017-06-01 12:03:13 -04:00
Cesar Rodas 0d1451b719 Fixed coding styles 2017-05-31 09:40:29 -04:00
Mike Jolley 11d7189ed3 Unit test showing the issue 2017-05-30 14:12:11 +01:00
Cesar Rodas dafc795d7c Abstracting the WC_Meta_Data Properties with __set/__get 2017-05-23 19:15:13 -04:00
Cesar Rodas b158ba2c47 Merge remote-tracking branch 'origin/master' into improve_meta_data_updates 2017-05-23 17:34:12 -04:00
Mike Jolley dd3be1278b Merge pull request #14733 from woocommerce/feature/13646
WC_Object_Query & WC_Order_Query
2017-05-07 14:24:12 +01:00
claudiulodro 11c7722eff Update tests 2017-04-27 14:46:00 -07:00
Cesar Rodas 7a8011e878 Merge remote-tracking branch 'origin/master' into improve_meta_data_updates 2017-04-27 12:29:09 -04:00
claudiulodro 6aecb15505 Reduce scope 2017-04-27 08:38:18 -07:00
Cesar Rodas 2e6dc17bd5 Improved update_meta_data function
Also updated unit tests that was expecting the meta data as stdclass objects
2017-04-27 09:28:19 -04:00
Cesar Rodas 91de312eb2 Make sure the meta data cache is not shared among instances
See #14620 for more context. In there I thought this was the desired behaviour and I enhanced it. After talking with @mikejolley he explained to me that it was not by designed.

This commit makes sure the meta data cache is not shared among instances
2017-04-26 13:51:52 -04:00
claudiulodro 9f0f0cd246 Polish and cleanup 2017-04-26 10:49:19 -07:00
claudiulodro efa1dbbda5 Basic working order queries 2017-04-25 14:52:17 -07:00
claudiulodro 553a12203b WC_Order_Query 2017-04-24 16:28:13 -07:00
claudiulodro 29fa59a0b7 WC_Object_Query 2017-04-24 11:33:17 -07:00
Mike Jolley c0218188a0 Update unit tests 2017-03-23 00:11:21 +00:00
Claudio Sanches f1dab3fdce Fixed coding standards 2017-03-21 12:38:35 -03:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Mike Jolley d55653a408 Merge branch 'master' into fix-13498
# Conflicts:
#	includes/class-wc-order.php
#	tests/unit-tests/crud/data.php
2017-03-15 15:52:40 +00:00
Mike Jolley a3cc5cc9bb has_meta -> meta_exists
#13590

Avoid has_meta conflict with old method.

#13581
2017-03-14 16:49:13 +00:00
Mike Jolley 6826dcbfe1 Tests for has_meta 2017-03-14 12:08:39 +00:00
Mike Jolley e2552c0a8c Unit tests 2017-03-10 12:01:40 +00:00
Mike Jolley 09c75cd814 More tests 2017-03-09 11:05:54 +00:00
Claudiu Lodromanean b645fc5513 Docblocks 2017-03-08 12:02:14 -08:00
Claudiu Lodromanean 3b8eb75c93 Better handling of nested arrays in apply_changes 2017-03-08 11:51:38 -08:00
Mike Jolley b5454f3403 America/New_York unit test 2017-03-08 17:44:43 +00:00
Mike Jolley dda75c3d43 Unit tests 2017-03-08 16:52:21 +00:00
Claudiu Lodromanean d5fd1e46ee get_meta should return empty array sometimes 2017-03-02 11:16:49 -08:00
Claudiu Lodromanean 1eafb487d7 Allow invalid data store exceptions to bubble 2017-03-01 09:24:30 -08:00
Jon Surrell 4000ba6aea Use strict `assertTrue` and `assertFalse` over `assertEquals( true|false )` 2016-12-20 23:33:35 +01: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
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
Aristeides Stathopoulos 0516e96843 PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket 2016-09-02 04:33:57 +03:00
Aristeides Stathopoulos f2730eea02 WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd 2016-08-27 08:57:05 +03:00
Aristeides Stathopoulos d430dabb37 Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines 2016-08-27 07:04:18 +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 b4d6deba83 Remove var dump 2016-08-26 10:21:50 +01:00