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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

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


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):

  1. Defaults
  2. smoke.config.php (PHP — for registering custom services / closures)
  3. smokeHttp.json (per-environment static values)
  4. .env.<environment>
  5. OS environment variables (getenv())
  6. 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

PHP Build Version
Package Version
Requires php Version ^8.4
ext-curl Version *
ext-json Version *
ext-mbstring Version *
psr/container Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stromcom/http-smoke contains the following files

Loading the files please wait ...