Documentation

CSRFTest extends TestCase
in package

The base of every unit test that needs more than the class under test.

A test asks for what it needs and gets it without a web server, a database or a config file:

$this->bootFramework(["rootDirectory" => "sub"]);
$request = $this->request($this->input()->withUrl("http://localhost/sub/a/b"));

Everything handed out here is taken back after the test, so no test sees the settings, the request or the cached values of another one.

Table of Contents

BLOCKED  = "blocked origin"
CHECKED_METHODS  = ["POST", "PUT", "PATCH", "DELETE"]
CROSS  = "cross site request"
ERROR_INVALID_ALLOW  = "Invalid csrf_allow setting: "
PASS  = null
SAFE_METHODS  = ["GET", "HEAD", "OPTIONS"]
SAME_SITE  = ["csrf_allow" => "same-site"]
SITES  = ["same-origin", "none", "same-site", "cross-site"]
$temporaryDirectories  : array<string|int, mixed>
decisionsOfAdditionalMethods()  : array<string|int, mixed>
decisionsOfBlockedSources()  : array<string|int, mixed>
decisionsOfCsrfAllow()  : array<string|int, mixed>
decisionsOfEmptyAndInvalidEntries()  : array<string|int, mixed>
decisionsOfListEntries()  : array<string|int, mixed>
decisionsOfMethods()  : array<string|int, mixed>
decisionsOfOptedInGet()  : array<string|int, mixed>
decisionsOfScenario1()  : array<string|int, mixed>
decisionsOfScenario10()  : array<string|int, mixed>
decisionsOfScenario11()  : array<string|int, mixed>
decisionsOfScenario2()  : array<string|int, mixed>
decisionsOfScenario3()  : array<string|int, mixed>
decisionsOfScenario4()  : array<string|int, mixed>
decisionsOfScenario5()  : array<string|int, mixed>
decisionsOfScenario6()  : array<string|int, mixed>
decisionsOfScenario7()  : array<string|int, mixed>
decisionsOfScenario8()  : array<string|int, mixed>
decisionsOfScenario9()  : array<string|int, mixed>
decisionsOfSchemeHostAndPort()  : array<string|int, mixed>
decisionsOfSpacesAndCase()  : array<string|int, mixed>
decisionsOfTheSource()  : array<string|int, mixed>
decisionsOfTrustedAndBlockedOrigins()  : array<string|int, mixed>
decisionsUnderAny()  : array<string|int, mixed>
decisionsWithoutAKnownSource()  : array<string|int, mixed>
decisionsWithoutSecFetchSite()  : array<string|int, mixed>
emptyHeaders()  : array<string|int, mixed>
invalidCsrfAllowRequests()  : array<string|int, mixed>
test10TheNestedSubdomainXYMayAllOthersNot()  : void
test11TheSameHostMayOnPort3000NotOnPort4000()  : void
test1TheSameApplicationOnSeveralSubdomains()  : void
test2ABucketOnASubdomainHostsForeignContentEveryOtherSubdomainMay()  : void
test3SubdomainXMaySubdomainYMayNot()  : void
test4OnlySiteXComMay()  : void
test5OnlySiteXComAndSubdomainYMay()  : void
test6EverySubdomainMayPlusSiteXCom()  : void
test7EverySubdomainMayExceptX()  : void
test8TheApplicationOnASubdomainTheParentHostMay()  : void
test9TheApplicationOnASubdomainAnotherSubdomainMay()  : void
testChecksTheSafeMethodsPassedToItCaseInsensitive()  : void
testCompareSchemeHostAndPortExactly()  : void
testFallsBackToSameOriginWithoutCsrfAllowSetting()  : void
testIgnoreCaseAndSpacesAroundAnEntry()  : void
testJudgesAnOptedInGetLikeAnyCheckedRequest()  : void
testKeepsTheBlocklistUnderCsrfAllowAny()  : void
testLetsATrustedOriginWinOverTheBlocklistAcrossSitesButNotWithinAllowedOnes()  : void
testLetsTheSecFetchSiteValuesOfCsrfAllowThroughAnythingElseOnlyFromATrustedSource()  : void
testLetsTheSecFetchSiteValuesOfCsrfAllowThroughAnythingElseOnlyFromATrustedSourceThrowsForAnInvalidCsrfAllow()  : void
testMatchTheEntryExactlyAsTheBrowserSendsTheOrigin()  : void
testOnlyValidatesCsrfAllowForACheckedRequest()  : void
testPassesARequestWithoutAKnownSourceOnlyFromTheSameOriginOrNoPage()  : void
testPassesWithoutSecFetchSiteUnlessTheSourceIsBlockedOrUnknown()  : void
testRejectsABlockedSourceOnEverySecFetchSiteThatPasses()  : void
testSkipEmptyEntriesAndMatchNoInvalidOne()  : void
testSkipsASafeMethodEvenForABlockedSource()  : void
testSkipsGetHeadAndOptionsAndChecksEveryOtherMethod()  : void
testTakesTheSourceFromOrigin()  : void
testTreatsAMissingRequestMethodAsGet()  : void
testTreatsAnEmptyHeaderAsABrowserThatHidesItsSource()  : void
assertThrows()  : Throwable
Asserts that the action throws exactly this class, no subclass of it, with exactly this message. expectException() accepts subclasses and a message that only contains the expected one.
bootFramework()  : ZubZet
Provides the framework instance the global helpers (zubzet(), config(), request(), ...) work on. It holds exactly the given settings: nothing is read from a config file, nothing connects, and there is no request, response, database or user until the test sets one.
callHidden()  : mixed
Calls a method that is not public. Only for logic that has no public way in; a test goes through the public method wherever there is one.
currentUser()  : User
Makes a user without database access the current one, the one user() returns. Its constructor would identify it through the database, so it is left out: the user is anonymous unless the test says otherwise.
inDirectory()  : mixed
Runs the action with the given directory as the working directory, for code that reads relative paths. The previous directory is restored afterwards, also when the action throws.
input()  : State
An input without any data. The with...() methods of the state fill it:
removeSetting()  : void
Removes a setting, as if its line was missing in the config file.
request()  : Request
Makes the given input the current request, the one request() returns.
requireArgon2id()  : void
Skips the test on a PHP built without Argon2. The framework hashes with PASSWORD_ARGON2ID unconditionally and composer.json does not require the support, so the tests that reach it have to tolerate its absence.
response()  : Response
Makes a new response the current one, the one response() returns.
setHiddenStatic()  : void
Sets a static property that is not public. Only for state a class keeps for the whole process and offers no way to reset.
setSettings()  : void
Changes single settings of the booted framework and keeps the others.
tearDown()  : void
temporaryDirectory()  : string
An empty directory with a trailing slash, removed after the test.
assertDecision()  : void
checkRequest()  : bool
clearEndpoint()  : void
clearRuntimeCaches()  : void
cross()  : array<string|int, mixed>
crossSite()  : array<string|int, mixed>
site()  : array<string|int, mixed>

