fix(wpmc 1.1.0): review polish — continue on bad permalink, ACF guard, drop suppress_filters, process-isolated AJAX test
tests / phpunit (push) Has been cancelled

- Redirect::handle: continue instead of return when get_permalink fails on a row (allow trying next row)
- Helpers::acf_ready() now public so Redirect can guard get_field('page_unic', ...) consistently
- Drop suppress_filters=false from get_posts (was risky on sites with query-altering plugins)
- @runInSeparateProcess for DOING_AJAX test (replaces Z-prefix ordering hack)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-05-19 02:30:26 +05:00
parent 9b1689dc2f
commit 07ed1703ba
3 changed files with 17 additions and 13 deletions
@@ -8,12 +8,17 @@ use WPMultiCity\Redirect;
/**
* Isolated test for the DOING_AJAX bail-out in Redirect::handle().
*
* Must be in a separate file sorted AFTER RouterTest so that defining the
* DOING_AJAX constant does not contaminate Router::route() tests in RouterTest,
* which also bails early when DOING_AJAX is true.
* Isolation is achieved via @runInSeparateProcess on the test method, which
* forks a fresh PHP process so that defining the DOING_AJAX constant cannot
* contaminate other tests (e.g. RouterTest). The previous Z-prefix ordering
* hack is no longer needed.
*/
final class ZRedirectDoingAjaxTest extends TestCase
final class RedirectDoingAjaxTest extends TestCase
{
/**
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_bail_when_doing_ajax(): void
{
if (!\defined('DOING_AJAX')) {