test(wpmc S2): lock ACF-missing guard for FieldGroup

Add patchwork.json to enable function_exists shimming via Patchwork
(required so Brain Monkey can intercept the PHP internal).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-05-12 17:47:09 +05:00
parent 551f107344
commit ded71e8fd0
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"redefinable-internals": ["function_exists"]
}
+10
View File
@@ -16,4 +16,14 @@ final class FieldGroupTest extends TestCase
'FieldGroup::register() must hook acf/init'
);
}
public function test_do_register_is_noop_when_acf_missing(): void
{
\Brain\Monkey\Functions\when('function_exists')->justReturn(false);
\Brain\Monkey\Functions\expect('acf_add_local_field_group')->never();
FieldGroup::do_register();
self::assertTrue(true, 'do_register must not call acf_add_local_field_group when ACF is missing');
}
}