Files
cloud-apache-container/ext/cac-path-parity/tests/009-minfo-reports-inert-mapping.phpt
T

31 lines
1.1 KiB
PHP
Raw Normal View History

--TEST--
cac_path_parity: MINFO reports a non-absolute mapping as INACTIVE, not active
--EXTENSIONS--
cac_path_parity
--INI--
cac_path_parity.from=mnt/users/bob/site.com
cac_path_parity.to=/home/bob
--FILE--
<?php
// `lsphp -i | grep Rewriting` is the signal the post-deploy fleet canary uses to
// confirm parity is live on a host. When the absolute-path guard was added to
// RINIT, MINFO was left testing only "both values non-empty" — so this exact
// mapping (relative `from`, silently INERT since 007) still printed
// "Rewriting => active". A canary that reports healthy for a dead mapping hides
// precisely the failure it was deployed to find.
//
// MINFO and RINIT now share cacpp_mapping_active(); revert MINFO to the
// non-empty test and this prints "active".
ob_start();
phpinfo(INFO_MODULES);
$info = ob_get_clean();
// Also assert the row is unique, so the match below cannot be some other
// module's identically-named row.
var_dump(preg_match_all('/^Rewriting => (.+)$/m', $info, $m));
var_dump(rtrim($m[1][0]));
?>
--EXPECT--
int(1)
string(31) "inactive (mapping not absolute)"