sveneld opened a new pull request, #3489:
URL: https://github.com/apache/thrift/pull/3489

   Add targeted unit tests guarding three recently-fixed bugs whose code paths 
had no direct test coverage. Pure additions — no library code changes.
   
   ## Tests added
   
   ### 1. UUID round-trip in exception structs (guards 
[THRIFT-6001](https://issues.apache.org/jira/browse/THRIFT-6001))
   
   `TException::$tmethod` previously omitted `TType::UUID`, so UUID-typed 
fields in `exception` structs fell through to the slow recursive STRUCT path on 
write. Extended the `TestRichException` fixture with a `uuidField` and added a 
`'uuid'` yield to `TExceptionTest::writeAndReadFieldDataProvider`, asserting 
the value round-trips intact through `TBinaryProtocol`.
   
   ### 2. TCompactProtocol readBool in container state (guards 
[THRIFT-5987](https://issues.apache.org/jira/browse/THRIFT-5987))
   
   In `STATE_CONTAINER_READ`, `readBool()` previously passed its `?bool &$bool` 
reference straight into `readByte(?int &$byte)`, leaving the caller's variable 
holding the raw int instead of bool. Added `testReadBoolInContainerState` with 
three data-provider rows (`0 → false`, `1 → true`, `0x7f → true`) that mock 
`TTransport`, force `STATE_CONTAINER_READ` via reflection, and assert the value 
comes back as a real PHP bool.
   
   ### 3. TJSONProtocol popContext underflow recovery
   
   When the `$context` property was tightened to non-nullable in THRIFT-5981 / 
5985, `popContext()` was patched to fall back to `new BaseContext()` instead of 
returning null. Added `testPopContextOnEmptyStackFallsBackToBaseContext` that 
reflects into the private method and asserts the property holds a `BaseContext` 
after popping an empty stack — no TypeError.
   
   ## Validation (Docker `thrift-php-dev:local`)
   
   - `phpcs` — 0 errors
   - `phpstan` (level 5) — 0 errors
   - `phpunit` Unit Suite — **642 tests, 0 failures** (+5 new vs master's 637)
   - `phpunit` Integration Suite — 108 tests, 0 failures
   
   Part of umbrella 
[THRIFT-5960](https://issues.apache.org/jira/browse/THRIFT-5960).
   
   - [x] Apache Jira ticket — 
[THRIFT-6008](https://issues.apache.org/jira/browse/THRIFT-6008)
   - [x] PR title follows the pattern "THRIFT-NNNN: …"
   - [x] Squashed to a single commit
   - [x] No behaviour changes — pure additive tests.
   
   Generated-by: Claude Opus 4.7
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to