diff --git a/patchwork.json b/patchwork.json new file mode 100644 index 0000000..6cf722c --- /dev/null +++ b/patchwork.json @@ -0,0 +1,3 @@ +{ + "redefinable-internals": ["function_exists"] +} diff --git a/tests/FieldGroupTest.php b/tests/FieldGroupTest.php index 06b850d..5f587f6 100644 --- a/tests/FieldGroupTest.php +++ b/tests/FieldGroupTest.php @@ -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'); + } }