Session in Unit testing

Hi,

I'm writing unit tests for my application. Is any way to use session during the unit tests?

My $di:

$di->set('session', function() {
    $session = new Phalcon\Session\Adapter\Files();
    if (session_status() == PHP_SESSION_NONE) {
        $session->start();
    }
    return $session;
});


83.0k

You probably need something like that because PHPUnit produces output and the session cannot be started by PHP/Phalcon.