Commit Graph

38796 Commits

Author SHA1 Message Date
Ron Rennick a1ec304f44 add waits for idle in add product to order 2021-04-14 16:09:23 -03:00
roykho 427be84875
Add unit tests 2021-04-14 11:54:13 -07:00
Joshua Flowers d37a31927e Update composer.lock 2021-04-14 13:10:35 -04:00
Joshua Flowers 1d4368f384 Bump WooCommerce Admin version to 2.2.1 2021-04-14 13:09:49 -04:00
Joshua Flowers 63dbdddf64 Update to rc1 2021-04-14 13:09:19 -04:00
Joshua Flowers fc5499f9b8 Bump WooCommerce Admin version to 2.2.0-beta.2 2021-04-14 13:08:44 -04:00
Greg 8c86f85af7
Merge pull request #29650 from woocommerce/fix/wcq-34
Enable the stalebot
2021-04-14 11:06:26 -06:00
roykho 0bb3180d68
Schedule cron jobs for running the assign default cat function 2021-04-14 06:52:39 -07:00
Ron Rennick 2c13c994b2 add screenshot utility 2021-04-14 10:05:03 -03:00
Veljko V 2b82c60107
Merge branch 'trunk' into e2e/e2e-shopper-calculate-shipping 2021-04-14 10:21:56 +02:00
roykho 6ed847a7b9
Deprecate method instead of removing it 2021-04-13 19:53:00 -07:00
roykho 8663c3b5f9
Assign default category to products closes #29540 2021-04-13 19:43:04 -07:00
Caleb Burks 0916dd3246 Update docblock 2021-04-13 17:21:00 -05:00
Greg baae57baf5
Merge pull request #29652 from woocommerce/fix/slackbot-instructions
Add step to slackbot instructions
2021-04-13 14:49:40 -06:00
Greg d06bb5b1e6
Merge pull request #29592 from woocommerce/e2e/e2e-shopper-cart-redirection
Add new e2e test shopper cart redirection
2021-04-13 14:40:39 -06:00
Albert Juhé Lluveras aea8e1655f Update WooCommerce Blocks package to 4.9.1 2021-04-13 20:06:33 +02:00
Néstor Soriano 27fd6306f9
Merge pull request #29661 from woocommerce/preparation/5.2.1
Release preparation: 5.2.1
2021-04-13 19:37:04 +02:00
Nestor Soriano 14d399178a
Update changelog and readme for 5.2.1, change stable tag to 5.2.1 2021-04-13 19:21:57 +02:00
Néstor Soriano 9968f394ad
Merge pull request #29660 from woocommerce/update/blocks-to-4.7.2-take-2
Update WooCommerce Blocks package to 4.7.2
2021-04-13 19:17:36 +02:00
Nestor Soriano 132770b8d9
Update Blocks package to version 4.7.2 2021-04-13 19:02:45 +02:00
Ron Rennick 07f72c80b4
fix spacing
Co-authored-by: Greg <71906536+zhongruige@users.noreply.github.com>
2021-04-13 08:25:22 -03:00
Nestor Soriano cf9300bbbc
Refactor in the WC_Settings_Page class for PHP 8 compatibility
- Turn get_settings into a parameterless method, but accept one
  parameter via func_get_arg; and mark the method as deprecated.
- Rename the existing get_settings to get_settings_for_section;
  and mark the method as final.
- Rename the existing get_settings_for_section to get_settings_for_section_core.

See the comment added to get_settings for the rationale for the change.
2021-04-13 12:45:42 +02:00
Tam Mullen ea30866687
Merge pull request #29468 from woocommerce/e2e/e2e-merchant-orders-add-order-complex
E2e/e2e merchant orders add order complex
2021-04-13 10:16:50 +01:00
Nestor Soriano 5af12170d7
Make the WC_Settings_Page::get_settings_for_section final
This helps on conveying the notion that the method to be overriden
is get_settings_for_section_core instead (or get_settings_for_X_section
methods must be added).
2021-04-13 09:31:50 +02:00
Veljko V d9f6f40ac9
Merge branch 'trunk' into e2e/e2e-shopper-cart-redirection 2021-04-13 09:24:25 +02:00
Veljko V d8ff7c02b8
Merge branch 'trunk' into e2e/e2e-shopper-calculate-shipping 2021-04-13 09:23:18 +02:00
rodel-calasagsag a094b185d3 Removed unused faker dependency 2021-04-12 22:52:54 -07:00
Caleb Burks b47cd85af0 Add docblock 2021-04-12 18:56:23 -05:00
roykho ded5c9c7c4
Update unit tests to reflect new base address 2021-04-12 14:13:27 -07:00
Ron Rennick 4480e110f4 update core tests & utils readmes 2021-04-12 14:33:00 -03:00
Ron Rennick a88bc666de enable smoke test 2021-04-12 13:32:38 -03:00
roykho 6c7c420d25
Set US:CA as the default store location 2021-04-12 09:28:30 -07:00
Ron Rennick 96000d81d0 add step to slackbot instructions 2021-04-12 13:19:34 -03:00
Nestor Soriano 56cc063d7f
Rename "get_settings" to "get_settings_for_section" in settings pages.
In PHP 8 overriding a method having an optional parameter with a
method having no parameters throws an error, thus we can't use
the strategy of changing "get_settings()" to "get_settings($section='')"
without breaking existing extensions. So we do the following instead:

- Rename the existing "get_settings" to "get_settings_for_section"
- Rename the existing "get_settings_for_section" to "get_settings_for_section_core"
- Add a "get_settings" that just does "get_settings_for_section('')"
  for compatibility, but mark it as deprecated.
