test: 移植 ListingStatsTest(9 tests)
Tests / PHP Lint (push) Successful in 6s
Tests / Unit Tests (push) Successful in 18s
Tests / Integration Tests (push) Successful in 21s

unit bootstrap 改載入真實 TMDO_Listing_Stats:先 define
TMDO_TEST_SKIP_LISTING_STATS_STUB,核心 bootstrap 便會跳過它的 stub。
145 → 154 tests。
This commit is contained in:
2026-07-31 10:41:13 +08:00
parent 59c9b698b7
commit 80ed7b1bb2
2 changed files with 257 additions and 3 deletions
+4 -3
View File
@@ -13,6 +13,9 @@
declare(strict_types=1);
// Load the real TMDO_Listing_Stats below instead of core's stub.
define( 'TMDO_TEST_SKIP_LISTING_STATS_STUB', true );
$tmdo_core_bootstrap = dirname( __DIR__, 2 ) . '/2meet-data-optimizer/tests/bootstrap.php';
if ( ! file_exists( $tmdo_core_bootstrap ) ) {
throw new RuntimeException(
@@ -44,9 +47,7 @@ $tmdo_hp_files = array(
'includes/class-tmdo-hivepress-transient-filter.php',
'includes/class-tmdo-hivepress-term-comment-fields.php',
'includes/class-tmdo-hpct-import.php',
// class-tmdo-listing-stats.php is deliberately NOT loaded: the core unit
// bootstrap already declares a TMDO_Listing_Stats stub, and no test in this
// suite exercises the real implementation.
'includes/class-tmdo-listing-stats.php',
'admin/class-tmdo-admin-hivepress.php',
'cli/class-tmdo-cli-hivepress.php',
);