-
Notifications
You must be signed in to change notification settings - Fork 1
/
runtest.php
75 lines (58 loc) · 2.01 KB
/
runtest.php
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
<?php
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 1);
require_once dirname(__FILE__)."/ezcomponents/Base/src/base.php"; // dependent on installation method, see below
function __autoload( $className )
{
ezcBase::autoload( $className );
}
ezcBase::addClassRepository( dirname(__FILE__).'/',dirname(__FILE__).'/lib/autoloads');
$input = new ezcConsoleInput();
$helpOption = $input->registerOption(
new ezcConsoleOption(
's',
'siteaccess',
ezcConsoleInput::TYPE_STRING
)
);
$cronjobPartOption = $input->registerOption(
new ezcConsoleOption(
'm',
'module',
ezcConsoleInput::TYPE_STRING
)
);
try
{
$input->process();
}
catch ( ezcConsoleOptionException $e )
{
die( $e->getMessage() );
}
ezcBaseInit::setCallback(
'ezcInitDatabaseInstance',
'erLhcoreClassLazyDatabaseConfiguration'
);
$instance = erLhcoreClassSystem::instance();
$instance->SiteAccess = $helpOption->value;
$instance->SiteDir = dirname(__FILE__).'/';
$cfgSite = erConfigClassLhConfig::getInstance();
$defaultSiteAccess = $cfgSite->getSetting( 'site', 'default_site_access' );
$optionsSiteAccess = $cfgSite->getSetting('site_access_options',$helpOption->value);
$instance->Language = $optionsSiteAccess['locale'];
$instance->ThemeSite = $optionsSiteAccess['theme'];
$instance->WWWDirLang = '/'.$helpOption->value;
require_once 'PHPUnit/Runner/Version.php';
require_once 'PHPUnit/Util/Filter.php';
$version = PHPUnit_Runner_Version::id();
if ( version_compare( $version, '3.4.0' ) == -1 && $version !== '@package_version@' )
{
die( "PHPUnit 3.4.0 (or later) is required to run this test suite.\n" );
}
PHPUnit_Util_Filter::addFileToFilter( __FILE__, 'PHPUNIT' );
$modulesTest = explode(' ',trim($cronjobPartOption->value));
// php cron.php -s site_admin -m gallery
$runner = new erLhtestRunner($modulesTest);
$runner->run();
?>