Skip to content

Commit 47bba5d

Browse files
committed
ci(compat): restore standard integration bootstrap fallback
1 parent 56278f0 commit 47bba5d

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

docs/current-metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Verification environment: primary local repo checkout at `/Users/danknauss/Devel
2020
| Metric | Value | Verification |
2121
|---|---:|---|
2222
| Production PHP lines (`includes/`, `wp-sudo.php`, `uninstall.php`, `mu-plugin/`, `bridges/`) | 8,963 | `find ./includes ./wp-sudo.php ./uninstall.php ./mu-plugin ./bridges -type f -name "*.php" -print0 | xargs -0 wc -l | tail -1` |
23-
| Tests PHP lines (`tests/`) | 17,305 | `find ./tests -type f -name "*.php" -print0 | xargs -0 wc -l | tail -1` |
24-
| Production + tests PHP lines | 26,268 | sum of the two rows above |
25-
| Test-to-production ratio | 1.93:1 | `17305 / 8963` |
26-
| Total repo PHP lines (excluding `vendor/`, `vendor_test/`, `.tmp/`, `.git/`) | 26,325 | `find . -type f -name "*.php" ! -path "*/vendor/*" ! -path "*/vendor_test/*" ! -path "*/.tmp/*" ! -path "*/.git/*" -print0 | xargs -0 wc -l | tail -1` |
23+
| Tests PHP lines (`tests/`) | 17,307 | `find ./tests -type f -name "*.php" -print0 | xargs -0 wc -l | tail -1` |
24+
| Production + tests PHP lines | 26,270 | sum of the two rows above |
25+
| Test-to-production ratio | 1.93:1 | `17307 / 8963` |
26+
| Total repo PHP lines (excluding `vendor/`, `vendor_test/`, `.tmp/`, `.git/`) | 26,327 | `find . -type f -name "*.php" ! -path "*/vendor/*" ! -path "*/vendor_test/*" ! -path "*/.tmp/*" ! -path "*/.git/*" -print0 | xargs -0 wc -l | tail -1` |
2727

2828
## Architectural Facts
2929

tests/Integration/bootstrap.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
// Polyfills path: tell the WP bootstrap where to find yoast/phpunit-polyfills.
3333
// The WP bootstrap defaults to dirname(__DIR__, 3)/vendor/... which resolves to
3434
// /tmp/vendor/... (wrong). Point it to this plugin's vendor directory instead.
35-
$polyfills_path = getenv( 'WP_SUDO_PHPUNIT_POLYFILLS_PATH' );
35+
$polyfills_override = getenv( 'WP_SUDO_PHPUNIT_POLYFILLS_PATH' );
36+
$polyfills_path = $polyfills_override;
3637

37-
if ( ! $polyfills_path ) {
38+
if ( ! $polyfills_path || ! file_exists( $polyfills_path ) ) {
3839
$polyfills_path = dirname( __DIR__, 2 ) . '/vendor/yoast/phpunit-polyfills';
3940
}
4041

@@ -71,9 +72,10 @@ static function () use ( $_repo_root ) {
7172
// Composer autoloader for WP_Sudo\Tests\Integration\* classes.
7273
// Do NOT require tests/bootstrap.php — it defines ABSPATH and class stubs
7374
// that conflict with the real WordPress environment loaded below.
74-
$vendor_autoload = getenv( 'WP_SUDO_VENDOR_AUTOLOAD' );
75+
$vendor_autoload_override = getenv( 'WP_SUDO_VENDOR_AUTOLOAD' );
76+
$vendor_autoload = $vendor_autoload_override;
7577

76-
if ( ! $vendor_autoload ) {
78+
if ( ! $vendor_autoload || ! file_exists( $vendor_autoload ) ) {
7779
$vendor_autoload = dirname( __DIR__, 2 ) . '/vendor/autoload.php';
7880
}
7981

0 commit comments

Comments
 (0)