removes vagrant cachier nfs config
[tine20] / tests / setup / TestHelper.php
1 <?php
2 /**
3  * Tine 2.0
4  * 
5  * @package     setup tests
6  * @subpackage  test root
7  * @license     http://www.gnu.org/licenses/agpl.html AGPL3
8  * @copyright   Copyright (c) 2008 Metaways Infosystems GmbH (http://www.metaways.de)
9  * @author      Philipp Schuele <p.schuele@metaways.de>
10  */
11
12 /*
13  * Set include path
14  */
15 define('PATH_TO_REAL_DIR', dirname(__FILE__). '/../../tine20');
16 define('PATH_TO_TINE_LIBRARY', dirname(__FILE__). '/../../tine20/library');
17 define('PATH_TO_TEST_DIR', dirname(__FILE__));
18
19 $path = array(
20     PATH_TO_REAL_DIR,
21     get_include_path(),
22     PATH_TO_TEST_DIR,
23     PATH_TO_TINE_LIBRARY
24 );
25
26 set_include_path(implode(PATH_SEPARATOR, $path));
27
28 /*
29  * Set parameters  for logging (call via browser)
30  * 
31  * @todo put that in config.inc as well or remove that?
32  */
33 define('CONFIGURATION', PATH_TO_TEST_DIR."/conf.xml");
34
35 /*
36  * Set up basic tine 2.0 environment
37  */
38 require_once 'bootstrap.php';
39
40 /*
41  * Set white / black lists
42  */
43 $phpUnitVersion = explode(' ',PHPUnit_Runner_Version::getVersionString());
44 if (version_compare($phpUnitVersion[1], "3.6.0") >= 0) {
45     $filter = new PHP_CodeCoverage_Filter();
46     $filter->addDirectoryToBlacklist(dirname(__FILE__));
47 } else if (version_compare($phpUnitVersion[1], "3.5.0") >= 0) {
48     PHP_CodeCoverage_Filter::getInstance()->addDirectoryToBlacklist(dirname(__FILE__));
49 } else {
50     PHPUnit_Util_Filter::addDirectoryToFilter(dirname(__FILE__));
51 }
52
53 // get config
54 if(file_exists(dirname(__FILE__) . '/phpunitconfig.inc.php')) {
55     $config = new Zend_Config(require dirname(__FILE__) . '/phpunitconfig.inc.php');
56 } else {
57     throw new Exception("Couldn't find phpunitconfig.inc.php! \n");
58 }
59
60 $_SERVER['DOCUMENT_ROOT'] = $config->docroot;
61
62 Setup_TestServer::getInstance()->initFramework();
63
64 Tinebase_Core::set('locale', new Zend_Locale($config->locale));
65 Tinebase_Core::set('testconfig', $config);