run.php 17.7 KB
Newer Older
1 2
<?php

zYne's avatar
zYne committed
3
ini_set('max_execution_time', 900);
4

5
function parseOptions($array) {
6
    $currentName='';
meus's avatar
meus committed
7 8
    $options=array();
    foreach($array as $name) {
9
        if (strpos($name,'-')===0) {
10
            $name=str_replace('-','',$name);      
meus's avatar
meus committed
11
            $currentName=$name;
12
            if ( ! isset($options[$currentName])) {
meus's avatar
meus committed
13 14 15 16 17 18 19
                $options[$currentName]=array();         
            }
        } else {
            $values=$options[$currentName];
            array_push($values,$name);    
            $options[$currentName]=$values;
        }
20
    }
meus's avatar
meus committed
21
    return $options;
22 23
}

zYne's avatar
zYne committed
24
function autoload($class) {
25
    if (strpos($class, 'TestCase') === false) {
zYne's avatar
zYne committed
26
        return false;
zYne's avatar
zYne committed
27
    }
28

zYne's avatar
zYne committed
29 30
    $e      = explode('_', $class);
    $count  = count($e);
31

zYne's avatar
zYne committed
32 33 34 35 36
    $prefix = array_shift($e);

    if ($prefix !== 'Doctrine') {
        return false;
    }
37

zYne's avatar
zYne committed
38
    $dir    = array_shift($e);
39

zYne's avatar
zYne committed
40
    $file   = $dir . '_' . substr(implode('_', $e), 0, -(strlen('_TestCase'))) . 'TestCase.php';
41

42
    if ( $count > 3) {
zYne's avatar
zYne committed
43 44 45 46
        $file   = str_replace('_', DIRECTORY_SEPARATOR, $file);
    } else {
        $file   = str_replace('_', '', $file);
    }
zYne's avatar
zYne committed
47

zYne's avatar
zYne committed
48
    // create a test case file if it doesn't exist
49

zYne's avatar
zYne committed
50
    if ( ! file_exists($file)) {
zYne's avatar
zYne committed
51 52
        $contents = file_get_contents('template.tpl');
        $contents = sprintf($contents, $class, $class);
zYne's avatar
zYne committed
53

54
        if ( ! file_exists($dir)) {
zYne's avatar
zYne committed
55 56
            mkdir($dir, 0777);
        }
57

zYne's avatar
zYne committed
58 59 60
        file_put_contents($file, $contents);
    }
    require_once($file);
pookey's avatar
pookey committed
61

zYne's avatar
zYne committed
62 63
    return true;
}
64

pookey's avatar
pookey committed
65
// include doctrine, and register it's autoloader
zYne's avatar
zYne committed
66 67
require_once dirname(__FILE__) . '/../lib/Doctrine.php';
spl_autoload_register(array('Doctrine', 'autoload'));
pookey's avatar
pookey committed
68 69

// register the autoloader function above
zYne's avatar
zYne committed
70
spl_autoload_register('autoload');
71

72 73 74 75
// include the models
$models = new DirectoryIterator(dirname(__FILE__) . '/../models/');
foreach($models as $key => $file) {
    if ($file->isFile() && ! $file->isDot()) {
76 77 78 79
        $e = explode('.', $file->getFileName());
        if (end($e) === 'php') {
          require_once $file->getPathname();
        }
80 81 82 83 84
    }
}
//require_once dirname(__FILE__) . '/../models/location.php';
//require_once dirname(__FILE__) . '/../models/Blog.php';
//require_once dirname(__FILE__) . '/classes.php';
zYne's avatar
zYne committed
85

zYne's avatar
zYne committed
86
require_once dirname(__FILE__) . '/Test.php';
pookey's avatar
pookey committed
87
require_once dirname(__FILE__) . '/UnitTestCase.php';
zYne's avatar
zYne committed
88

89
error_reporting(E_ALL | E_STRICT);
zYne's avatar
zYne committed
90

zYne's avatar
zYne committed
91
$test = new GroupTest('Doctrine Framework Unit Tests');
zYne's avatar
zYne committed
92

zYne's avatar
zYne committed
93

