validate() 공개 메소드

Reset the current session information in case it does not match the authentication information anymore.
public validate ( string $user = null ) : boolean
$user string The user the session information is being requested for. This is usually empty, indicating the current user.
리턴 boolean True if the session is still valid.
예제 #1
0
파일: BaseTest.php 프로젝트: horde/horde
 public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesEitherTheCurrentUserMailAndUid()
 {
     $auth = '*****@*****.**';
     $session = $this->getMock('Horde_Kolab_Session');
     $session->expects($this->once())->method('getMail')->will($this->returnValue('*****@*****.**'));
     $valid = new Horde_Kolab_Session_Valid_Base($session, $auth);
     $this->assertTrue($valid->validate('*****@*****.**'));
 }
예제 #2
0
파일: ValidTest.php 프로젝트: horde/horde
 public function testMethodIsvalidHasResultBooleanTrueIfTheMailOfTheCurrentUserMatchesTheCurrentUserOfTheSessionAndTheNewUserMatchesEitherTheCurrentUserMailAndUid()
 {
     $auth = '*****@*****.**';
     $this->user->expects($this->exactly(5))->method('getSingle')->will($this->returnValue('*****@*****.**'));
     $composite = $this->_getMockedComposite();
     $composite->objects->expects($this->once())->method('fetch')->will($this->returnValue($this->user));
     $session = new Horde_Kolab_Session_Base($composite, array());
     $session->connect('', array('password' => ''));
     $valid = new Horde_Kolab_Session_Valid_Base($session, $auth);
     $this->assertTrue($valid->validate('*****@*****.**'));
 }