PHP Class Zendesk\API\UnitTests\BasicTest

Inheritance: extends PHPUnit_Framework_TestCase
Datei anzeigen Open project: zendesk/zendesk_api_client_php Class Usage Examples

Protected Properties

Property Type Description
$client Zendesk\API\HttpClient
$hostname string
$mockedTransactionsContainer array
$oAuthToken string
$password string
$port string
$scheme string
$subdomain string
$token string

Public Methods

Method Description
__construct ( $name = null, array $data = [], $dataName = '' )
assertLastRequestIs ( $options ) This checks the last request sent
assertRequestIs ( $options, integer $index ) This checks the response with the given index

Protected Methods

Method Description
assertEndpointCalled ( $userFunction, $endpoint, string $method = 'GET', $additionalAsserts = [] ) Test for the endpoint using the given method and endpoint
mockApiResponses ( array $responses = [] ) This will mock the next responses sent via guzzle
setUp ( ) Sets up the fixture, for example, open a network connection.

Method Details

__construct() public method

public __construct ( $name = null, array $data = [], $dataName = '' )
$data array

assertEndpointCalled() protected method

Test for the endpoint using the given method and endpoint
protected assertEndpointCalled ( $userFunction, $endpoint, string $method = 'GET', $additionalAsserts = [] )
$userFunction
$endpoint - An array containing [request method, endpoint path]
$method string

assertLastRequestIs() public method

This checks the last request sent
public assertLastRequestIs ( $options )
$options

assertRequestIs() public method

This checks the response with the given index
public assertRequestIs ( $options, integer $index )
$options
$index integer

mockApiResponses() protected method

This will mock the next responses sent via guzzle
protected mockApiResponses ( array $responses = [] )
$responses array An array of GuzzleHttp\Psr7\Response objects

setUp() protected method

This method is called before a test is executed.
protected setUp ( )

Property Details

$client protected_oe property

protected HttpClient,Zendesk\API $client
return Zendesk\API\HttpClient

$hostname protected_oe property

protected string $hostname
return string

$mockedTransactionsContainer protected_oe property

protected array $mockedTransactionsContainer
return array

$oAuthToken protected_oe property

protected string $oAuthToken
return string

$password protected_oe property

protected string $password
return string

$port protected_oe property

protected string $port
return string

$scheme protected_oe property

protected string $scheme
return string

$subdomain protected_oe property

protected string $subdomain
return string

$token protected_oe property

protected string $token
return string