meus's avatar
meus committed
94
//TICKET test cases
95 96
$tickets = new GroupTest('Tickets tests');
$tickets->addTestCase(new Doctrine_Ticket_Njero_TestCase());
97
$tickets->addTestCase(new Doctrine_Ticket_428_TestCase());
98
//If you write a ticket testcase add it here like shown above!
99
$test->addTestCase($tickets);
100

zYne's avatar
zYne committed
101
// Connection drivers (not yet fully tested)
102 103 104 105 106 107 108 109 110
$driver = new GroupTest("Driver tests");
$driver->addTestCase(new Doctrine_Connection_Pgsql_TestCase());
$driver->addTestCase(new Doctrine_Connection_Oracle_TestCase());
$driver->addTestCase(new Doctrine_Connection_Sqlite_TestCase());
$driver->addTestCase(new Doctrine_Connection_Mssql_TestCase()); 
$driver->addTestCase(new Doctrine_Connection_Mysql_TestCase());
$driver->addTestCase(new Doctrine_Connection_Firebird_TestCase());
$driver->addTestCase(new Doctrine_Connection_Informix_TestCase());
$test->addTestCase($driver);
zYne's avatar
zYne committed
111

zYne's avatar
zYne committed
112
// Transaction module (FULLY TESTED)
113 114 115 116 117 118 119 120 121 122
$transaction = new GroupTest("Transaction tests");
$transaction->addTestCase(new Doctrine_Transaction_TestCase());
$transaction->addTestCase(new Doctrine_Transaction_Firebird_TestCase());
$transaction->addTestCase(new Doctrine_Transaction_Informix_TestCase());
$transaction->addTestCase(new Doctrine_Transaction_Mysql_TestCase());
$transaction->addTestCase(new Doctrine_Transaction_Mssql_TestCase());
$transaction->addTestCase(new Doctrine_Transaction_Pgsql_TestCase());
$transaction->addTestCase(new Doctrine_Transaction_Oracle_TestCase());
$transaction->addTestCase(new Doctrine_Transaction_Sqlite_TestCase());
$test->addTestCase($transaction);
123

zYne's avatar
zYne committed
124
// DataDict module (FULLY TESTED)
125 126 127 128 129 130 131 132 133 134
$data_dict = new GroupTest('DataDict tests');
$data_dict->addTestCase(new Doctrine_DataDict_TestCase());
$data_dict->addTestCase(new Doctrine_DataDict_Firebird_TestCase());
$data_dict->addTestCase(new Doctrine_DataDict_Informix_TestCase());
$data_dict->addTestCase(new Doctrine_DataDict_Mysql_TestCase());
$data_dict->addTestCase(new Doctrine_DataDict_Mssql_TestCase());
$data_dict->addTestCase(new Doctrine_DataDict_Pgsql_TestCase());
$data_dict->addTestCase(new Doctrine_DataDict_Oracle_TestCase());
$data_dict->addTestCase(new Doctrine_DataDict_Sqlite_TestCase());
$test->addTestCase($data_dict);
zYne's avatar
zYne committed
135

zYne's avatar
zYne committed
136
// Sequence module (not yet fully tested)
137 138 139 140 141 142 143 144 145 146
$sequence = new GroupTest('Sequence tests');
$sequence->addTestCase(new Doctrine_Sequence_TestCase());
$sequence->addTestCase(new Doctrine_Sequence_Firebird_TestCase());
$sequence->addTestCase(new Doctrine_Sequence_Informix_TestCase());
$sequence->addTestCase(new Doctrine_Sequence_Mysql_TestCase());
$sequence->addTestCase(new Doctrine_Sequence_Mssql_TestCase());
$sequence->addTestCase(new Doctrine_Sequence_Pgsql_TestCase());
$sequence->addTestCase(new Doctrine_Sequence_Oracle_TestCase());
$sequence->addTestCase(new Doctrine_Sequence_Sqlite_TestCase());
$test->addTestCase($sequence);
zYne's avatar
zYne committed
147

