test: 補 HookBus 與 audit 寫入的 integration 回歸網(PR-I)
HookBusIntegrationTest(14 tests,自 A 移植) integration bootstrap 原本只載入 hook-bus-bridge、沒載入 hook-bus 本體, 所以連 WPDO_Hook_Bus alias 都建不出來 — 一併補 auto-promoter 與 hook-bus。 AuditLoggerIntegrationTest(4 tests,新寫) 直接鎖住上一個 commit 修掉的 fatal: - after_write 必須寫出一列 audit(覆蓋 Logger::trace_id() 缺失) - group_name / action 兩欄必須有值(SCHEMA_VERSION 2.1.0 新增) - trace_id 必須是 UUIDv4 且同一 request 內共用 - 未註冊的 key 不得寫入 tearDownAfterClass 卸掉 listener 而非 drop 表,否則後續測試類的受管寫入 會打到不存在的表;integration bootstrap 連帶補 remove_action() stub。 註:TermCommentBackfillTest 未移植 — 它 require HP AddOn 的 class-*-hivepress-term-comment-fields.php,屬 HP AddOn 測試套件而非核心。 unit 451 / integration 416 GREEN、PHPCS 0/0 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
This commit is contained in:
@@ -257,6 +257,11 @@ if ( ! function_exists( 'remove_filter' ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if ( ! function_exists( 'remove_action' ) ) {
|
||||
function remove_action( string $hook, $cb, int $p = 10 ): bool {
|
||||
return remove_filter( $hook, $cb, $p );
|
||||
}
|
||||
}
|
||||
if ( ! function_exists( 'apply_filters' ) ) {
|
||||
function apply_filters( string $hook, $value, ...$args ) {
|
||||
foreach ( $GLOBALS['_wp_filter_callbacks'][ $hook ] ?? [] as $cb ) {
|
||||
@@ -570,6 +575,8 @@ require_once TMDO_PATH . 'includes/engine/class-tmdo-schema-manager.php';
|
||||
require_once TMDO_PATH . 'includes/engine/class-tmdo-entity-registry.php';
|
||||
require_once TMDO_PATH . 'includes/engine/class-tmdo-entity-migration-engine.php';
|
||||
require_once TMDO_PATH . 'includes/engine/class-tmdo-entity-health.php';
|
||||
require_once TMDO_PATH . 'includes/engine/class-tmdo-auto-promoter.php';
|
||||
require_once TMDO_PATH . 'includes/engine/class-tmdo-hook-bus.php';
|
||||
require_once TMDO_PATH . 'includes/adapters/interface-entity-adapter.php';
|
||||
require_once TMDO_PATH . 'includes/adapters/class-tmdo-adapter-post.php';
|
||||
require_once TMDO_PATH . 'includes/adapters/class-tmdo-adapter-user.php';
|
||||
|
||||
Reference in New Issue
Block a user