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:
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"redefinable-internals": ["function_exists"]
|
||||||
|
}
|
||||||
@@ -16,4 +16,14 @@ final class FieldGroupTest extends TestCase
|
|||||||
'FieldGroup::register() must hook acf/init'
|
'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');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user