Download the PHP package vmpublishing/psr15-middleware-test-helpers without Composer
On this page you can find all versions of the php package vmpublishing/psr15-middleware-test-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download vmpublishing/psr15-middleware-test-helpers
More information about vmpublishing/psr15-middleware-test-helpers
Files in vmpublishing/psr15-middleware-test-helpers
Download vmpublishing/psr15-middleware-test-helpers
More information about vmpublishing/psr15-middleware-test-helpers
Files in vmpublishing/psr15-middleware-test-helpers
Vendor vmpublishing
Package psr15-middleware-test-helpers
Short Description couple of often reused mocks for testing psr-15 middlewares
License MIT
Package psr15-middleware-test-helpers
Short Description couple of often reused mocks for testing psr-15 middlewares
License MIT
Please rate this library. Is it a good library?
Informations about the package psr15-middleware-test-helpers
WHAT
a collection of reusable mocks for phpunit for the common middleware-related interfaces
INSTALL
To install simply use
composer require vmpublishing/psr15-middleware-test-helpers
USE
As these are traits, just use them inside your testcase:
class SomeTest extends TestCase
{
use VM\Psr15Mocks\Middleware; // include to use
// this will generate the member variables:
// $request
// $response
// $requestHandler
// $body
// ..
// create them all properly
public function setUp(): void
{
$this->buildResponse();
$this->buildRequest();
$this->buildRequestHandler();
$this->buildBody();
}
// destroy them all properly
public function tearDown(): void
{
$this->destroyBody();
$this->destroyRequestHandler();
$this->destroyRequest();
$this->destroyResponse();
}
// ..
public function testSomething(): void
{
// use to validate calls
$this->response->expects($this->once())->method('getBody')->willReturn($this->body);
}
}
All versions of psr15-middleware-test-helpers with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.2
psr/http-server-middleware Version *@stable
phpunit/phpunit Version *@stable
psr/http-server-middleware Version *@stable
phpunit/phpunit Version *@stable
The package vmpublishing/psr15-middleware-test-helpers contains the following files
Loading the files please wait ....