public function prepareConfiguration()
{
$fh = fopen(HORDE_BASE . '/config/conf.php', 'w');
- $data = <<<EOD
-\$conf['use_ssl'] = 2;
-\$conf['server']['name'] = \$_SERVER['SERVER_NAME'];
-\$conf['server']['port'] = \$_SERVER['SERVER_PORT'];
-\$conf['debug_level'] = E_ALL;
-\$conf['umask'] = 077;
-\$conf['compress_pages'] = true;
-\$conf['menu']['always'] = false;
-\$conf['portal']['fixed_blocks'] = array();
-\$conf['imsp']['enabled'] = false;
-
-/** Additional config variables required for a clean Horde setup */
-\$conf['session']['use_only_cookies'] = false;
-\$conf['session']['timeout'] = 0;
-\$conf['cookie']['path'] = '/';
-\$conf['cookie']['domain'] = \$_SERVER['SERVER_NAME'];
-\$conf['use_ssl'] = false;
-\$conf['session']['cache_limiter'] = 'nocache';
-\$conf['session']['name'] = 'Horde';
-\$conf['log']['enabled'] = false;
-\$conf['prefs']['driver'] = 'session';
-\$conf['auth']['driver'] = 'kolab';
-\$conf['share']['driver'] = 'kolab';
-\$conf['debug_level'] = E_ALL;
-
-/** Make the share driver happy */
-\$conf['kolab']['enabled'] = true;
-
-/** Ensure we still use the LDAP test driver */
-\$conf['kolab']['server']['driver'] = 'test';
-
-/** Ensure that we do not trigger on folder update */
-\$conf['kolab']['no_triggering'] = true;
-
-/** Storage location for the free/busy system */
-\$conf['fb']['cache_dir'] = '/tmp';
-\$conf['kolab']['freebusy']['server'] = 'https://fb.example.org/freebusy';
-
-/** Setup the virtual file system for Kolab */
-\$conf['vfs']['params']['all_folders'] = true;
-\$conf['vfs']['type'] = 'kolab';
-
+ $data = $this->getConfiguration();
+ $data .= <<<EOD
\$conf['kolab']['ldap']['phpdn'] = null;
\$conf['fb']['use_acls'] = true;
EOD;
$_GET['folder'] = $arguments[0];
$_GET['extended'] = '1';
- $fb = &new Horde_Kolab_FreeBusy();
+ $fb = new Horde_Kolab_FreeBusy();
$world['result']['trigger'] = $fb->trigger();
$_GET['uid'] = $arguments[0];
$_GET['extended'] = '1';
- $fb = &new Horde_Kolab_FreeBusy();
+ $fb = new Horde_Kolab_FreeBusy();
$world['result']['fetch'] = $fb->fetch();
/**
* Test the Kolab free/busy system.
*
- * $Horde: framework/Kolab_FreeBusy/test/Horde/Kolab/FreeBusy/FreeBusyTest.php,v 1.13 2009/06/09 23:23:38 slusarz Exp $
+ * PHP version 5
*
* @category Kolab
* @package Kolab_FreeBusy
*/
/**
- * We need the base class
+ * The Autoloader allows us to omit "require/include" statements.
*/
-require_once 'Horde/Kolab/Test/Storage.php';
-
-require_once 'Horde/Kolab/FreeBusy.php';
+require_once 'Horde/Autoloader.php';
/**
* Test the Kolab free/busy system.
*
- * $Horde: framework/Kolab_FreeBusy/test/Horde/Kolab/FreeBusy/FreeBusyTest.php,v 1.13 2009/06/09 23:23:38 slusarz Exp $
- *
* Copyright 2008-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
{
include_once 'Horde/Kolab/Storage.php';
- $folder = Kolab_Storage::getShare('INBOX/Calendar', 'event');
- $data = Kolab_Storage::getData($folder, 'event', 1);
+ $folder = Horde_Kolab_Storage::getShare('INBOX/Calendar', 'event');
+ $data = Horde_Kolab_Storage::getData($folder, 'event', 1);
$object = array(
'uid' => 1,
'summary' => 'test',
$_GET['folder'] = 'wrobel@example.org/Calendar';
- $fb = &new Horde_Kolab_FreeBusy();
+ $fb = new Horde_Kolab_FreeBusy();
/** Trigger the free/busy cache update */
$view = $fb->trigger();
$_GET['extended'] = '1';
$req_folder = Horde_Util::getFormData('folder', '');
- $access = &new Horde_Kolab_FreeBusy_Access();
+ $access = new Horde_Kolab_FreeBusy_Access();
$result = $access->parseFolder($req_folder);
$this->assertEquals('wrobel@example.org', $access->owner);
$result = $this->server->fetch($result, 'Horde_Kolab_Server_Object_Kolab_User');
$this->assertNoError($result);
- $fb = &new Horde_Kolab_FreeBusy();
+ $fb = new Horde_Kolab_FreeBusy();
$view = $fb->trigger();
$this->assertEquals('Horde_Kolab_FreeBusy_View_vfb', get_class($view));
/** Test triggering an invalid folder */
$_GET['folder'] = '';
- $fb = &new Horde_Kolab_FreeBusy();
+ $fb = new Horde_Kolab_FreeBusy();
/** Trigger the free/busy cache update */
$view = $fb->trigger();
$_GET['folder'] = 'wrobel@example.org/Calendar';
$_GET['extended'] = '1';
- $fb = &new Horde_Kolab_FreeBusy();
+ $fb = new Horde_Kolab_FreeBusy();
$view = $fb->trigger();
$this->assertEquals('Horde_Kolab_FreeBusy_View_vfb', get_class($view));
$GLOBALS['browser'] = new Horde_Browser();
}
- /**
- * Prepare the configuration.
- *
- * @return NULL
- */
- public function prepareConfiguration()
+ protected function getConfiguration()
{
- $fh = fopen(HORDE_BASE . '/config/conf.php', 'w');
$data = <<<EOD
\$conf['use_ssl'] = 2;
\$conf['server']['name'] = \$_SERVER['SERVER_NAME'];
\$conf['vfs']['params']['all_folders'] = true;
\$conf['vfs']['type'] = 'kolab';
EOD;
+ return $data;
+ }
+
+ /**
+ * Prepare the configuration.
+ *
+ * @return NULL
+ */
+ public function prepareConfiguration()
+ {
+ $fh = fopen(HORDE_BASE . '/config/conf.php', 'w');
+ $data = $this->getConfiguration();
fwrite($fh, "<?php\n" . $data);
fclose($fh);
}