Source: tests/unit/GenerateRequestTest.php · 162 lines, ~985 statements · namespace: (global) · `declare(strict_types=1)`: no
Generate Request Utility Test
Tests for generate_request() function that builds HTTP query strings for CRUD functionality in admin pages.
| Alias | Fully-qualified name |
|---|---|
TestCase | PHPUnit\Framework\TestCase |
| Mode | Target | Line |
|---|---|---|
require | require_once DIR . '/../../lib/utility/sanitize-urls.php'; | 42 |
require | require_once DIR . '/../../lib/utility/generate-request.php'; | 43 |
| Function | Line | Params | Returns | Summary |
|---|---|---|---|---|
check_request_generated | 20 | 0 | ||
escape_html | 28 | 4 | ||
build_query | 36 | 2 |
Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.
public function check_request_generated()
Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.
public function escape_html($input, $type = 'html', $encoding = 'utf-8', $mode = 'base')
| Parameter | Type | Default | Description |
|---|---|---|---|
$input | (untyped) | required | |
$type | (untyped) | 'html' | |
$encoding | (untyped) | 'utf-8' | |
$mode | (untyped) | 'base' |
Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.
public function build_query($base, $query_data)
| Parameter | Type | Default | Description |
|---|---|---|---|
$base | (untyped) | required | |
$query_data | (untyped) | required |