Toolkit

Mock
in package

FinalYes

Toolkit mock class.

Table of Contents

Properties

$defaultTag  : string
The default mock tag to use to download and local directory.
$directory  : string
The directory to download the mock to.

Methods

download()  : bool
Downloads the mock from the repo.
getEndpointContent()  : mixed
Returns the content of the endpoint from the mock.
repo()  : string
Returns the repository url.
tag()  : string
Returns the tag to use.

Properties

$defaultTag

The default mock tag to use to download and local directory.

private static string $defaultTag = '0.0.24'

$directory

The directory to download the mock to.

private static string $directory = '.toolkit-mock'

Methods

download()

Downloads the mock from the repo.

public static download() : bool
Tags
throws
Exception

If missing env var TOOLKIT_MOCK_REPO.

Return values
bool

getEndpointContent()

Returns the content of the endpoint from the mock.

public static getEndpointContent(string $endpoint) : mixed
Parameters
$endpoint : string

The endpoint to return the content from.

Tags
throws
Exception

If the mock or endpoint file is not found.

repo()

Returns the repository url.

public static repo() : string
Tags
throws
Exception

If missing env var TOOLKIT_MOCK_REPO.

Return values
string

tag()

Returns the tag to use.

public static tag() : string
Return values
string

        
On this page

Search results