Class Testphase
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Version: 1.1.2
Located at Testphase.php
Methods summary
public
|
#
__construct( string $url, string $method = 'GET', array $headers = [], string|null $requestBody = null, boolean $ruleJSON = false )
|
public
true
|
#
run( callable|null $callback = null )
Run testphase Will execute the request and apply all defined rules to validate the response |
public
|
|
public
|
|
public
|
#
expectJSON( boolean $flag = true )
Set rule, expect JSON encoded response body. When true it will throw an error if the response is not a valid JSON. NOTE ruleObjects only works with this flag set to true |
public
|
#
expectObject( BaseValidator $object )
Object validator, as an additional set of rules to validate the response. |
public static
|
|
public static
string
|
|
public
mixed
|
|
public
array
|
|
public
string
|
|
public static
string
|
Constants summary
integer |
REQUEST_EMPTY_FLAG
|
#
0
|
integer |
REQUEST_BINARY
|
#
1
|
integer |
REQUEST_NOT_URL_ENCODED
|
#
2
|
Properties summary
public static
integer
|
$SETTING_CURLOPT_CONNECTTIMEOUT
Setting CURLOPT_CONNECTTIMEOUT - timeout for the connect phase Pass a long. It should contain the maximum time in seconds that you allow the connection phase to the server to take. This only limits the connection phase, it has no impact once it has connected. Set to zero to switch to the default built-in connection timeout - 300 seconds. Default timeout is 300. |
#
300
|
public static
integer
|
$SETTING_CURLOPT_TIMEOUT
Setting CURLOPT_TIMEOUT - set maximum time the request is allowed to take |
#
0
|