/usr/share/php/tests/turba/Turba/ToDo/KolabTestBase.php is in php-horde-turba 4.1.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | <?php
/**
* Base for PHPUnit scenarios.
*
* PHP version 5
*
* @category Kolab
* @package Kolab_Test
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/apache ASL
* @link http://pear.horde.org/index.php?package=Kolab_Storage
*/
/**
* Base for PHPUnit scenarios.
*
* Copyright 2008-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (ASL). If you
* did not receive this file, see http://www.horde.org/licenses/apache.
*
* @category Kolab
* @package Kolab_Test
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/apache ASL
* @link http://pear.horde.org/index.php?package=Kolab_Storage
*/
class Turba_KolabTestBase extends Turba_TestCase
{
/**
* Handle a "given" step.
*
* @param array &$world Joined "world" of variables.
* @param string $action The description of the step.
* @param array $arguments Additional arguments to the step.
*
* @return mixed The outcome of the step.
*/
public function runGiven(&$world, $action, $arguments)
{
switch($action) {
default:
return parent::runGiven($world, $action, $arguments);
}
}
/**
* Handle a "when" step.
*
* @param array &$world Joined "world" of variables.
* @param string $action The description of the step.
* @param array $arguments Additional arguments to the step.
*
* @return mixed The outcome of the step.
*/
public function runWhen(&$world, $action, $arguments)
{
switch($action) {
default:
return parent::runWhen($world, $action, $arguments);
}
}
/**
* Handle a "then" step.
*
* @param array &$world Joined "world" of variables.
* @param string $action The description of the step.
* @param array $arguments Additional arguments to the step.
*
* @return mixed The outcome of the step.
*/
public function runThen(&$world, $action, $arguments)
{
switch($action) {
default:
return parent::runThen($world, $action, $arguments);
}
}
/**
* Prepare the configuration.
*
* @return NULL
*/
public function prepareConfiguration()
{
}
/**
* Prepare the registry.
*
* @return NULL
*/
public function prepareRegistry()
{
}
/**
* Prepare the notification setup.
*
* @return NULL
*/
public function prepareNotification()
{
}
/**
* Fix the read configuration.
*
* @return NULL
*/
public function prepareFixedConfiguration()
{
$GLOBALS['conf'] = &$GLOBALS['registry']->_confCache['horde'];
$GLOBALS['conf']['kolab']['server']['driver'] = 'test';
$GLOBALS['conf']['documents']['type'] = 'horde';
}
/**
* Prepare the Turba setup.
*
* @return NULL
*/
public function prepareTurba()
{
$world = &$this->prepareBasicSetup();
$this->assertTrue($world['auth']->authenticate('wrobel@example.org',
array('password' => 'none')));
$GLOBALS['registry']->pushApp('turba', array('check_perms' => false));
// Turba base libraries.
require_once TURBA_BASE . '/lib/Turba.php';
require_once TURBA_BASE . '/lib/Driver.php';
require_once TURBA_BASE . '/lib/Object.php';
// Turba source and attribute configuration.
include TURBA_BASE . '/config/attributes.php';
$cfgSources = Turba::availableSources();
unset($cfgSources['kolab_global']);
$this->prepareNewFolder($world['storage'], 'Contacts', 'contact', true);
$this->prepareNewFolder($world['storage'], 'test2', 'contact');
$GLOBALS['session']->set('turba', 'has_share', true);
$GLOBALS['cfgSources'] = Turba::getConfigFromShares($cfgSources);
}
function provideServerName()
{
return 'localhost.localdomain';
}
function provideHordeBase()
{
require_once __DIR__ . '/../Application.php';
return HORDE_BASE;
}
}
|