AssetBuilderTest
extends CiviEndToEndTestCase
in package
uses
HttpTestTrait
Class AssetBuilderTest
Tags
Table of Contents
Properties
- $fired : mixed
- $httpHistory : array<string|int, mixed>
- List of HTTP requests that have been made by this test.
Methods
- buildSquareJs() : mixed
- buildSquareTxt() : mixed
- counter() : mixed
- getExamples() : array<string|int, mixed>
- Get a list of example assets to build/request.
- setUpBeforeClass() : void
- testGetUrl_cached() : mixed
- testGetUrl_uncached() : mixed
- testInvalid() : void
- testRender() : mixed
- assertBodyRegexp() : mixed
- Assert that the response body matches a regular-expression.
- assertContentType() : $this
- assertNotBodyRegexp() : mixed
- Assert that the response body DOES NOT match a regular-expression.
- assertPageNotShown() : void
- Assert that the response did NOT produce a normal page-view.
- assertStatusCode() : $this
- callApi4AjaxError() : mixed
- callApi4AjaxSuccess() : mixed
- createGuzzle() : Client
- Create an HTTP client suitable for simulating AJAX requests.
- formatFailure() : false|string
- Given that an HTTP request has yielded a failed response, format a blurb to summarize the details of the request+response.
- resolveResponse() : ResponseInterface
- setUp() : void
- tearDown() : void
Properties
$fired
protected
mixed
$fired
$httpHistory
List of HTTP requests that have been made by this test.
protected
array<string|int, mixed>
$httpHistory
= []
Methods
buildSquareJs()
public
buildSquareJs(GenericHookEvent $e) : mixed
Parameters
- $e : GenericHookEvent
Tags
buildSquareTxt()
public
buildSquareTxt(GenericHookEvent $e) : mixed
Parameters
- $e : GenericHookEvent
Tags
counter()
public
counter(GenericHookEvent $e) : mixed
Parameters
- $e : GenericHookEvent
Tags
getExamples()
Get a list of example assets to build/request.
public
static getExamples() : array<string|int, mixed>
Return values
array<string|int, mixed>setUpBeforeClass()
public
static setUpBeforeClass() : void
testGetUrl_cached()
public
testGetUrl_cached(string $asset, array<string|int, mixed> $params, string $expectedMimeType, string $expectedContent) : mixed
Parameters
- $asset : string
-
Ex: 'square.txt'.
- $params : array<string|int, mixed>
-
Ex: [x=>12].
- $expectedMimeType : string
-
Ex: 'text/plain'.
- $expectedContent : string
-
Ex: 'Square: 144'.
Tags
testGetUrl_uncached()
public
testGetUrl_uncached(string $asset, array<string|int, mixed> $params, string $expectedMimeType, string $expectedContent) : mixed
Parameters
- $asset : string
-
Ex: 'square.txt'.
- $params : array<string|int, mixed>
-
Ex: [x=>12].
- $expectedMimeType : string
-
Ex: 'text/plain'.
- $expectedContent : string
-
Ex: 'Square: 144'.
Tags
testInvalid()
public
testInvalid() : void
Tags
testRender()
public
testRender(string $asset, array<string|int, mixed> $params, string $expectedMimeType, string $expectedContent) : mixed
Parameters
- $asset : string
-
Ex: 'square.txt'.
- $params : array<string|int, mixed>
-
Ex: [x=>12].
- $expectedMimeType : string
-
Ex: 'text/plain'.
- $expectedContent : string
-
Ex: 'Square: 144'.
Tags
assertBodyRegexp()
Assert that the response body matches a regular-expression.
protected
assertBodyRegexp(string $regexp[, ResponseInterface $response = null ][, string $message = null ]) : mixed
Parameters
- $regexp : string
- $response : ResponseInterface = null
- $message : string = null
assertContentType()
protected
assertContentType(mixed $expectType[, ResponseInterface|null $response = null ]) : $this
Parameters
- $expectType : mixed
- $response : ResponseInterface|null = null
-
If NULL, then it uses the last response.
Return values
$thisassertNotBodyRegexp()
Assert that the response body DOES NOT match a regular-expression.
protected
assertNotBodyRegexp(string $regexp[, ResponseInterface $response = null ][, string $message = null ]) : mixed
Parameters
- $regexp : string
- $response : ResponseInterface = null
- $message : string = null
assertPageNotShown()
Assert that the response did NOT produce a normal page-view.
protected
assertPageNotShown([mixed $response = null ]) : void
This is basically assertStatusCode(404), except that the local configuration
(CMS/setings/exts/yaddayadda) may change how the error manifests.
Parameters
- $response : mixed = null
assertStatusCode()
protected
assertStatusCode(mixed $expectCode[, ResponseInterface|null $response = null ]) : $this
Parameters
- $expectCode : mixed
- $response : ResponseInterface|null = null
-
If NULL, then it uses the last response.
Return values
$thiscallApi4AjaxError()
protected
callApi4AjaxError(string $entity, string $action[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
- $entity : string
- $action : string
- $params : array<string|int, mixed> = []
callApi4AjaxSuccess()
protected
callApi4AjaxSuccess(string $entity, string $action[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
- $entity : string
- $action : string
- $params : array<string|int, mixed> = []
createGuzzle()
Create an HTTP client suitable for simulating AJAX requests.
protected
createGuzzle([array<string|int, mixed> $options = [] ]) : Client
The client may include some mix of these middlewares:
Parameters
- $options : array<string|int, mixed> = []
Tags
Return values
ClientformatFailure()
Given that an HTTP request has yielded a failed response, format a blurb to summarize the details of the request+response.
protected
formatFailure(ResponseInterface $response) : false|string
Parameters
- $response : ResponseInterface
Return values
false|stringresolveResponse()
protected
resolveResponse(ResponseInterface|null $response) : ResponseInterface
Parameters
- $response : ResponseInterface|null
Return values
ResponseInterfacesetUp()
protected
setUp() : void
Tags
tearDown()
protected
tearDown() : void