public function testMethodGetidGetsDelegated() { $session = $this->getMock('Horde_Kolab_Session'); $session->expects($this->once())->method('getId')->will($this->returnValue('1')); $anonymous = new Horde_Kolab_Session_Decorator_Anonymous($session, 'anonymous', 'pass'); $anonymous->getId(); }
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()); }