test: restore PHP environment snippet contract - #2351
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phpEnvAssignments()smoke contract forputenv(),$_ENV, and$_SERVERphpEnvAssignmentFunction()Root cause
#1912 /
13ccafb5intentionally expanded static PHP environment assignment fromputenv()alone to all three PHP environment surfaces, matching the runtime helper. The smoke fixture retained the old one-line expectation, sonpm run checkfailed even though the implementation contract was correct.Contract
For every accepted environment name and stringified value, both generation paths populate:
getenv()throughputenv()$_ENV$_SERVERInvalid names remain rejected. The test uses an escaped value containing quotes, a newline, and a backslash and compares the executable static/runtime results.
Tests
npx tsx scripts/php-snippets-smoke.tspassesnpx tsx tests/external-mysql-runtime-service.test.tspassesnpm run buildpassesnpm run checkpasses the repairedphp-snippets-smokegate and later stops at the independentartifact-patch-git-apply-smokefailure tracked by artifact-patch-git-apply-smoke expects a worktree prefix Git does not emit #2064Fixes #2347