Example #1
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());
 }