/**
  * @covers ::save_session
  */
 public function test_save_session()
 {
     $visitor = $this->getMock('Model_Visitor', array('check_insist'), array('visitor'));
     $visitor->set(array('token' => '123'));
     $visitor->expects($this->once())->method('check_insist');
     $visitor->save_session();
     $loaded = Model_Visitor::session();
     $this->assertEquals($loaded->as_array(), $visitor->as_array());
 }
 /**
  * Load visitor into the session from a given token
  * @param  string $token
  */
 public function load_visitor($token)
 {
     $visitor = Jam::all('visitor')->where('token', '=', $token)->first();
     if ($visitor) {
         Model_Visitor::session($visitor);
     }
 }