connect() 공개 메소드

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.
리턴 null
예제 #1
0
 public function testMethodConnectGetsDelegated()
 {
     $session = $this->getMock('Horde_Kolab_Session');
     $session->expects($this->once())->method('connect')->with(array('password' => 'pass'));
     $anonymous = new Horde_Kolab_Session_Decorator_Anonymous($session, 'anonymous', 'pass');
     $anonymous->connect(array('password' => 'pass'));
 }
예제 #2
0
 public function testMethodConnectHasPostconditionThatTheConnectionHasBeenEstablishedAsAnonymousUserIfRequired()
 {
     $user = $this->getMock('Horde_Kolab_Server_Object_Hash', array(), array(), '', false, false);
     $user->expects($this->exactly(5))->method('getSingle')->will($this->returnValue('*****@*****.**'));
     $composite = $this->_getMockedComposite();
     $composite->objects->expects($this->once())->method('fetch')->will($this->returnValue($user));
     $session = new Horde_Kolab_Session_Base($composite, array());
     $anonymous = new Horde_Kolab_Session_Decorator_Anonymous($session, 'anonymous', 'pass');
     $anonymous->connect();
     $this->assertEquals('*****@*****.**', $anonymous->getMail());
 }