Download the PHP package stromcom/http-smoke without Composer
On this page you can find all versions of the php package stromcom/http-smoke. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stromcom/http-smoke
More information about stromcom/http-smoke
Files in stromcom/http-smoke
Package http-smoke
Short Description Professional HTTP smoke testing toolkit with a fluent DSL, parallel execution, capture chains, sessions and pluggable variable sources / reporters / HTTP clients.
License MIT
Informations about the package http-smoke
stromcom/http-smoke
Fast, simple and extensible HTTP smoke-testing toolkit for PHP 8.4+.
A fluent DSL for declaring HTTP smoke tests, parallel execution, capture chains
between requests, cookie-shared session flows, pluggable variable sources
(.env, JSON, OS env, your own), pluggable reporters (console, JSON, Markdown,
GitHub Actions step summary, your own), and a small DI container so any service
can be swapped without forking the package.
Features
- PHP 8.4+ —
readonlyclasses, enums, strict types, no legacy cruft. - Fluent DSL — declarative test definitions in plain PHP.
- Parallel execution —
curl_multi-based, concurrency configurable. - Session chains — share cookies across a sequence of requests, run sequentially.
- Capture variables —
captureJsonPath('hash', 'data.thread.hash')then{@hash}in subsequent URLs / bodies / headers. - Variable substitution —
{ENV_VAR}placeholders resolved from.env,smokeHttp.json, OS env, CLI overrides — or any customVariableSourceInterface. - Pluggable reporters — console, JSON (canonical artefact), Markdown, GitHub
step summary; add your own by implementing
ReporterInterface. - Pluggable HTTP client — default is curl_multi; implement
HttpClientInterfaceto swap in a mock or alternative backend. - Retry — per-test or per-group retry on any failure (useful for eventually-consistent endpoints), independent 5xx retry budget.
- Circuit breaker — per-group
maxFailuresskips remaining tests once a group is clearly broken. - PHPStan level max + strict rules, no docblock noise.
Quick start
1. Install
2. Create test definitions
tests/SmokeHttp/api-01-basic.php:
3. Provide variables
Either via .env.dev:
…or tests/smokeHttp.json:
4. Run
CLI reference
Exit codes: 0 success · 1 tests failed · 2 config error · 3 usage error.
DSL cheat-sheet
Available expectations
| Method | Purpose |
|---|---|
expectStatus(int) |
exact status code |
expectStatusOneOf(int, ...) |
one of several status codes |
expectRedirect(string) |
3xx with Location header path-matching the URL |
expectContains(string) / expectNotContains(string) |
body substring |
expectJson() |
body must parse as JSON |
expectJsonHasKeys(array) |
dot-notation paths must exist |
expectJsonPath(string, mixed) |
dot-notation path equals value |
expectHtmlElement(tag, text?, attribute?, attributeValue?) |
HTML body must contain a matching <tag> (optionally with given attribute / text) |
expectHeaderContains(string, string) |
header value contains substring |
expect(Closure) |
custom callback returning null on success or a failure message |
Captures
Use captureJsonPath('name', 'data.x.y') (or captureHeader('name', 'X-Foo')) on
any request, then reference {@name} in any later request's URL, body, or
header value.
Configuration files
The package merges configuration from several layers (later wins):
- Defaults
smoke.config.php(PHP — for registering custom services / closures)smokeHttp.json(per-environment static values).env.<environment>- OS environment variables (
getenv()) - CLI options (
--base-url,--var=KEY=VALUE, …)
smokeHttp.json
smoke.config.php
Extending
Custom variable source
Implement Stromcom\HttpSmoke\Variable\VariableSourceInterface:
Custom reporter
Implement Stromcom\HttpSmoke\Reporting\ReporterInterface (onStart,
onResult, onEnd) and add it via $config->extraReporters[] = new MyReporter().
Custom HTTP client
Implement Stromcom\HttpSmoke\Http\HttpClientInterface and register in the
container via $config->configureContainer.
JSON report schema
The JSON report is the canonical machine-readable artefact. Markdown and GitHub step-summary outputs are derived from it.
Examples
See examples/ for ready-to-run test suites and a sample
smoke.config.php / smokeHttp.json.
License
MIT — see LICENSE.
All versions of http-smoke with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
psr/container Version ^2.0