2006-10-01 13:54:15 +00:00
|
|
|
<?php
|
|
|
|
|
2007-01-29 20:10:51 +00:00
|
|
|
ini_set('max_execution_time', 900);
|
2006-10-01 13:54:15 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
function autoload($class) {
|
2007-07-06 12:37:02 +00:00
|
|
|
if(strpos($class, 'TestCase') === false) {
|
2006-12-27 21:20:26 +00:00
|
|
|
return false;
|
2007-07-06 12:37:02 +00:00
|
|
|
}
|
2006-11-28 18:39:31 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$e = explode('_', $class);
|
|
|
|
$count = count($e);
|
2006-10-01 13:54:15 +00:00
|
|
|
|
2007-06-01 10:17:50 +00:00
|
|
|
$prefix = array_shift($e);
|
|
|
|
|
|
|
|
if ($prefix !== 'Doctrine') {
|
|
|
|
return false;
|
|
|
|
}
|
2006-11-27 22:49:13 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$dir = array_shift($e);
|
2006-12-02 14:40:47 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$file = $dir . '_' . substr(implode('_', $e), 0, -(strlen('_TestCase'))) . 'TestCase.php';
|
2006-12-02 14:40:47 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
if($count > 3) {
|
|
|
|
$file = str_replace('_', DIRECTORY_SEPARATOR, $file);
|
|
|
|
} else {
|
|
|
|
$file = str_replace('_', '', $file);
|
|
|
|
}
|
2007-04-18 19:03:36 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
// create a test case file if it doesn't exist
|
2006-12-02 14:40:47 +00:00
|
|
|
|
2007-06-01 10:17:50 +00:00
|
|
|
if ( ! file_exists($file)) {
|
2006-12-27 21:20:26 +00:00
|
|
|
$contents = file_get_contents('template.tpl');
|
|
|
|
$contents = sprintf($contents, $class, $class);
|
2006-12-02 20:51:26 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
if( ! file_exists($dir)) {
|
|
|
|
mkdir($dir, 0777);
|
|
|
|
}
|
2006-11-27 22:49:13 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
file_put_contents($file, $contents);
|
|
|
|
}
|
|
|
|
require_once($file);
|
2007-04-18 19:28:21 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
return true;
|
|
|
|
}
|
2006-11-27 22:49:13 +00:00
|
|
|
|
2007-04-18 19:28:21 +00:00
|
|
|
// include doctrine, and register it's autoloader
|
2006-12-27 21:20:26 +00:00
|
|
|
require_once dirname(__FILE__) . '/../lib/Doctrine.php';
|
|
|
|
spl_autoload_register(array('Doctrine', 'autoload'));
|
2007-04-18 19:28:21 +00:00
|
|
|
|
|
|
|
// register the autoloader function above
|
2006-12-27 21:20:26 +00:00
|
|
|
spl_autoload_register('autoload');
|
2006-11-29 21:09:02 +00:00
|
|
|
|
2007-01-09 22:59:15 +00:00
|
|
|
require_once dirname(__FILE__) . '/../models/location.php';
|
2007-06-27 17:41:02 +00:00
|
|
|
require_once dirname(__FILE__) . '/../models/Blog.php';
|
2007-04-18 19:28:21 +00:00
|
|
|
require_once dirname(__FILE__) . '/classes.php';
|
2007-06-27 17:41:02 +00:00
|
|
|
|
2007-06-01 10:17:50 +00:00
|
|
|
require_once dirname(__FILE__) . '/Test.php';
|
2007-04-18 19:28:21 +00:00
|
|
|
require_once dirname(__FILE__) . '/UnitTestCase.php';
|
2007-01-09 22:59:15 +00:00
|
|
|
|
2007-06-07 17:04:56 +00:00
|
|
|
error_reporting(E_ALL | E_STRICT);
|
2006-11-23 23:23:24 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test = new GroupTest('Doctrine Framework Unit Tests');
|
2006-11-23 23:23:24 +00:00
|
|
|
|
2007-01-09 23:11:32 +00:00
|
|
|
|
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
// DATABASE ABSTRACTION tests
|
2007-06-13 07:43:24 +00:00
|
|
|
|
|
|
|
// Temp tests
|
2007-06-18 19:58:11 +00:00
|
|
|
/**
|
2007-06-14 20:42:05 +00:00
|
|
|
|
2007-06-13 07:43:24 +00:00
|
|
|
$test->addTestCase(new Doctrine_Ticket330_TestCase());
|
2007-06-19 11:19:53 +00:00
|
|
|
*/
|
2007-07-11 22:03:47 +00:00
|
|
|
/** */
|
2007-01-01 18:36:37 +00:00
|
|
|
// Connection drivers (not yet fully tested)
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Connection_Pgsql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Connection_Oracle_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Connection_Sqlite_TestCase());
|
2007-01-01 18:36:37 +00:00
|
|
|
$test->addTestCase(new Doctrine_Connection_Mssql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Connection_Mysql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Connection_Firebird_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Connection_Informix_TestCase());
|
2007-01-05 22:13:44 +00:00
|
|
|
|
2007-01-01 18:36:37 +00:00
|
|
|
// Transaction module (FULLY TESTED)
|
|
|
|
$test->addTestCase(new Doctrine_Transaction_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Transaction_Firebird_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Transaction_Informix_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Transaction_Mysql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Transaction_Mssql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Transaction_Pgsql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Transaction_Oracle_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Transaction_Sqlite_TestCase());
|
2006-12-23 22:45:36 +00:00
|
|
|
|
2007-01-01 18:36:37 +00:00
|
|
|
// DataDict module (FULLY TESTED)
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Firebird_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Informix_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Mysql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Mssql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Pgsql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Oracle_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_DataDict_Sqlite_TestCase());
|
|
|
|
|
2007-01-07 23:52:15 +00:00
|
|
|
// Sequence module (not yet fully tested)
|
|
|
|
$test->addTestCase(new Doctrine_Sequence_TestCase());
|
2007-01-09 23:14:22 +00:00
|
|
|
$test->addTestCase(new Doctrine_Sequence_Firebird_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Sequence_Informix_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Sequence_Mysql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Sequence_Mssql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Sequence_Pgsql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Sequence_Oracle_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Sequence_Sqlite_TestCase());
|
2007-01-07 23:52:15 +00:00
|
|
|
|
2007-01-01 18:36:37 +00:00
|
|
|
// Export module (not yet fully tested)
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2007-04-11 19:12:52 +00:00
|
|
|
|
2007-01-23 16:27:20 +00:00
|
|
|
//$test->addTestCase(new Doctrine_Export_Reporter_TestCase());
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Export_Firebird_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Export_Informix_TestCase());
|
2007-04-11 19:12:52 +00:00
|
|
|
$test->addTestCase(new Doctrine_Export_TestCase());
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Export_Mssql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Export_Pgsql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Export_Oracle_TestCase());
|
2007-06-18 19:58:11 +00:00
|
|
|
$test->addTestCase(new Doctrine_Export_Record_TestCase());
|
2007-03-21 22:11:18 +00:00
|
|
|
$test->addTestCase(new Doctrine_Export_Mysql_TestCase());
|
2007-06-26 22:35:08 +00:00
|
|
|
|
2007-06-18 19:58:11 +00:00
|
|
|
$test->addTestCase(new Doctrine_Export_Sqlite_TestCase());
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2007-06-14 20:42:05 +00:00
|
|
|
//$test->addTestCase(new Doctrine_CascadingDelete_TestCase());
|
2007-04-11 19:12:52 +00:00
|
|
|
|
2007-01-01 18:36:37 +00:00
|
|
|
// Import module (not yet fully tested)
|
2006-12-27 21:20:26 +00:00
|
|
|
//$test->addTestCase(new Doctrine_Import_TestCase());
|
2007-01-27 10:08:06 +00:00
|
|
|
$test->addTestCase(new Doctrine_Import_Firebird_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Import_Informix_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Import_Mysql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Import_Mssql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Import_Pgsql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Import_Oracle_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Import_Sqlite_TestCase());
|
2007-01-24 22:50:49 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
|
2007-01-01 18:36:37 +00:00
|
|
|
// Expression module (not yet fully tested)
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Expression_TestCase());
|
2007-07-01 11:27:45 +00:00
|
|
|
$test->addTestCase(new Doctrine_Expression_Driver_TestCase());
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Expression_Firebird_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Expression_Informix_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Expression_Mysql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Expression_Mssql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Expression_Pgsql_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Expression_Oracle_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Expression_Sqlite_TestCase());
|
2007-06-10 19:40:14 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
// Core
|
2007-06-25 20:08:16 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Access_TestCase());
|
|
|
|
//$test->addTestCase(new Doctrine_Configurable_TestCase());
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Manager_TestCase());
|
2007-07-05 23:47:48 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Connection_TestCase());
|
2007-07-05 23:47:48 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Table_TestCase());
|
2006-11-23 23:23:24 +00:00
|
|
|
|
2007-04-11 19:12:52 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_UnitOfWork_TestCase());
|
2006-11-23 23:23:24 +00:00
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
//$test->addTestCase(new Doctrine_Collection_TestCase());
|
2006-12-27 21:20:26 +00:00
|
|
|
// Relation handling
|
2007-02-17 12:38:02 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_TreeStructure_TestCase());
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Relation_TestCase());
|
2007-03-21 22:11:18 +00:00
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
//$test->addTestCase(new Doctrine_Relation_Access_TestCase());
|
|
|
|
//$test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase());
|
2007-06-10 19:40:14 +00:00
|
|
|
|
2007-06-26 13:08:58 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Relation_OneToMany_TestCase());
|
|
|
|
|
2007-06-11 19:27:16 +00:00
|
|
|
$test->addTestCase(new Doctrine_Relation_Nest_TestCase());
|
2007-06-10 19:40:14 +00:00
|
|
|
|
2007-01-07 23:52:15 +00:00
|
|
|
$test->addTestCase(new Doctrine_Relation_OneToOne_TestCase());
|
2007-06-10 19:40:14 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Relation_Parser_TestCase());
|
2007-01-07 23:52:15 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
// Datatypes
|
|
|
|
$test->addTestCase(new Doctrine_Enum_TestCase());
|
2007-07-05 17:25:53 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_Boolean_TestCase());
|
2006-12-02 14:40:47 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
// Utility components
|
2007-03-21 22:11:18 +00:00
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
//$test->addTestCase(new Doctrine_PessimisticLocking_TestCase());
|
|
|
|
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2007-07-05 20:03:38 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_View_TestCase());
|
2007-03-21 22:11:18 +00:00
|
|
|
|
2007-02-17 12:38:02 +00:00
|
|
|
$test->addTestCase(new Doctrine_Validator_TestCase());
|
2006-11-16 20:31:39 +00:00
|
|
|
|
2007-03-21 22:11:18 +00:00
|
|
|
$test->addTestCase(new Doctrine_Hook_TestCase());
|
2006-11-16 20:31:39 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
// Db component
|
2006-11-07 23:12:05 +00:00
|
|
|
$test->addTestCase(new Doctrine_Db_TestCase());
|
2007-06-19 23:33:04 +00:00
|
|
|
$test->addTestCase(new Doctrine_Connection_Profiler_TestCase());
|
2006-11-08 19:12:16 +00:00
|
|
|
|
2006-11-05 19:24:28 +00:00
|
|
|
|
2007-02-17 12:38:02 +00:00
|
|
|
// Eventlisteners
|
|
|
|
$test->addTestCase(new Doctrine_EventListener_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_EventListener_Chain_TestCase());
|
|
|
|
|
2006-10-20 18:21:42 +00:00
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Record_Filter_TestCase());
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_SchemaTestCase());
|
2007-05-27 18:56:54 +00:00
|
|
|
|
2007-02-17 12:38:02 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Condition_TestCase());
|
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
$test->addTestCase(new Doctrine_CustomPrimaryKey_TestCase());
|
2006-10-01 13:54:15 +00:00
|
|
|
|
2007-06-14 21:48:14 +00:00
|
|
|
$test->addTestCase(new Doctrine_CustomResultSetOrder_TestCase());
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2007-03-21 22:11:18 +00:00
|
|
|
// Query tests
|
2007-05-27 18:56:54 +00:00
|
|
|
|
2006-12-23 22:45:36 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_MultiJoin_TestCase());
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2007-05-28 17:02:18 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_MultiJoin2_TestCase());
|
|
|
|
|
2006-12-23 22:45:36 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_ReferenceModel_TestCase());
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2006-10-03 17:24:13 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_ComponentAlias_TestCase());
|
2007-01-29 20:10:51 +00:00
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
|
2007-06-14 21:48:14 +00:00
|
|
|
|
2006-11-10 23:15:34 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_ShortAliases_TestCase());
|
2007-05-27 18:56:54 +00:00
|
|
|
|
2007-01-01 18:36:37 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Expression_TestCase());
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2007-04-08 14:55:14 +00:00
|
|
|
$test->addTestCase(new Doctrine_ColumnAggregationInheritance_TestCase());
|
2007-06-01 10:17:50 +00:00
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
$test->addTestCase(new Doctrine_ColumnAlias_TestCase());
|
2007-04-18 19:03:36 +00:00
|
|
|
|
2007-06-05 19:33:09 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_OneToOneFetching_TestCase());
|
2007-02-17 12:38:02 +00:00
|
|
|
|
2007-06-29 10:18:05 +00:00
|
|
|
|
2007-02-05 12:04:56 +00:00
|
|
|
|
2007-04-11 19:12:52 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Check_TestCase());
|
2007-06-01 10:17:50 +00:00
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Limit_TestCase());
|
|
|
|
|
|
|
|
|
2007-06-07 17:04:56 +00:00
|
|
|
|
2007-07-09 11:23:44 +00:00
|
|
|
//$test->addTestCase(new Doctrine_Query_IdentifierQuoting_TestCase());
|
2007-05-27 18:56:54 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Update_TestCase());
|
|
|
|
$test->addTestCase(new Doctrine_Query_Delete_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_Join_TestCase());
|
|
|
|
|
2007-06-11 19:27:16 +00:00
|
|
|
$test->addTestCase(new Doctrine_Record_TestCase());
|
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Having_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_RawSql_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_Orderby_TestCase());
|
2007-03-01 21:48:09 +00:00
|
|
|
|
2007-04-18 19:03:36 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Subquery_TestCase());
|
|
|
|
|
2007-06-25 19:25:23 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Driver_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Record_Hook_TestCase());
|
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_AggregateValue_TestCase());
|
|
|
|
|
2007-06-01 10:17:50 +00:00
|
|
|
|
2007-06-10 19:40:14 +00:00
|
|
|
|
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
$test->addTestCase(new Doctrine_NewCore_TestCase());
|
|
|
|
|
|
|
|
// Record
|
2007-06-11 19:27:16 +00:00
|
|
|
|
2007-05-27 18:56:54 +00:00
|
|
|
$test->addTestCase(new Doctrine_Record_State_TestCase());
|
|
|
|
|
2007-07-06 21:18:36 +00:00
|
|
|
// This test used to segfault php because of infinite recursion in Connection/UnitOfWork
|
|
|
|
$test->addTestCase(new Doctrine_Record_Lock_TestCase());
|
2007-05-29 18:41:54 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Tokenizer_TestCase());
|
2007-06-01 10:17:50 +00:00
|
|
|
|
2007-05-29 18:41:54 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Collection_Snapshot_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Hydrate_FetchMode_TestCase());
|
2007-05-27 18:56:54 +00:00
|
|
|
|
2007-06-10 19:40:14 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_Where_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_From_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_Select_TestCase());
|
2007-06-07 17:04:56 +00:00
|
|
|
|
2007-06-11 19:27:16 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_JoinCondition_TestCase());
|
|
|
|
|
2007-06-12 21:35:18 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_MultipleAggregateValue_TestCase());
|
2007-06-19 11:19:53 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_TestCase());
|
2007-06-25 20:08:16 +00:00
|
|
|
|
2007-06-27 16:47:06 +00:00
|
|
|
$test->addTestCase(new Doctrine_Ticket364_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_MysqlSubquery_TestCase());
|
|
|
|
|
2007-06-27 17:41:02 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_PgsqlSubquery_TestCase());
|
|
|
|
|
2007-06-27 18:01:31 +00:00
|
|
|
$test->addTestCase(new Doctrine_Query_MysqlSubqueryHaving_TestCase());
|
2007-06-28 19:02:55 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Record_ZeroValues_TestCase());
|
2007-06-29 10:18:05 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Query_Cache_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Cache_Apc_TestCase());
|
2007-07-11 22:03:47 +00:00
|
|
|
/**
|
2007-06-29 10:18:05 +00:00
|
|
|
$test->addTestCase(new Doctrine_Cache_Memcache_TestCase());
|
2007-06-29 19:23:19 +00:00
|
|
|
|
2007-06-29 10:18:05 +00:00
|
|
|
$test->addTestCase(new Doctrine_Cache_Sqlite_TestCase());
|
2007-06-29 19:23:19 +00:00
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Record_SaveBlankRecord_TestCase());
|
|
|
|
|
2007-06-28 11:56:56 +00:00
|
|
|
$test->addTestCase(new Doctrine_Template_TestCase());
|
2007-07-06 12:37:02 +00:00
|
|
|
|
2007-07-11 14:39:15 +00:00
|
|
|
$test->addTestCase(new Doctrine_Import_Builder_TestCase());
|
|
|
|
|
|
|
|
$test->addTestCase(new Doctrine_Search_TestCase());
|
2007-07-11 22:03:47 +00:00
|
|
|
*/
|
2007-06-18 19:58:11 +00:00
|
|
|
//$test->addTestCase(new Doctrine_IntegrityAction_TestCase());
|
2007-06-25 19:25:23 +00:00
|
|
|
|
2007-06-14 21:48:14 +00:00
|
|
|
//$test->addTestCase(new Doctrine_AuditLog_TestCase());
|
|
|
|
|
2007-07-11 22:03:47 +00:00
|
|
|
//$test->addTestCase(new Doctrine_NestedSet_SingleRoot_TestCase());
|
2007-07-11 15:55:52 +00:00
|
|
|
|
2006-12-27 21:20:26 +00:00
|
|
|
// Cache tests
|
2006-11-16 12:45:34 +00:00
|
|
|
//$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase());
|
2006-10-01 13:54:15 +00:00
|
|
|
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
|
|
|
|
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());
|
2007-05-27 18:56:54 +00:00
|
|
|
//$test->addTestCase(new Doctrine_Collection_Offset_TestCase());
|
|
|
|
//$test->addTestCase(new Doctrine_BatchIterator_TestCase());
|
|
|
|
//$test->addTestCase(new Doctrine_Hydrate_TestCase());
|
|
|
|
//$test->addTestCase(new Doctrine_Cache_TestCase());
|
2007-06-19 11:19:53 +00:00
|
|
|
|
2007-04-08 14:55:14 +00:00
|
|
|
|
2006-10-01 13:54:15 +00:00
|
|
|
class MyReporter extends HtmlReporter {
|
|
|
|
public function paintHeader() {}
|
|
|
|
public function paintFooter()
|
|
|
|
{
|
2007-06-01 10:17:50 +00:00
|
|
|
print "<pre>";
|
|
|
|
foreach ($this->_test->getMessages() as $message) {
|
|
|
|
print $message . "\n";
|
|
|
|
}
|
|
|
|
print "</pre>";
|
|
|
|
$colour = ($this->_test->getFailCount() > 0 ? "red" : "green");
|
2006-10-01 13:54:15 +00:00
|
|
|
print "<div style=\"";
|
|
|
|
print "padding: 8px; margin-top: 1em; background-color: $colour; color: white;";
|
|
|
|
print "\">";
|
2007-06-01 10:17:50 +00:00
|
|
|
print $this->_test->getTestCaseCount() . ' test cases';
|
2006-10-01 13:54:15 +00:00
|
|
|
print " test cases complete:\n";
|
2007-06-01 10:17:50 +00:00
|
|
|
print "<strong>" . $this->_test->getPassCount() . "</strong> passes, ";
|
|
|
|
print "<strong>" . $this->_test->getFailCount() . "</strong> fails and ";
|
2006-10-01 13:54:15 +00:00
|
|
|
print "</div>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Doctrine Unit Tests</title>
|
|
|
|
<style>
|
|
|
|
.fail { color: red; } pre { background-color: lightgray; }
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h1>Doctrine Unit Tests</h1>
|
2007-04-18 19:29:41 +00:00
|
|
|
|
2007-06-01 10:17:50 +00:00
|
|
|
<?php
|
|
|
|
$test->run(new MyReporter());
|
2007-07-06 12:37:02 +00:00
|
|
|
$path = Doctrine::getPath() . DIRECTORY_SEPARATOR;
|
|
|
|
|
|
|
|
?>
|
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>class</td>
|
|
|
|
<td>coverage</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
$coverage = xdebug_get_code_coverage();
|
|
|
|
ksort($coverage);
|
|
|
|
foreach ($coverage as $file => $lines) {
|
|
|
|
|
|
|
|
$pos = strpos($file, $path);
|
|
|
|
|
|
|
|
$values = array_values($lines);
|
|
|
|
$i = count($values);
|
|
|
|
$covered = 0;
|
|
|
|
while ($i--) {
|
|
|
|
if ($values[$i] > 0) {
|
|
|
|
$covered++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($pos !== false) {
|
|
|
|
$class = str_replace(DIRECTORY_SEPARATOR, '_', substr($file, strlen($path), -4));
|
|
|
|
|
|
|
|
if (strpos($class, '_Interface')) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$refl = new ReflectionClass($class);
|
|
|
|
$total = 0;
|
|
|
|
foreach ($refl->getMethods() as $method) {
|
|
|
|
$total += ($method->getEndLine() - $method->getStartLine());
|
|
|
|
}
|
|
|
|
if ($total === 0) {
|
|
|
|
$total = 1;
|
|
|
|
}
|
|
|
|
print "<tr><td>" . $class . "</td><td>" . round(($covered / $total) * 100, 2) . " % </td></tr>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
2007-04-18 19:29:41 +00:00
|
|
|
?>
|
2007-07-06 12:37:02 +00:00
|
|
|
</table>
|
2006-10-01 13:54:15 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|