Constants

BLOCKED

private mixed BLOCKED = "blocked origin"

CHECKED_METHODS

private mixed CHECKED_METHODS = ["POST", "PUT", "PATCH", "DELETE"]

CROSS

private mixed CROSS = "cross site request"

ERROR_INVALID_ALLOW

private mixed ERROR_INVALID_ALLOW = "Invalid csrf_allow setting: "

SAFE_METHODS

private mixed SAFE_METHODS = ["GET", "HEAD", "OPTIONS"]

SAME_SITE

private mixed SAME_SITE = ["csrf_allow" => "same-site"]

SITES

private mixed SITES = ["same-origin", "none", "same-site", "cross-site"]

Properties

$temporaryDirectories

private array<string|int, mixed> $temporaryDirectories = []

Methods

decisionsOfAdditionalMethods()

public static decisionsOfAdditionalMethods() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfBlockedSources()

public static decisionsOfBlockedSources() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfCsrfAllow()

public static decisionsOfCsrfAllow() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfEmptyAndInvalidEntries()

public static decisionsOfEmptyAndInvalidEntries() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfListEntries()

public static decisionsOfListEntries() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfMethods()

public static decisionsOfMethods() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfOptedInGet()

public static decisionsOfOptedInGet() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario1()

public static decisionsOfScenario1() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario10()

public static decisionsOfScenario10() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario11()

public static decisionsOfScenario11() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario2()

public static decisionsOfScenario2() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario3()

public static decisionsOfScenario3() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario4()

public static decisionsOfScenario4() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario5()

public static decisionsOfScenario5() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario6()

public static decisionsOfScenario6() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario7()

public static decisionsOfScenario7() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario8()

public static decisionsOfScenario8() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfScenario9()

public static decisionsOfScenario9() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfSchemeHostAndPort()

