We use testsession to build up test state e.g. for checking
logins, so having an admin logged-in to operate the testsession
controller is counterproductive.
- Allow limited state setting when session is already in progress
- Allow test sessions without a test database
- Denote an “in progress” session through a “testsession.started” session flag rather than the usage of a temporary database
The perceptual diff extension in Behat defaults to taking
a screenshot of every browser step, including the
"started testsession" one. A simple way to avoid this view
changing is hiding the variable state behind a click event.
The state info is mostly used for manual testing via
dev/tests/startsession anyway.
Was relying on cookie to set on NEXT request, which was too late
since some of the following init logic relied on DB queries.
This happened to work if your non-test DB was already set up,
but failed on fresh checkouts.
testsession/start now includes a comment of the form <!-- SUCCESS: DBNAME=DatabaseName -->,
which can be used by behat and other consumers to validate that the tesession was actually
started.
It's included the database name in its output, which is a small piece of information
disclosure, but not a big deal compared to the generally dev-only nature of this module.
It requires a fix to Cookie::set(), to ensure that set cookies also apperar immediately
in $_COOKIE. Otherwise the call to DB::get_alternative_database_name() after it is set
won't return a value.
Otherwise we'll get into a catch22 if it's not set:
The manifest includes this _config.php, which in turn
throws a fatal exception on the token not existing.
It would be recreated a couple of lines further down in Core.php
when the ConfigManifest is pushed, but never gets this far.