*/
static public function factory(
$type, $uid,
- Horde_Kolab_Server_Composite $storage,
+ Horde_Kolab_Server_Composite_Interface $storage,
$data = null
) {
if (class_exists($type)) {
* @throws Horde_Kolab_Server_Exception
*/
public function searchRestrictGroups(
- Horde_Kolab_Server_Query_Element $criteria
+ Horde_Kolab_Server_Query_Element_Interface $criteria
) {
$criteria = new Horde_Kolab_Server_Query_Element_And(
array(
* @throws Horde_Kolab_Server_Exception
*/
public function searchRestrictKolab(
- Horde_Kolab_Server_Query_Element $criteria
+ Horde_Kolab_Server_Query_Element_Interface $criteria
) {
$criteria = new Horde_Kolab_Server_Query_Element_And(
array(
*/
public function __construct(
$user_id,
- Horde_Kolab_Server_Composite $server,
+ Horde_Kolab_Server_Composite_Interface $server,
array $params
) {
$this->_user_id = $user_id;
*
* @return NULL
*/
- private function _initMail(Horde_Kolab_Server_Object $user)
- {
+ private function _initMail(
+ Horde_Kolab_Server_Object_Interface $user
+ ) {
try {
$this->_user_mail = $user->getExternal('Mail');
} catch (Horde_Kolab_Server_Exception_Novalue $e) {
*
* @return NULL
*/
- private function _initUid(Horde_Kolab_Server_Object $user)
- {
+ private function _initUid(
+ Horde_Kolab_Server_Object_Interface $user
+ ) {
try {
$this->_user_uid = $user->getExternal('Uid');
} catch (Horde_Kolab_Server_Exception_Novalue $e) {
*
* @return NULL
*/
- private function _initName(Horde_Kolab_Server_Object $user)
- {
+ private function _initName(
+ Horde_Kolab_Server_Object_Interface $user
+ ) {
try {
$this->_user_name = $user->getExternal('Fnln');
} catch (Horde_Kolab_Server_Exception_Novalue $e) {
*
* @return NULL
*/
- private function _initImapServer(Horde_Kolab_Server_Object $user)
- {
+ private function _initImapServer(
+ Horde_Kolab_Server_Object_Interface $user
+ ) {
try {
$this->_imap_server = $user->getExternal('KolabHomeserver');
} catch (Horde_Kolab_Server_Exception_Novalue $e) {
*
* @return NULL
*/
- private function _initFreebusyServer(Horde_Kolab_Server_Object $user)
- {
+ private function _initFreebusyServer(
+ Horde_Kolab_Server_Object_Interface $user
+ ) {
try {
$fb_server = $user->getExternal('KolabFreebusyHost');
} catch (Horde_Kolab_Server_Exception_Novalue $e) {
* session.
*/
public function __construct(
- Horde_Kolab_Server_Composite $server,
+ Horde_Kolab_Server_Composite_Interface $server,
Horde_Kolab_Session_Auth $auth,
array $config,
Horde_Kolab_Session_Storage $storage
*/
public function __construct(
array $config,
- Horde_Kolab_Server_Factory $factory
+ Horde_Kolab_Server_Factory_Interface $factory
) {
$this->_configuration = $config;
$this->_server_factory = $factory;
Horde_Injector $injector
) {
Horde_Kolab_Server_Factory_Injector::setup(
- 'Horde_Kolab_Server_Factory_Conn_Mock',
+ 'Horde_Kolab_Server_Factory_Connection_Mock',
array('basedn' => ''),
$injector
);
*/
public function getServer()
{
- return $this->_injector->getInstance('Horde_Kolab_Server_Composite');
+ return $this->_injector->getInstance('Horde_Kolab_Server_Composite_Interface');
}
/**
$config['logger'] = Horde::getLogger();
$factory = new Horde_Kolab_Session_Factory_Configuration($config);
self::$_instance = $factory->getSession($user);
+ self::$_instance->connect($credentials);
}
return self::$_instance;
}
public function testMethodConnectHasParameterArrayCredentials()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$composite = $this->_getMockedComposite();
$composite->objects->expects($this->once())
->method('fetch')
public function testMethodConnectHasPostconditionThatTheUserMailAddressIsKnown()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('mail@example.org'));
public function testMethodConnectHasPostconditionThatTheUserUidIsKnown()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('uid'));
public function testMethodConnectHasPostconditionThatTheUserNameIsKnown()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('name'));
public function testMethodConnectHasPostconditionThatTheUsersImapHostIsKnown()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('home.example.org'));
public function testMethodConnectHasPostconditionThatTheUsersFreebusyHostIsKnown()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('freebusy.example.org'));
public function testMethodConnectThrowsExceptionIfTheConnectionFailed()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$composite = $this->_getMockedComposite();
$composite->server->expects($this->exactly(1))
->method('connectGuid')
public function testMethodGetmailHasResultStringTheMailOfTheConnectedUser()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetuidHasResultStringTheUidOfTheConnectedUser()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetnameHasResultStringTheNameOfTheConnectedUser()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetfreebusyserverHasResultStringTheUsersFreebusyServerConverterdToACompleteUrlUsingParametersIfAvailable()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('freebusy.example.org'));
public function testMethodGetfreebusyserverHasResultStringTheUsersFreebusyServerConverterdToACompleteUrlUsingFreebusyIfAvailable()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('freebusy.example.org'));
public function testMethodGetfreebusyserverHasResultStringTheConfiguredServerIfAvailable()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetfreebusyserverHasResultStringTheUsersHomeServerConverterdToACompleteUrlUsingParametersIfAvailable()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetfreebusyserverHasResultStringTheUsersHomeServerConverterdToACompleteUrlUsingFreebusyIfAvailable()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetfreebusyserverHasResultStringLocalhostConvertedToACompleteUrlUsingParametersIfAvailable()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetfreebusyserverHasResultStringLocalhostConvertedToACompleteUrlUsingFreebusy()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetimapserverHasResultStringTheUsersHomeServerIfAvailable()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('home.example.org'));
public function testMethodGetimapserverHasResultStringTheConfiguredServerIfAvailable()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
public function testMethodGetimapserverHasResultStringLocalhostIfNoAlternative()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->throwException(new Horde_Kolab_Server_Exception_Novalue()));
)
);
$this->assertType(
- 'Horde_Kolab_Server_Composite',
+ 'Horde_Kolab_Server_Composite_Interface',
$factory->getServer()
);
}
$factory = new Horde_Kolab_Session_Factory_Constructor(
$this->server, $this->session_auth, array(), $this->session_storage
);
- $this->assertType('Horde_Kolab_Server_Composite', $factory->getServer());
+ $this->assertType('Horde_Kolab_Server_Composite_Interface', $factory->getServer());
}
public function testMethodGetsessionauthHasResultHordekolabsessionauth()
{
public function testMethodGetserverHasResultHordekolabserver()
{
- $server = $this->getMock(
- 'Horde_Kolab_Server_Composite', array(), array(), '', false, false
- );
- $server_factory = $this->getMock('Horde_Kolab_Server_Factory');
+ $server = $this->getMock('Horde_Kolab_Server_Composite_Interface');
+ $server_factory = $this->getMock('Horde_Kolab_Server_Factory_Interface');
$server_factory->expects($this->once())
->method('getComposite')
->will($this->returnValue($server));
array('server' => array()),
$server_factory
);
- $this->assertType('Horde_Kolab_Server_Composite', $factory->getServer());
+ $this->assertType(
+ 'Horde_Kolab_Server_Composite_Interface', $factory->getServer()
+ );
}
public function testMethodGetsessionauthHasResultHordekolabsessionauth()
{
$factory = new Horde_Kolab_Session_Factory_Default(
array('server' => array()),
- $this->getMock('Horde_Kolab_Server_Factory')
+ $this->getMock('Horde_Kolab_Server_Factory_Interface')
);
$this->assertType('Horde_Kolab_Session_Auth', $factory->getSessionAuth());
}
{
$factory = new Horde_Kolab_Session_Factory_Default(
array('server' => array()),
- $this->getMock('Horde_Kolab_Server_Factory')
+ $this->getMock('Horde_Kolab_Server_Factory_Interface')
);
$this->assertType('array', $factory->getSessionConfiguration());
}
{
$factory = new Horde_Kolab_Session_Factory_Default(
array('server' => array()),
- $this->getMock('Horde_Kolab_Server_Factory')
+ $this->getMock('Horde_Kolab_Server_Factory_Interface')
);
$this->assertType('Horde_Kolab_Session_Storage', $factory->getSessionStorage());
}
$factory = new Horde_Kolab_Session_Factory_Injector(
array('server' => array()), $this->injector
);
- $this->assertType('Horde_Kolab_Server_Composite', $factory->getServer());
+ $this->assertType('Horde_Kolab_Server_Composite_Interface', $factory->getServer());
}
public function testMethodGetsessionauthHasResultHordekolabsessionauth()
{
public function testMethodConnectHasPostconditionThatTheConnectionHasBeenEstablishedAsAnonymousUserIfRequired()
{
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('anonymous@example.org'));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('somebody@example.org'));
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('mail@example.org'));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('mail@example.org'));
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('mail@example.org'));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('mail@example.org'));
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('mail@example.org'));
$auth->expects($this->once())
->method('getCurrentUser')
->will($this->returnValue('mail@example.org'));
- $user = $this->getMock('Horde_Kolab_Server_Object');
+ $user = $this->getMock('Horde_Kolab_Server_Object_Interface');
$user->expects($this->exactly(5))
->method('getExternal')
->will($this->returnValue('mail@example.org'));
{
protected function _getComposite()
{
- return $this->getMock(
- 'Horde_Kolab_Server_Composite', array(), array(), '', false, false
- );
+ return $this->getMock('Horde_Kolab_Server_Composite_Interface');
}
protected function _getMockedComposite()
{
- return new Horde_Kolab_Server_Composite(
- $this->getMock('Horde_Kolab_Server'),
- $this->getMock('Horde_Kolab_Server_Objects'),
+ return new Horde_Kolab_Server_Composite_Base(
+ $this->getMock('Horde_Kolab_Server_Interface'),
+ $this->getMock('Horde_Kolab_Server_Objects_Interface'),
$this->getMock('Horde_Kolab_Server_Structure_Interface'),
$this->getMock('Horde_Kolab_Server_Search_Interface'),
- $this->getMock('Horde_Kolab_Server_Schema')
+ $this->getMock('Horde_Kolab_Server_Schema_Interface')
);
}