test(boundary): 新增 CoreBoundaryTest,並補完 PR-I 的兩個缺漏測試
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 9s
Tests / Unit Tests (push) Successful in 9s
Tests / Integration Tests (push) Successful in 31s
Tests / PHP Lint (push) Successful in 8s
Tests / PHPCS (push) Successful in 20s
Tests / PHPStan (push) Successful in 24s
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 9s
Tests / Unit Tests (push) Successful in 9s
Tests / Integration Tests (push) Successful in 31s
Tests / PHP Lint (push) Successful in 8s
Tests / PHPCS (push) Successful in 20s
Tests / PHPStan (push) Successful in 24s
CoreBoundaryTest 靜態掃描核心 126 個生產檔,斷言每一處對 AddOn 類別的 static 呼叫都在同一個函式內有 class_exists() 守衛。上一個 commit 修的 TMDO_Listing_Stats fatal 就是這類缺陷,這個測試讓它不會再回來。 它當場又抓到 3 處同類違規(都是實際會 fatal 的路徑),一併修掉: - admin render_hpct_import():改印 admin notice 並 return - wp tmdo import-hpct:改 WP_CLI::error 明示需要 hivepress-addon - cli-post cleanup-hp-transients 其實早有守衛,是測試的行距啟發式太窄; 判斷範圍改成「同一個函式內」而非固定 12 行 負向驗證:暫時注入一處無守衛呼叫 → 測試如預期失敗;還原後回綠。 同時補完計畫階段 7 PR-I 列的兩個缺漏測試: - 核心 tests/unit/StandardPostInterceptorTest.php(10 tests) - HP AddOn tests/unit/ListingStatsTest.php(9 tests)——AddOn 的 unit bootstrap 先前刻意不載入真實 TMDO_Listing_Stats,改以 TMDO_TEST_SKIP_LISTING_STATS_STUB 常數讓它跳過核心的 stub - 核心 unit bootstrap 補 add_post_meta() stub(flush 路徑用得到) 核心 unit 451 → 587、HP AddOn 145 → 154。
This commit is contained in:
@@ -2721,6 +2721,14 @@ wpdo.getListings({ per_page: 3 }).then(r => console.log(r));'
|
||||
* HPCT Import tab: preview and execute import.
|
||||
*/
|
||||
private static function render_hpct_import(): void {
|
||||
// HPCT is a HivePress-family plugin; the importer ships in that AddOn.
|
||||
if ( ! class_exists( 'TMDO_HPCT_Import' ) ) {
|
||||
echo '<div class="notice notice-warning"><p>'
|
||||
. esc_html__( 'HPCT 匯入需要啟用 2meet-data-optimizer-hivepress-addon。', '2meet-data-optimizer' )
|
||||
. '</p></div>';
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle import action.
|
||||
if ( isset( $_POST['wpdo_run_import'] ) && check_admin_referer( 'wpdo_hpct_import' ) ) {
|
||||
$result = TMDO_HPCT_Import::run();
|
||||
|
||||
Reference in New Issue
Block a user