Pronamic WordPress HTTP

Factory

Factory

Tags
link
https://stackoverflow.com/questions/3459287/whats-the-difference-between-a-mock-stub
link
https://github.com/wp-pay-gateways/adyen/blob/1.3.0/tests/src/ClientTest.php
author

Remco Tolsma

version
1.0.0
since
1.0.0

Table of Contents

$instance  : self|null
Instance.
$fakes  : array<string|int, callable>
Fakes.
__construct()  : mixed
Construct factory.
fake()  : void
Fake.
instance()  : self
Instance.
pre_http_request()  : false|array<string|int, mixed>|WP_Error
Pre HTTP request

Properties

$instance

Instance.

protected static self|null $instance

$fakes

Fakes.

private array<string|int, callable> $fakes

Methods

__construct()

Construct factory.

public __construct() : mixed
Return values
mixed

instance()

Instance.

public static instance() : self
Return values
self

pre_http_request()

Pre HTTP request

public pre_http_request(false|array<string|int, mixed>|WP_Error $preempt, array<string, string> $r, string $url) : false|array<string|int, mixed>|WP_Error
Parameters
$preempt : false|array<string|int, mixed>|WP_Error

Whether to preempt an HTTP request's return value. Default false.

$r : array<string, string>

HTTP request arguments.

$url : string

The request URL.

Tags
link
https://github.com/WordPress/WordPress/blob/3.9.1/wp-includes/class-http.php#L150-L164
Return values
false|array<string|int, mixed>|WP_Error

Search results