diff --git a/.gitignore b/.gitignore index 46b57c2..99f4d0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /vendor/ +/vendor/.patchwork-cache/ /composer.lock /dist/ /.phpunit.result.cache diff --git a/patchwork.json b/patchwork.json index 6cf722c..e498fc6 100644 --- a/patchwork.json +++ b/patchwork.json @@ -1,3 +1,4 @@ { - "redefinable-internals": ["function_exists"] + "redefinable-internals": ["function_exists"], + "cache-path": "vendor/.patchwork-cache" } diff --git a/tests/FieldGroupTest.php b/tests/FieldGroupTest.php index b8f0639..83f93da 100644 --- a/tests/FieldGroupTest.php +++ b/tests/FieldGroupTest.php @@ -19,12 +19,18 @@ final class FieldGroupTest extends TestCase public function test_do_register_is_noop_when_acf_missing(): void { - \Brain\Monkey\Functions\when('function_exists')->justReturn(false); + \Brain\Monkey\Functions\when('function_exists')->alias(function ($name) { + return $name !== 'acf_add_local_field_group'; + }); \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'); + // The real check is the ->never() Mockery expectation above (verified at + // teardown). assertTrue is here only to keep PHPUnit from flagging the + // test as risky under failOnRisky="true" — Mockery assertions don't + // count toward PHPUnit's assertion tally. + self::assertTrue(true); } public function test_do_register_calls_acf_add_local_field_group_with_expected_structure(): void