public static decisionsOfSchemeHostAndPort() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfSpacesAndCase()

public static decisionsOfSpacesAndCase() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfTheSource()

public static decisionsOfTheSource() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsOfTrustedAndBlockedOrigins()

public static decisionsOfTrustedAndBlockedOrigins() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsUnderAny()

public static decisionsUnderAny() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsWithoutAKnownSource()

public static decisionsWithoutAKnownSource() : array<string|int, mixed>
Return values
array<string|int, mixed> —

decisionsWithoutSecFetchSite()

public static decisionsWithoutSecFetchSite() : array<string|int, mixed>
Return values
array<string|int, mixed> —

emptyHeaders()

public static emptyHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —

invalidCsrfAllowRequests()

public static invalidCsrfAllowRequests() : array<string|int, mixed>
Return values
array<string|int, mixed> —

test10TheNestedSubdomainXYMayAllOthersNot()

public test10TheNestedSubdomainXYMayAllOthersNot(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario10

Return values
void —

test11TheSameHostMayOnPort3000NotOnPort4000()

public test11TheSameHostMayOnPort3000NotOnPort4000(string|null $expected, array<string|int, mixed> $headers, array<string|int, mixed> $settings) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario11

Return values
void —

test1TheSameApplicationOnSeveralSubdomains()

public test1TheSameApplicationOnSeveralSubdomains(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario1

Return values
void —

test2ABucketOnASubdomainHostsForeignContentEveryOtherSubdomainMay()

public test2ABucketOnASubdomainHostsForeignContentEveryOtherSubdomainMay(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario2

Return values
void —

test3SubdomainXMaySubdomainYMayNot()

public test3SubdomainXMaySubdomainYMayNot(string|null $expected, array<string|int, mixed> $headers, array<string|int, mixed> $settings) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario3

Return values
void —

test4OnlySiteXComMay()

public test4OnlySiteXComMay(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario4

Return values
void —

test5OnlySiteXComAndSubdomainYMay()

public test5OnlySiteXComAndSubdomainYMay(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario5

Return values
void —

test6EverySubdomainMayPlusSiteXCom()

public test6EverySubdomainMayPlusSiteXCom(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario6

Return values
void —

test7EverySubdomainMayExceptX()

public test7EverySubdomainMayExceptX(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario7

Return values
void —

test8TheApplicationOnASubdomainTheParentHostMay()

public test8TheApplicationOnASubdomainTheParentHostMay(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario8

Return values
void —

test9TheApplicationOnASubdomainAnotherSubdomainMay()

public test9TheApplicationOnASubdomainAnotherSubdomainMay(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfScenario9

Return values
void —

testChecksTheSafeMethodsPassedToItCaseInsensitive()

public testChecksTheSafeMethodsPassedToItCaseInsensitive(string|null $expected, string $method, array<string|int, mixed> $additionalMethods) : void
Parameters
$expected : string|null
$method : string
$additionalMethods : array<string|int, mixed>
Tags
dataProvider

decisionsOfAdditionalMethods

Return values
void —

testCompareSchemeHostAndPortExactly()

public testCompareSchemeHostAndPortExactly(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfSchemeHostAndPort

Return values
void —

testFallsBackToSameOriginWithoutCsrfAllowSetting()

public testFallsBackToSameOriginWithoutCsrfAllowSetting() : void
Return values
void —

testIgnoreCaseAndSpacesAroundAnEntry()

public testIgnoreCaseAndSpacesAroundAnEntry(string|null $expected, array<string|int, mixed> $headers, array<string|int, mixed> $settings) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
Tags
dataProvider

decisionsOfSpacesAndCase

Return values
void —

testJudgesAnOptedInGetLikeAnyCheckedRequest()

public testJudgesAnOptedInGetLikeAnyCheckedRequest(string|null $expected, array<string|int, mixed> $headers, array<string|int, mixed> $settings) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
Tags
dataProvider

decisionsOfOptedInGet

Return values
void —

testKeepsTheBlocklistUnderCsrfAllowAny()

public testKeepsTheBlocklistUnderCsrfAllowAny(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsUnderAny

Return values
void —

testLetsATrustedOriginWinOverTheBlocklistAcrossSitesButNotWithinAllowedOnes()

public testLetsATrustedOriginWinOverTheBlocklistAcrossSitesButNotWithinAllowedOnes(string|null $expected, array<string|int, mixed> $headers) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
Tags
dataProvider

decisionsOfTrustedAndBlockedOrigins

Return values
void —

testLetsTheSecFetchSiteValuesOfCsrfAllowThroughAnythingElseOnlyFromATrustedSource()

public testLetsTheSecFetchSiteValuesOfCsrfAllowThroughAnythingElseOnlyFromATrustedSource(string|null $expected, array<string|int, mixed> $headers[, array<string|int, mixed> $settings = [] ]) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed> = []
Tags
dataProvider

decisionsOfCsrfAllow

Return values
void —

testLetsTheSecFetchSiteValuesOfCsrfAllowThroughAnythingElseOnlyFromATrustedSourceThrowsForAnInvalidCsrfAllow()

public testLetsTheSecFetchSiteValuesOfCsrfAllowThroughAnythingElseOnlyFromATrustedSourceThrowsForAnInvalidCsrfAllow(string $allow, array<string|int, mixed> $headers) : void
Parameters
$allow : string
$headers : array<string|int, mixed>
Tags
dataProvider

invalidCsrfAllowRequests

Return values
void —

testMatchTheEntryExactlyAsTheBrowserSendsTheOrigin()

public testMatchTheEntryExactlyAsTheBrowserSendsTheOrigin(string|null $expected, array<string|int, mixed> $headers, array<string|int, mixed> $settings) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
Tags
dataProvider

decisionsOfListEntries

Return values
void —

testOnlyValidatesCsrfAllowForACheckedRequest()

public testOnlyValidatesCsrfAllowForACheckedRequest() : void
Return values
void —

testPassesARequestWithoutAKnownSourceOnlyFromTheSameOriginOrNoPage()

public testPassesARequestWithoutAKnownSourceOnlyFromTheSameOriginOrNoPage(string|null $expected, array<string|int, mixed> $headers, array<string|int, mixed> $settings) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
Tags
dataProvider

decisionsWithoutAKnownSource

Return values
void —

testPassesWithoutSecFetchSiteUnlessTheSourceIsBlockedOrUnknown()

public testPassesWithoutSecFetchSiteUnlessTheSourceIsBlockedOrUnknown(string|null $expected, array<string|int, mixed> $headers[, array<string|int, mixed> $settings = [] ]) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed> = []
Tags
dataProvider

decisionsWithoutSecFetchSite

Return values
void —

testRejectsABlockedSourceOnEverySecFetchSiteThatPasses()

public testRejectsABlockedSourceOnEverySecFetchSiteThatPasses(string|null $expected, array<string|int, mixed> $headers, array<string|int, mixed> $settings) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
Tags
dataProvider

decisionsOfBlockedSources

Return values
void —

testSkipEmptyEntriesAndMatchNoInvalidOne()

public testSkipEmptyEntriesAndMatchNoInvalidOne(string|null $expected, array<string|int, mixed> $headers, array<string|int, mixed> $settings) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
Tags
dataProvider

decisionsOfEmptyAndInvalidEntries

Return values
void —

testSkipsASafeMethodEvenForABlockedSource()

public testSkipsASafeMethodEvenForABlockedSource() : void
Return values
void —

testSkipsGetHeadAndOptionsAndChecksEveryOtherMethod()

public testSkipsGetHeadAndOptionsAndChecksEveryOtherMethod(string|null $expected, string $method) : void
Parameters
$expected : string|null
$method : string
Tags
dataProvider

decisionsOfMethods

Return values
void —

testTakesTheSourceFromOrigin()

public testTakesTheSourceFromOrigin(string|null $expected, array<string|int, mixed> $headers[, array<string|int, mixed> $settings = [] ]) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed> = []
Tags
dataProvider

decisionsOfTheSource

Return values
void —

testTreatsAMissingRequestMethodAsGet()

public testTreatsAMissingRequestMethodAsGet() : void
Return values
void —

testTreatsAnEmptyHeaderAsABrowserThatHidesItsSource()

public testTreatsAnEmptyHeaderAsABrowserThatHidesItsSource(string|null $expected, array<string|int, mixed> $headers[, array<string|int, mixed> $settings = [] ]) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed> = []
Tags
dataProvider

emptyHeaders

Return values
void —

assertThrows()

Asserts that the action throws exactly this class, no subclass of it, with exactly this message. expectException() accepts subclasses and a message that only contains the expected one.

protected assertThrows(class-string<\Throwable> $class, string $message, callable $action) : Throwable
Parameters
$class : class-string<\Throwable>
$message : string
$action : callable
Return values
Throwable —

bootFramework()

Provides the framework instance the global helpers (zubzet(), config(), request(), ...) work on. It holds exactly the given settings: nothing is read from a config file, nothing connects, and there is no request, response, database or user until the test sets one.

protected bootFramework([array<string, mixed> $settings = [] ]) : ZubZet
Parameters
$settings : array<string, mixed> = []

What config() returns

Return values
ZubZet —

callHidden()

Calls a method that is not public. Only for logic that has no public way in; a test goes through the public method wherever there is one.

protected callHidden(object|class-string $target, string $method, mixed ...$arguments) : mixed
Parameters
$target : object|class-string

An object, or a class name for a static method

$method : string
$arguments : mixed
Return values
mixed —

currentUser()

Makes a user without database access the current one, the one user() returns. Its constructor would identify it through the database, so it is left out: the user is anonymous unless the test says otherwise.

protected currentUser([bool $loggedIn = false ]) : User
Parameters
$loggedIn : bool = false
Return values
User —

inDirectory()

Runs the action with the given directory as the working directory, for code that reads relative paths. The previous directory is restored afterwards, also when the action throws.

protected inDirectory(string $directory, callable $action) : mixed
Parameters
$directory : string
$action : callable
Return values
mixed —

input()

An input without any data. The with...() methods of the state fill it:

protected input([string $requestOrder = "GPC" ]) : State

$this->input()->withMethod("POST")->withPost(["name" => "value"])

REQUEST is put together from GET, POST and COOKIE in the given order, whatever the php.ini of the machine says, so a test sees the same REQUEST everywhere.

Parameters
$requestOrder : string = "GPC"
Return values
State —

removeSetting()

Removes a setting, as if its line was missing in the config file.

protected removeSetting(string $key) : void
Parameters
$key : string
Return values
void —

request()

Makes the given input the current request, the one request() returns.

protected request([State|null $input = null ]) : Request

Boots the framework without settings when the test has not done so.

Parameters
$input : State|null = null
Return values
Request —

requireArgon2id()

Skips the test on a PHP built without Argon2. The framework hashes with PASSWORD_ARGON2ID unconditionally and composer.json does not require the support, so the tests that reach it have to tolerate its absence.

protected requireArgon2id() : void
Return values
void —

response()

Makes a new response the current one, the one response() returns.

protected response() : Response

Boots the framework without settings when the test has not done so.

Return values
Response —

setHiddenStatic()

Sets a static property that is not public. Only for state a class keeps for the whole process and offers no way to reset.

protected setHiddenStatic(class-string $class, string $property, mixed $value) : void
Parameters
$class : class-string
$property : string
$value : mixed
Return values
void —

setSettings()

Changes single settings of the booted framework and keeps the others.

protected setSettings(array<string, mixed> $settings) : void
Parameters
$settings : array<string, mixed>
Return values
void —

tearDown()

protected tearDown() : void
Return values
void —

temporaryDirectory()

An empty directory with a trailing slash, removed after the test.

protected temporaryDirectory() : string
Return values
string —

assertDecision()

private assertDecision(string|null $expected, array<string|int, mixed> $headers[, array<string|int, mixed> $settings = [] ][, string|null $method = null ][, array<string|int, mixed> $additionalMethods = [] ]) : void
Parameters
$expected : string|null
$headers : array<string|int, mixed>
$settings : array<string|int, mixed> = []
$method : string|null = null
$additionalMethods : array<string|int, mixed> = []
Return values
void —

checkRequest()

private checkRequest(array<string|int, mixed> $headers, array<string|int, mixed> $settings, string|null $method, array<string|int, mixed> $additionalMethods) : bool
Parameters
$headers : array<string|int, mixed>
$settings : array<string|int, mixed>
$method : string|null
$additionalMethods : array<string|int, mixed>
Return values
bool —

clearEndpoint()

private clearEndpoint() : void
Return values
void —

clearRuntimeCaches()

private clearRuntimeCaches() : void
Return values
void —

cross()

private static cross(string $origin) : array<string|int, mixed>
Parameters
$origin : string
Return values
array<string|int, mixed> —

crossSite()

private static crossSite() : array<string|int, mixed>
Return values
array<string|int, mixed> —

site()

private static site(string $site, string $origin) : array<string|int, mixed>
Parameters
$site : string
$origin : string
Return values
array<string|int, mixed> —

Search results