/**
  * testSessionValid method
  *
  * @return void
  */
 public function testSessionValid()
 {
     $Session = new SessionComponent($this->ComponentCollection);
     $this->assertTrue($Session->valid());
     Configure::write('Session.checkAgent', true);
     $Session->userAgent('rweerw');
     $this->assertFalse($Session->valid());
     $Session = new SessionComponent($this->ComponentCollection);
     $Session->time = $Session->read('Config.time') + 1;
     $this->assertFalse($Session->valid());
 }
Ejemplo n.º 2
0
 /**
  * testSessionValid method
  *
  * @access public
  * @return void
  */
 function testSessionValid()
 {
     $Session = new SessionComponent();
     $this->assertTrue($Session->valid());
     $Session->_userAgent = 'rweerw';
     $this->assertFalse($Session->valid());
     Configure::write('Session.start', false);
     $Session = new SessionComponent();
     $this->assertFalse($Session->__active);
     $this->assertFalse($Session->valid());
     Configure::write('Session.start', true);
     $Session = new SessionComponent();
     $Session->time = $Session->read('Config.time') + 1;
     $this->assertFalse($Session->valid());
     Configure::write('Session.checkAgent', false);
     $Session = new SessionComponent();
     $Session->time = $Session->read('Config.time') + 1;
     $this->assertFalse($Session->valid());
     Configure::write('Session.checkAgent', true);
 }