zYne's avatar
zYne committed
148
// Export module (not yet fully tested)
149 150 151 152 153 154 155 156 157 158 159 160
$export = new GroupTest('Export tests');
//$export->addTestCase(new Doctrine_Export_Reporter_TestCase());
$export->addTestCase(new Doctrine_Export_Firebird_TestCase());
$export->addTestCase(new Doctrine_Export_Informix_TestCase());
$export->addTestCase(new Doctrine_Export_TestCase());
$export->addTestCase(new Doctrine_Export_Mssql_TestCase());
$export->addTestCase(new Doctrine_Export_Pgsql_TestCase());
$export->addTestCase(new Doctrine_Export_Oracle_TestCase());
$export->addTestCase(new Doctrine_Export_Record_TestCase());
$export->addTestCase(new Doctrine_Export_Mysql_TestCase());
$export->addTestCase(new Doctrine_Export_Sqlite_TestCase());
$test->addTestCase($export);
zYne's avatar
zYne committed
161

zYne's avatar
zYne committed
162
//$test->addTestCase(new Doctrine_CascadingDelete_TestCase());
zYne's avatar
zYne committed
163

zYne's avatar
zYne committed
164
// Import module (not yet fully tested)
165 166 167 168 169 170 171 172 173 174
$import = new GroupTest('Import tests');
//$import->addTestCase(new Doctrine_Import_TestCase());
$import->addTestCase(new Doctrine_Import_Firebird_TestCase());
$import->addTestCase(new Doctrine_Import_Informix_TestCase());
$import->addTestCase(new Doctrine_Import_Mysql_TestCase());
$import->addTestCase(new Doctrine_Import_Mssql_TestCase());
$import->addTestCase(new Doctrine_Import_Pgsql_TestCase());
$import->addTestCase(new Doctrine_Import_Oracle_TestCase());
$import->addTestCase(new Doctrine_Import_Sqlite_TestCase());
$test->addTestCase($import);
zYne's avatar
zYne committed
175

zYne's avatar
zYne committed
176
// Expression module (not yet fully tested)
177 178 179 180 181 182 183 184 185 186 187
$expression = new GroupTest('Expression tests');
$expression->addTestCase(new Doctrine_Expression_TestCase());
$expression->addTestCase(new Doctrine_Expression_Driver_TestCase());
$expression->addTestCase(new Doctrine_Expression_Firebird_TestCase());
$expression->addTestCase(new Doctrine_Expression_Informix_TestCase());
$expression->addTestCase(new Doctrine_Expression_Mysql_TestCase());
$expression->addTestCase(new Doctrine_Expression_Mssql_TestCase());
$expression->addTestCase(new Doctrine_Expression_Pgsql_TestCase());
$expression->addTestCase(new Doctrine_Expression_Oracle_TestCase());
$expression->addTestCase(new Doctrine_Expression_Sqlite_TestCase());
$test->addTestCase($expression);
zYne's avatar
zYne committed
188

zYne's avatar
zYne committed
189
// Core
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
$core = new GroupTest('Core tests: Access, Configurable, Manager, Connection, Table, UnitOfWork, Collection, Hydrate, Tokenizer');
$core->addTestCase(new Doctrine_Access_TestCase());
//$core->addTestCase(new Doctrine_Configurable_TestCase());
$core->addTestCase(new Doctrine_Manager_TestCase());
$core->addTestCase(new Doctrine_Connection_TestCase());
$core->addTestCase(new Doctrine_Table_TestCase());
$core->addTestCase(new Doctrine_UnitOfWork_TestCase());
//$core->addTestCase(new Doctrine_Collection_TestCase());
$core->addTestCase(new Doctrine_Collection_Snapshot_TestCase());
$core->addTestCase(new Doctrine_Hydrate_FetchMode_TestCase());
$core->addTestCase(new Doctrine_Tokenizer_TestCase());
//$core->addTestCase(new Doctrine_Collection_Offset_TestCase());
//$core->addTestCase(new Doctrine_BatchIterator_TestCase());
//$core->addTestCase(new Doctrine_Hydrate_TestCase());
$test->addTestCase($core);
zYne's avatar
zYne committed
205

