test(wpmc S4): restore ACF-missing guard assertions + tighten stub signature

Re-add ->never() to both noop tests so Brain Monkey/Mockery actively asserts
acf_add_local_field_group is never called when ACF is absent.  Order matters:
expect() must precede when('function_exists')->alias() so FunctionStub sees the
real function_exists and skips the eval() path (function already declared in
acf-stubs.php).  Also tighten stub signature to match real ACF ($field_group,
no type hint, no default).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-05-16 19:37:30 +05:00
parent 494061e39f
commit 11bfaa08a0
3 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -14,5 +14,5 @@ declare(strict_types=1);
*/
if (!function_exists('acf_add_local_field_group')) {
function acf_add_local_field_group(array $args = []): void {}
function acf_add_local_field_group($field_group): void {}
}