woocommerce/tests/legacy
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
..
data Add unit test and a sample Woo plugin file 2020-05-01 22:47:08 +05:30
framework Change in the logic of is_visible_core for variable products 2020-07-28 09:01:52 +02:00
includes Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
unit-tests Fix: pagination controls not displaying in products list. 2020-07-31 16:40:25 +02:00
bootstrap.php Moved autoloading of `Automattic\WooCommerce\Testing\Tools` namespace into test bootstrap 2020-07-24 09:25:09 +02:00
classes-with-mockable-static-methods.php Code hacker resdesign for single-load of code files. 2020-06-02 19:06:53 +02:00
mockable-functions.php Code hacker resdesign for single-load of code files. 2020-06-02 19:06:53 +02:00