function testLoginSavesHashAndPutsTokenInCookieAndSession()
{
$this->dbMock->expects($this->once())->method('insertData')->will($this->returnCallback(array($this, 'mock_insertData')));
$this->svc->makeLoginPersistent($this->user123);
$this->assertSame($this->mockToken, $this->lastCookieSet->value);
$this->assertSame($this->mockToken, $this->session->get('code'));
}