Closed archerdave closed 2 years ago
You could do something like this...
In TestController add a method we’ll call meta that returns useful meta info (including session data) as json data:
public function meta(Request $request)
{
return response()->json([
'user' => $request->user(),
'cookie' => $request->cookie(),
'session' => $request->session()->all(),
]);
}
Then you can access it in tests like so:
$I->amOnPage('/test/meta');
$metaData = json_decode($I->grabPageSource(), true);
Thanks, that makes sense.
Does Codeception have any access to the HTTP session data? For example, when a user logs in, the session gets certain pieces of data. Checking for this data could be useful in verifying a login. Perhaps in other cases as well. I saw that it can do some work with cookies, but I didn't see the session data mentioned.