From 7cd65b145f69b0b7504996918b374bd03394ffb3 Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Thu, 23 Apr 2026 02:39:02 +0000 Subject: [PATCH] fix(tests): add post_type_exists stub to BaseTestCase When PR Core is not active, PeptideLinker guards calls with post_type_exists(). This stub was missing from base setup, causing 8 PublisherTest errors. Adds Functions\when('post_type_exists')->justReturn(false) to setUp(). --- tests/unit/BaseTestCase.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit/BaseTestCase.php b/tests/unit/BaseTestCase.php index 2349e3b..07bcbcc 100644 --- a/tests/unit/BaseTestCase.php +++ b/tests/unit/BaseTestCase.php @@ -38,6 +38,9 @@ abstract class BaseTestCase extends TestCase { // home_url is used by OpenRouter provider in request headers. Functions\when( 'home_url' )->justReturn( 'https://test.example.com' ); + // post_type_exists is used by PeptideLinker to check if PR Core is active. + // Stub returns false to simulate when PR Core is not installed. + Functions\when( 'post_type_exists' )->justReturn( false ); // current_time is called by Logger on every log write. Stub returns a // deterministic timestamp so tests are reproducible.