Assertion Patterns
Practical patterns for stable assertions.
Start simple
php
--- ASSERTS ---
.success == true
.id != nullValidate structure, not full payload
php
--- ASSERTS ---
.user.id | type == "string"
.user.email | test("@")
.roles | length > 0Metadata checks
php
--- ASSERTS ---
@has_header("x-request-id")
!@has_trailer("grpc-status-details-bin")Streaming responses
Use multiple ASSERTS blocks in response order.
php
--- ASSERTS ---
.stage == "started"
--- ASSERTS ---
.stage == "done"