woocommerce/tests/legacy/unit-tests
Nestor Soriano 71fccd6a07 Fix: pagination controls not displaying in products list.
This bug was introduced in #26260. The sequence is:

1. WC_Query::adjust_posts_count runs, to handle found_posts filter,
   this indirectly executes wc_setup_loop.
2. At this point $GLOBALS['wp_query']->max_num_pages hasn't been set
   yet, and has a value of 0. Thus the loop variable total_pages
   is set to 0.
3. Later wc_setup_loop runs again and this time
   $GLOBALS['wp_query']->max_num_pages is already set, but since
   the loop variable total_pages already exists, it keeps its
   value of 0.
4. The pagination controls never show if total_pages is less than 2.

The fix consists of hooking into the_posts to set the value of
total_pages again, at that point $GLOBALS['wp_query']->max_num_pages
is already set.
2020-07-31 16:40:25 +02:00
..
account Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
admin Fixed unit tests for WC_Notes_Run_Db_Update 2020-07-30 17:00:11 -03:00
attributes Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
cart Change in the logic of is_visible_core for variable products 2020-07-28 09:01:52 +02:00
checkout Revert "Revert "Introduce a `reserved stock` class and database table to prevent race conditions during checkout"" 2020-06-05 15:18:01 +05:30
core add template cache unit test 2020-06-22 16:05:29 -03:00
countries Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
coupon Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
crud Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
customer Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
discounts Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
email Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
exporter Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
formatting Fixed unit tests for #26462 2020-07-01 18:13:29 -03:00
gateways Add login_as_role and login_as_administrator to WC_Unit_Test_Case. 2020-07-14 11:42:21 +02:00
geolocation Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
importer Improvements on the code hacker. 2020-05-20 09:56:26 +02:00
integrations Improvements on the code hacker. 2020-05-20 09:56:26 +02:00
libraries Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
log Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
order Fixed unit tests for #26462 2020-07-01 18:13:29 -03:00
order-items eliminate internal use of deprecated functions 2020-07-17 17:14:26 -03:00
packages Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
page-functions Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
payment-gateways Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
payment-tokens Add login_as_role and login_as_administrator to WC_Unit_Test_Case. 2020-07-14 11:42:21 +02:00
privacy Merge branch 'privacy-exporter-group-description' of git://github.com/garretthyder/woocommerce into garretthyder-privacy-exporter-group-description 2020-05-12 09:40:17 -07:00
product Change in the logic of is_visible_core for variable products 2020-07-28 09:01:52 +02:00
queue Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
session Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
settings Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
setup Add login_as_role and login_as_administrator to WC_Unit_Test_Case. 2020-07-14 11:42:21 +02:00
shipping Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
shortcodes Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
tax Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
templates Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
totals Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
util Fix: pagination controls not displaying in products list. 2020-07-31 16:40:25 +02:00
webhooks Queue all webhooks on shutdown. 2020-07-27 12:11:40 -04:00
widgets Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00