2021-04-12 18:04:41 +02:00
Nestor Soriano ca46992c00
Adjustments in settings pages after a merge with conflicts. 2021-04-12 15:55:45 +02:00
Ron Rennick cea88305a7 enable stalebot 2021-04-12 10:55:30 -03:00
Ron Rennick 5f1e9c2ce5
Merge pull request #29527 from woocommerce/dependabot/npm_and_yarn/tests/e2e/api/y18n-4.0.1
Bump y18n from 4.0.0 to 4.0.1 in /tests/e2e/api
2021-04-12 10:48:08 -03:00
Ron Rennick d950a3298e
Merge pull request #29467 from woocommerce/e2e/e2e-merchant-settings-add-shipping-classes
E2e/e2e merchant settings add shipping classes
2021-04-12 10:45:25 -03:00
Claudio Sanches a761e78a84
Fixed unit tests 2021-04-12 12:50:21 +02:00
Claudio Sanches e2e914ed39
Remove todo 2021-04-12 12:50:21 +02:00
Claudio Sanches 1f51e0c9fc
Remove "Features" menu 2021-04-12 12:50:21 +02:00
Nestor Soriano 65c1c9ec54
Fix unit tests after merging from trunk 2021-04-12 12:50:21 +02:00
Nestor Soriano d820fbe4a7
Fix wrong handling of the shipping - shipping options section. 2021-04-12 12:42:40 +02:00
Nestor Soriano e5f234ec0f
Re-implement the flushing of the term count cache that was lost on merge
Also add unit tests for it.
2021-04-12 12:42:39 +02:00
Nestor Soriano 8a60e7e147
Move code hacker resetting from BeforeTestHook to setUp
The code hacker needs to be reset before each test. This was done via
a couple of classes implementeing BeforeTestHook, those were registered
in phpunit.xml.

The problem is that the PHPUnit version used for WooCommerce unit test
has recently been changed from 7.5 to 6.5 for compatibility with
PHP 7.0, and hook classes were introduced in PHPUnit 7. Thus no hooks
were ran, the code hacker wasn't reset, that caused some functions
to remain hacked between tests, and this made some tests to fail.

The solution is to move the code hacker reset to the setUp method
in the base unit test class.
2021-04-12 12:42:39 +02:00
Nestor Soriano 7440e95b72
Fix unit tests after merge from master 2021-04-12 12:42:39 +02:00
Nestor Soriano bcf24f0f8c
Fix unit test problems in PHP 7.0.
This includes removing two array_merge and array_merge_eecursive
statements in the code hacker, that apparently were working differently
in PHP 7.0.
2021-04-12 12:42:39 +02:00
Nestor Soriano 5a11d9e064
Refactor the settings pages, and add unit tests for them.
This commit fixes some inconsistencies in the settings pages, and
makes all the existing pages extensible by adding new sections
(that was possible in some pages, but not in others). Main changes:

1. Modify the 'get_sections' method so that it invokes a new protected
   'get_own_sections' method and then triggers the
   'woocommerce_get_sections_' . id filter.

This way the filter is triggered only in the base class
and not in each of the derived classes too.

2. Change the get_settings() method so that it has its signature
   changed to get_settings( $current_section = '' )
   in the base class and in all the derived class.

Some derived classes were already using this signature, but others
(those not having multiple sections natively) weren't, making then
effectively impossible to define multiple sections for these pages
via filters.

With this change all the section pages act consistently and allow
both adding new settings to the default "General" section
and creating new sections via filters.

3. Change the implementation of 'get_settings' in the base class
   so that it searches for a 'get_settings_for_{section_id}_section'
   method in the class and executes it, otherwise it executes the new
   protected method get_settings_for_section( $current_section ); then
   it triggers the 'woocommerce_get_settings_' . id filter.

This makes it easier to separate the code that returns the list
of filters in multiple methods, one per section, instead of using
one big if-else-else... block.

So now instead of overriding get_settings($current_section='') derived
classes need to implement get_settings_for_{$current_section}_section
for each section, or override get_settings_for_section($current_section)
or both. 'get_settings_for_section' returns an empty array by default.

Also, 'woocommerce_get_settings_' . id is triggered in one single
place too.

Other improvements:

* Remove duplicated code from 'output' in 'WC_Settings_Page' children.

Some classes inherited from 'WC_Settings_Page' override the 'output'
method with custom code, which in all cases ended up repeating the code
of the original method as a fallback. These repetitions have been
replaced with 'parent::output()'.

* Fix inconsistencies for 'save' and 'output' in WC_Settings_Tax/Emails

The 'WC_Settings_Tax' and 'WC_Settings_Emails' classes had some
inconsistencies in their 'save' and 'output' methods that prevented the
proper creation new sections and the addition of new settings via the
'woocommerce_get_sections_' and 'woocommerce_get_settings_' filters.
Now they work as expected.

* Deduplicate parts of 'save' in 'WC_Settings_Page' and children.

Two methods have been added to 'WC_Settings_Page' class:
'save_settings_for_current_section' and 'do_update_options_action'.
These are intended to be invoked by derived classes in their 'save'
methods, in order to remove code repetition.

* Add some helper methods to WC_Unit_Test_Case.

Methods added:
- assertOutputsHTML
- assertEqualsHTML
- normalize_html
- capture_output_from
2021-04-12 12:42:26 +02:00
Roy Ho 66b39c7ec7
Merge pull request #29322 from woocommerce/fix/ie11-tracking-error
IE 11 compatibility for the site tracking enable function
2021-04-09 13:28:45 -07:00
Ron Rennick a517d88132 merge trunk 2021-04-09 17:08:17 -03:00