\ServiceTests

Predefined set of tests for service.

Summary

Methods
Properties
Constants
__construct()
test_valid_connect()
test_invalid_connect()
test_set_valid_token()
test_set_invalid_token()
$SessionId
$ServerPath
$Headers
No constants found
assert_errors()
assert_json()
post_http_request()
prepare_get_options()
get_html_request()
valid_connect()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$SessionId

$SessionId : 

Session id.

Type

$ServerPath

$ServerPath : 

Server path.

Type

$Headers

$Headers : string

Headers.

Type

string

Methods

__construct()

__construct(string  $Service) 

Constructor.

Parameters

string $Service
  • Service name.

test_valid_connect()

test_valid_connect() 

Testing API connection.

test_invalid_connect()

test_invalid_connect() 

Testing API invalid connection.

test_set_valid_token()

test_set_valid_token() 

Testing setting valid token.

test_set_invalid_token()

test_set_invalid_token() 

Testing setting invalid token.

assert_errors()

assert_errors(string  $Content, string  $Message) 

Method asserts for errors and warnings in the html code.

Parameters

string $Content
  • Asserting content.
string $Message
  • Message to be displayed in case of error.

assert_json()

assert_json(mixed  $JSONResult, string  $Result) 

Method asserts JSON.

Parameters

mixed $JSONResult
  • Result of the call;
string $Result
  • Raw result of the call.

post_http_request()

post_http_request(array  $Data, string  $URL) : mixed

Method sends post request.

Parameters

array $Data
  • Request data;
string $URL
  • Requesting endpoint.

Returns

mixed —

Request result.

prepare_get_options()

prepare_get_options() 

Method prepares GET request options.

get_html_request()

get_html_request(  $URL) 

Method sends GET request.

Parameters

$URL

valid_connect()

valid_connect() : mixed

Method performs valid connect.

Returns

mixed —

Result of the connection.