zYne's avatar
zYne committed
206
// Relation handling
207 208 209 210 211 212 213 214 215 216 217
$relation = new GroupTest('Relation tests: includes TreeStructure');
$relation->addTestCase(new Doctrine_TreeStructure_TestCase());
$relation->addTestCase(new Doctrine_Relation_TestCase());
//$relation->addTestCase(new Doctrine_Relation_Access_TestCase());
//$relation->addTestCase(new Doctrine_Relation_ManyToMany_TestCase());
$relation->addTestCase(new Doctrine_Relation_ManyToMany2_TestCase());
$relation->addTestCase(new Doctrine_Relation_OneToMany_TestCase());
$relation->addTestCase(new Doctrine_Relation_Nest_TestCase());
$relation->addTestCase(new Doctrine_Relation_OneToOne_TestCase());
$relation->addTestCase(new Doctrine_Relation_Parser_TestCase());
$test->addTestCase($relation);
zYne's avatar
zYne committed
218

zYne's avatar
zYne committed
219
// Datatypes
220 221 222 223
$data_types = new GroupTest('DataTypes tests: Enum and Boolean');
$data_types->addTestCase(new Doctrine_DataType_Enum_TestCase());
$data_types->addTestCase(new Doctrine_DataType_Boolean_TestCase());
$test->addTestCase($data_types);
224

zYne's avatar
zYne committed
225
// Utility components
226 227 228 229 230 231
$utility = new GroupTest('Utility tests: View, Validator, Hook');
//$utility->addTestCase(new Doctrine_PessimisticLocking_TestCase());
$utility->addTestCase(new Doctrine_View_TestCase());
$utility->addTestCase(new Doctrine_Validator_TestCase());
$utility->addTestCase(new Doctrine_Hook_TestCase());
$test->addTestCase($utility);
232

zYne's avatar
zYne committed
233
// Db component
234 235 236 237
$db = new GroupTest('Db tests: Db and Profiler');
$db->addTestCase(new Doctrine_Db_TestCase());
$db->addTestCase(new Doctrine_Connection_Profiler_TestCase());
$test->addTestCase($db);
238

zYne's avatar
zYne committed
239
// Eventlisteners
240 241 242 243
$event_listener = new GroupTest('EventListener tests');
$event_listener->addTestCase(new Doctrine_EventListener_TestCase());
$event_listener->addTestCase(new Doctrine_EventListener_Chain_TestCase());
$test->addTestCase($event_listener);
zYne's avatar
zYne committed
244

245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
// Query tests
$query_tests = new GroupTest('Query tests');
$query_tests->addTestCase(new Doctrine_Query_Condition_TestCase());
$query_tests->addTestCase(new Doctrine_Query_MultiJoin_TestCase());
$query_tests->addTestCase(new Doctrine_Query_MultiJoin2_TestCase());
$query_tests->addTestCase(new Doctrine_Query_ReferenceModel_TestCase());
$query_tests->addTestCase(new Doctrine_Query_ComponentAlias_TestCase());
$query_tests->addTestCase(new Doctrine_Query_ShortAliases_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Expression_TestCase());
$query_tests->addTestCase(new Doctrine_Query_OneToOneFetching_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Check_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Limit_TestCase());
//$query_tests->addTestCase(new Doctrine_Query_IdentifierQuoting_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Update_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Delete_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Join_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Having_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Orderby_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Subquery_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Driver_TestCase());
$query_tests->addTestCase(new Doctrine_Record_Hook_TestCase());
$query_tests->addTestCase(new Doctrine_Query_AggregateValue_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Where_TestCase());
$query_tests->addTestCase(new Doctrine_Query_From_TestCase());
$query_tests->addTestCase(new Doctrine_Query_Select_TestCase());
$query_tests->addTestCase(new Doctrine_Query_JoinCondition_TestCase());
$query_tests->addTestCase(new Doctrine_Query_MultipleAggregateValue_TestCase());
$query_tests->addTestCase(new Doctrine_Query_TestCase());
$query_tests->addTestCase(new Doctrine_Query_MysqlSubquery_TestCase());
$query_tests->addTestCase(new Doctrine_Query_PgsqlSubquery_TestCase());
$query_tests->addTestCase(new Doctrine_Query_MysqlSubqueryHaving_TestCase());
$query_tests->addTestCase(new Doctrine_Query_SelectExpression_TestCase());
$test->addTestCase($query_tests);
zYne's avatar
zYne committed
278

