Aplus Framework Testing Library

AppTesting
in package

Class AppTesting.

Table of Contents

$app  : App
__construct()  : mixed
AppTesting constructor.
runCli()  : void
Simulate a CLI request for tests.
runHttp()  : void
Simulate an HTTP Request for tests.
suppressOutputBuffer()  : void
Run App in a Closure suppressing the output buffer.

Properties

Methods

__construct()

AppTesting constructor.

public __construct(Config $config) : mixed
Parameters
$config : Config
Return values
mixed

runCli()

Simulate a CLI request for tests.

public runCli(string $command[, array<string, string> $env = [] ]) : void
Parameters
$command : string

Command line

$env : array<string, string> = []

Environment variables

Return values
void

runHttp()

Simulate an HTTP Request for tests.

public runHttp(string|URL $url[, string $method = 'GET' ][, array<string, string> $headers = [] ][, string $body = '' ]) : void
Parameters
$url : string|URL
$method : string = 'GET'
$headers : array<string, string> = []
$body : string = ''
Return values
void

suppressOutputBuffer()

Run App in a Closure suppressing the output buffer.

protected suppressOutputBuffer(Closure $closure) : void

It avoids buffer to be output in the PHPUnit terminal.

Parameters
$closure : Closure
Return values
void

Search results