Download the PHP package waffle-commons/testing without Composer

On this page you can find all versions of the php package waffle-commons/testing. 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 testing

Discord PHP Version Require PHP CI codecov Latest Stable Version Latest Unstable Version Total Downloads Packagist License

Waffle Testing Component

Release: 0.1.0-beta7  |  CHANGELOG.md Status: First released in 0.1.0-beta7 โ€” roadmap [TEST-01]. A dev-only package (composer require --dev); its test doubles implement the same waffle-commons/contracts interfaces as production code.

Kernel testing bridge for the Waffle framework: in-process request dispatch through the real pipeline, plus time, queue, mailer and HTTP-client test doubles.

๐Ÿ“ฆ Installation

๐Ÿงช Testing through the real pipeline

Extend Waffle\Commons\Testing\PHPUnit\WaffleTestCase and build your kernel in createKernel(). Each createClient() boots a fresh kernel; the client sends requests through it in-process, with no web server and no network:

๐ŸŽญ Test doubles

Double Stands in for Behaviour
Clock\FrozenClock Psr\Clock\ClockInterface Shows one instant until the test calls set() or advance('+90 seconds'). Production code uses Waffle\Commons\Utils\Clock\SystemClock.
Http\ReplayClient PSR-18 ClientInterface and ConcurrentClientInterface Replays the answers the test queued per method and URI (addResponse(), addNetworkError()), each once and in order, and records every request (requests(), pending()). A request with no answer left throws UnexpectedRequestException, which is not a PSR-18 exception, so an unplanned call fails the test.
Queue\InMemoryQueue QueueDispatcherInterface and QueueConsumerInterface Records every dispatched envelope (dispatched(), by queue too) with deterministic ids, and serves a worker: receive() follows the injected clock and never blocks, acknowledge() / release() settle a delivery, reclaim() plays the recovery after a worker crash.
Queue\InMemoryFailedMessageStore FailedMessageStoreInterface Keeps what a worker gave up on โ€” full envelope, reason, instant from the clock โ€” oldest first.
Mailer\MailerSpy MailerInterface Sends nothing; records every Email (sent()).
RateLimit\InMemoryLimiterStateStorage LimiterStateStorageInterface Token buckets in memory, with the arithmetic of the Redis store (RateLimit-* values, Retry-After) on the injected clock: advance a FrozenClock to refill. One process only โ€” production keeps limiter state in Redis, never in worker memory.

๐Ÿงญ Architectural boundary (mago guard)

Waffle\Commons\Testing depends only on waffle-commons/contracts and the PSR interfaces โ€” never on a sibling component's concrete classes. Every interface it implements lands in waffle-commons/contracts first. PHPUnit is a runtime dependency of this dev-only package, and the guard permits it in Waffle\Commons\Testing\PHPUnit only: the kernel client and the doubles work with any test runner.

๐Ÿงต Worker safety

The doubles are mutable on purpose: a test sets the time, queues answers and reads what was recorded. They live for one test and are never resident in a worker, so each mutable property carries #[WorkerSafe] with that reason, and they do not implement ResettableInterface (the kernel resets after every request, which would erase what the test asserts). composer igor reports 0 KO.

๐Ÿงช Testing

๐Ÿ“š Documentation

Full documentation tree: waffle-commons/documentation

๐Ÿ“„ License

MIT โ€” see LICENSE.md.


All versions of testing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
waffle-commons/contracts Version self.version
phpunit/phpunit Version ^12.5
psr/clock Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
psr/http-message 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 waffle-commons/testing contains the following files

Loading the files please wait ...