279 280 281 282 283 284 285 286 287 288 289
// Record
$record = new GroupTest('Record tests');
$record->addTestCase(new Doctrine_Record_Filter_TestCase());
$record->addTestCase(new Doctrine_Record_TestCase());
$record->addTestCase(new Doctrine_Record_State_TestCase());
$record->addTestCase(new Doctrine_Record_SerializeUnserialize_TestCase());
// This test used to segfault php because of infinite recursion in Connection/UnitOfWork
$record->addTestCase(new Doctrine_Record_Lock_TestCase());
$record->addTestCase(new Doctrine_Record_ZeroValues_TestCase());
//$record->addTestCase(new Doctrine_Record_SaveBlankRecord_TestCase());
$test->addTestCase($record);
zYne's avatar
zYne committed
290

zYne's avatar
zYne committed
291

292
$test->addTestCase(new Doctrine_Schema_TestCase());
zYne's avatar
zYne committed
293

zYne's avatar
zYne committed
294
$test->addTestCase(new Doctrine_CustomPrimaryKey_TestCase());
zYne's avatar
zYne committed
295
$test->addTestCase(new Doctrine_CustomResultSetOrder_TestCase());
zYne's avatar
zYne committed
296 297


298
$test->addTestCase(new Doctrine_ColumnAggregationInheritance_TestCase());
zYne's avatar
zYne committed
299

zYne's avatar
zYne committed
300
$test->addTestCase(new Doctrine_ColumnAlias_TestCase());
zYne's avatar
zYne committed
301

zYne's avatar
zYne committed
302 303 304 305 306

$test->addTestCase(new Doctrine_RawSql_TestCase());

$test->addTestCase(new Doctrine_NewCore_TestCase());

307 308 309 310 311 312

$test->addTestCase(new Doctrine_Import_Schema_Yml_TestCase());
$test->addTestCase(new Doctrine_Import_Schema_Xml_TestCase());
$test->addTestCase(new Doctrine_Export_Schema_Yml_TestCase());
$test->addTestCase(new Doctrine_Export_Schema_Xml_TestCase());

313
//$test->addTestCase(new Doctrine_Template_TestCase());
Jonathan.Wage's avatar
Jonathan.Wage committed
314

315
//$test->addTestCase(new Doctrine_Import_Builder_TestCase());
zYne's avatar
zYne committed
316

317
//$test->addTestCase(new Doctrine_Search_TestCase());
318

zYne's avatar
zYne committed
319
//$test->addTestCase(new Doctrine_IntegrityAction_TestCase());
zYne's avatar
zYne committed
320

zYne's avatar
zYne committed
321 322
//$test->addTestCase(new Doctrine_AuditLog_TestCase());

323
$test->addTestCase(new Doctrine_NestedSet_SingleRoot_TestCase());
romanb's avatar
romanb committed
324

zYne's avatar
zYne committed
325
// Cache tests
326 327 328 329 330 331 332 333 334 335
$cache = new GroupTest('Cache tests');
$cache->addTestCase(new Doctrine_Query_Cache_TestCase());
$cache->addTestCase(new Doctrine_Cache_Apc_TestCase());
//$cache->addTestCase(new Doctrine_Cache_Memcache_TestCase());
//$cache->addTestCase(new Doctrine_Cache_Sqlite_TestCase());
//$cache->addTestCase(new Doctrine_Cache_Query_SqliteTestCase());
//$cache->addTestCase(new Doctrine_Cache_FileTestCase());
//$cache->addTestCase(new Doctrine_Cache_SqliteTestCase());
//$cache->addTestCase(new Doctrine_Cache_TestCase());
$test->addTestCase($cache);
zYne's avatar
zYne committed
336

337

