connect() public method

Try to connect the session handler.
public connect ( string $user_id = null, array $credentials = null ) : null
$user_id string The user ID to connect with.
$credentials array An array of login credentials. For Kolab, this must contain a "password" entry.
return null
示例#1
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('*****@*****.**'));
 }
示例#2
0
 public function testMethodGetimapserverHasResultStringLocalhostIfNoAlternative()
 {
     $this->user->expects($this->exactly(5))->method('getSingle')->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
     $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('userid', array('password' => ''));
     $this->assertEquals('localhost', $session->getImapServer());
 }