class TestSessionStubCodeWriter (View source)

Writes PHP to a file which can be included in SilverStripe runs on existence.

The generated file is included in page execution through TestSessionRequestFilter.

Properties

protected bool $debug
protected string $filePath

Methods

public
__construct($filePath = null)

No description

public
write(string $php, bool $eval = true)

Writes arbitrary PHP code to $filePath for later inclusion.

public
reset()

No description

public
getFilePath()

No description

public
getDebug()

No description

public
setDebug($debug)

No description

Details

__construct($filePath = null)

No description

Parameters

$filePath

write(string $php, bool $eval = true)

Writes arbitrary PHP code to $filePath for later inclusion.

Creates the file if it doesn't exist. Adds debug information about the origin of this code if $debug is set.

Parameters

string $php

Block of PHP code (without preceding <?php)

bool $eval

Sanity check on code.

reset()

No description

getFilePath()

No description

getDebug()

No description

setDebug($debug)

No description

Parameters

$debug