meus's avatar
meus committed
338 339 340 341 342 343
class CliReporter extends HtmlReporter{
    public function paintHeader(){
        echo "Doctrine UnitTests\n";
        echo "====================\n";
    }
    public function paintFooter(){
meus's avatar
meus committed
344
        echo "\n";
345 346 347
        foreach ($this->_test->getMessages() as $message) {
            print $message . "\n";
        }
meus's avatar
meus committed
348 349 350 351 352 353 354
        echo "====================\n";
        print "Tested: " . $this->_test->getTestCaseCount() . ' test cases' ."\n";
        print "Successes: " . $this->_test->getPassCount() . " passes. \n";
        print "Failures: " . $this->_test->getFailCount() . " fails. \n";
    }
}

355
class MyReporter extends HtmlReporter {
meus's avatar
meus committed
356
    public function paintHeader() {
357
?>
meus's avatar
meus committed
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
<html>
<head>
  <title>Doctrine Unit Tests</title>
  <style>
.fail { color: red; } pre { background-color: lightgray; }
  </style>
</head>

<body>

<h1>Doctrine Unit Tests</h1>
<?php

    }

373 374
    public function paintFooter()
    {
meus's avatar
meus committed
375

376
        print '<pre>';
377
        foreach ($this->_test->getMessages() as $message) {
378
            print "<p>$message</p>";
379
        }
380 381 382
        print '</pre>';
        $colour = ($this->_test->getFailCount() > 0 ? 'red' : 'green');
        print '<div style=\'';
383
        print "padding: 8px; margin-top: 1em; background-color: $colour; color: white;";
384
        print '\'>';
meus's avatar
meus committed
385
        print $this->_test->getTestCaseCount() . ' test cases.';
386 387 388
        print '<strong>' . $this->_test->getPassCount() . '</strong> passes and ';
        print '<strong>' . $this->_test->getFailCount() . '</strong> fails.';
        print '</div>';
389 390 391 392 393
    }
}


?>
zYne's avatar
zYne committed
394
<?php
395
if (PHP_SAPI === 'cli') {
meus's avatar
meus committed
396
    $reporter = new CliReporter();
397 398 399
    $argv = $_SERVER['argv'];
    array_shift($argv);
    $options = parseOptions($argv);
400
} else {
401
    $options = $_GET;
402
    $reporter = new MyReporter();
meus's avatar
meus committed
403
}
zYne's avatar
zYne committed
404

405

406
if (isset($options['group'])) {
407 408
    $testGroup = new GroupTest('Custom');
    foreach($options['group'] as $group) {
409
        if ( ! isset($$group)) {
410 411 412
            if (class_exists($group)) {
                $testGroup->addTestCase(new $group);
            }
413 414
            die($group . " is not a valid group of tests\n");
        }
415
        $testGroup->addTestCase($$group);
416 417 418 419
    }
} else {
    $testGroup = $test;
}
420 421 422
$filter = '';
if (isset($options['filter'])) {
    $filter = $options['filter'];
423 424
}

425
if (isset($options['help'])) {
meus's avatar
meus committed
426 427 428 429 430
    echo "Doctrine test runner help\n";
    echo "===========================\n";
    echo " To run all tests simply run this script without arguments. \n";
    echo "\n Flags:\n";
    echo " -coverage will generate coverage report data that can be viewed with the cc.php script in this folder. NB! This takes time. You need xdebug to run this\n";
431 432 433
    echo " -group <groupName1> <groupName2> <className1> Use this option to run just a group of tests or tests with a given classname. Groups are currently defined as the variable name they are called in this script.\n";
    echo " -filter <string1> <string2> case insensitive strings that will be applied to the className of the tests. A test_classname must contain all of these strings to be run\n"; 
    echo "\nAvailable groups:\n tickets, transaction, driver, data_dict, sequence, export, import, expression, core, relation, data_types, utility, db, event_listener, query_tests, record, cache\n";
meus's avatar
meus committed
434 435 436
    die();
}

437
if (isset($options['coverage'])) {
438
    xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
439
    $testGroup->run($reporter, $filter);
440 441
    $result['path'] = Doctrine::getPath() . DIRECTORY_SEPARATOR;
    $result['coverage'] = xdebug_get_code_coverage();
442
    xdebug_stop_code_coverage();
443
    file_put_contents('coverage.txt', serialize($result));
444
} else {
445
    $testGroup->run($reporter, $filter);
446
}