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:
@@ -1,4 +1,5 @@
|
|||||||
/vendor/
|
/vendor/
|
||||||
|
/vendor/.patchwork-cache/
|
||||||
/composer.lock
|
/composer.lock
|
||||||
/dist/
|
/dist/
|
||||||
/.phpunit.result.cache
|
/.phpunit.result.cache
|
||||||
|
|||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"redefinable-internals": ["function_exists"]
|
"redefinable-internals": ["function_exists"],
|
||||||
|
"cache-path": "vendor/.patchwork-cache"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user