chore(wpmc S2): pin patchwork cache + tighten noop test guard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-05-12 17:52:34 +05:00
parent c1db5c7712
commit f859385761
3 changed files with 11 additions and 3 deletions
+1
View File
@@ -1,4 +1,5 @@
/vendor/ /vendor/
/vendor/.patchwork-cache/
/composer.lock /composer.lock
/dist/ /dist/
/.phpunit.result.cache /.phpunit.result.cache
+2 -1
View File
@@ -1,3 +1,4 @@
{ {
"redefinable-internals": ["function_exists"] "redefinable-internals": ["function_exists"],
"cache-path": "vendor/.patchwork-cache"
} }
+8 -2
View File
@@ -19,12 +19,18 @@ final class FieldGroupTest extends TestCase
public function test_do_register_is_noop_when_acf_missing(): void 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(); \Brain\Monkey\Functions\expect('acf_add_local_field_group')->never();
FieldGroup::do_register(); 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 public function test_do_register_calls_acf_add_local_field_group_with_expected_structure(): void