CommunityID/tests/TestHarness.php

58 lines
1.5 KiB
PHP
Raw Normal View History

2019-07-17 20:08:50 +00:00
<?php
/*
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkeys Ltd.
2019-07-17 20:16:19 +00:00
* @since CommunityID 0.9
* @package CommunityID
2019-07-17 20:08:50 +00:00
* @packager Keyboard Monkeys
*/
/**
* This is included by all unit test class for them to be able to be run
* independently
*/
define('APP_DIR', dirname(__FILE__) . '/..');
2019-07-17 20:16:19 +00:00
define('WEB_DIR', APP_DIR . '/webdir');
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
2019-07-17 20:08:50 +00:00
2019-07-17 20:16:19 +00:00
require_once APP_DIR . '/Application.php';
2019-07-17 20:08:50 +00:00
class TestHarness
{
public static function setUp()
{
2019-07-17 20:16:19 +00:00
Application::setIncludePath();
Application::setAutoLoader();
2019-07-17 20:08:50 +00:00
// need the autoloader before requiring anything
require_once 'tests/TestRequest.php';
2019-07-17 20:16:19 +00:00
Application::cleanUp();
Application::setConfig();
2019-07-17 20:19:00 +00:00
Zend_Registry::get('config')->environment->production = false;
2019-07-17 20:16:19 +00:00
Application::setErrorReporting();
2019-07-17 20:08:50 +00:00
Zend_Registry::get('config')->logging->level = Zend_Log::DEBUG;
2019-07-17 20:16:19 +00:00
Application::setLogger(true);
Application::logRequest();
Application::setDatabase();
Application::setSession();
Application::setAcl();
Application::setI18N();
Application::setLayout();
Application::setFrontController();
Application::$front->throwExceptions(true);
2019-07-17 20:08:50 +00:00
// disable e-mailing
require_once 'tests/Zend_Mail_Transport_Mock.php';
Zend_Registry::get('config')->email->transport = 'mock';
}
}
TestHarness::Setup();