SilverStripe\TestSession\TestSessionController
Requires PHP's mycrypt extension in order to set the database name as an encrypted cookie.
Synopsis
class TestSessionController
extends Controller
{
- // members
- private static string $url_segment = 'dev/testsession';
- private static array $allowed_actions = ;
- private static integer $alternative_database_name = 1;
- private static String $database_templates_path;
- protected TestSessionEnvironment $environment;
- // methods
- public void __construct()
- public void init()
- public void index()
- public void start()
- public void browsersessionstate()
- public void StartForm()
- public void ProgressForm()
- protected void getBaseFields()
- public void DatabaseName()
- public DBHTMLText set()
- public void clear()
- public void end()
- public boolean isTesting()
- public ArrayList getState()
- protected array getDatabaseTemplates()
- private array fixDatetimeFormField()
Hierarchy
Extends
- SilverStripe\Control\Controller
Tasks
Line | Task |
---|---|
397 | Remove once we can set BASE_PATH through the config layer |
Members
private
- $allowed_actions
- $alternative_database_name
- $database_templates_path — SilverStripe\TestSession\String
- $url_segment
protected
- $environment — SilverStripe\TestSession\TestSessionEnvironment
Methods
private
protected
- getBaseFields()
- getDatabaseTemplates() — Get all *.sql database files located in a specific path, keyed by their file name.
public
- __construct()
- DatabaseName()
- ProgressForm() — Shows state which is allowed to be modified while a test session is in progress.
- StartForm()
- browsersessionstate() — Set $_SESSION state for the current browser session.
- clear()
- end() — As with {@link self::start()}, if you want to extend the functionality of this, then look at {@link TestSessionEnvironent::endTestSession()} as the extension points have moved to there now that the logic is there.
- getState()
- index()
- init()
- isTesting()
- set() — Updates an in-progress {@link TestSessionEnvironment} object with new details. This could be loading in new fixtures, setting the mocked date to another value etc.
- start() — Start a test session. If you wish to extend how the test session is started (and add additional test state), then take a look at {@link TestSessionEnvironment::startTestSession()} and {@link TestSessionEnvironment::applyState()} to see the extension points.