From e1964ff10098297564705771e0fe129e0abec442 Mon Sep 17 00:00:00 2001 From: peptiderepo <273788462+peptiderepo@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:40:58 +0700 Subject: [PATCH] test: define PRAUTOBLOGGER_DEFAULT_{ANALYSIS,WRITING,EDITOR}_MODEL in bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Publisher, ChiefEditor, Activator, and settings UI reference these constants, which are defined in the main plugin file (prautoblogger.php). Unit tests load tests/bootstrap.php but not the main plugin, so these constants were undefined — causing 9 test errors. Agent-Session: cowork-ci-parity-20260414 --- tests/bootstrap.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c10a5bc..596b218 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -40,6 +40,19 @@ if ( ! defined( 'PRAUTOBLOGGER_RETRY_BASE_DELAY_SECONDS' ) ) { define( 'PRAUTOBLOGGER_RETRY_BASE_DELAY_SECONDS', 1 ); } +// Default model slugs used by Publisher, ChiefEditor, Activator, settings UI. +// Source of truth: prautoblogger.php. Test-only duplicate so unit tests can +// load without the main plugin bootstrap running. +if ( ! defined( 'PRAUTOBLOGGER_DEFAULT_ANALYSIS_MODEL' ) ) { + define( 'PRAUTOBLOGGER_DEFAULT_ANALYSIS_MODEL', 'google/gemini-2.5-flash-lite' ); +} +if ( ! defined( 'PRAUTOBLOGGER_DEFAULT_WRITING_MODEL' ) ) { + define( 'PRAUTOBLOGGER_DEFAULT_WRITING_MODEL', 'google/gemini-2.5-flash-lite' ); +} +if ( ! defined( 'PRAUTOBLOGGER_DEFAULT_EDITOR_MODEL' ) ) { + define( 'PRAUTOBLOGGER_DEFAULT_EDITOR_MODEL', 'google/gemini-2.5-flash-lite' ); +} + // WordPress database constants used in $wpdb queries. if ( ! defined( 'ARRAY_A' ) ) { define( 'ARRAY_A', 'ARRAY_A' );