diff --git a/tests/run.php b/tests/run.php index aae4e66db..3d138b123 100644 --- a/tests/run.php +++ b/tests/run.php @@ -122,254 +122,200 @@ $transaction->addTestCase(new Doctrine_Transaction_Sqlite_TestCase()); $test->addTestCase($transaction); // 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()); +$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); // Sequence module (not yet fully tested) -$test->addTestCase(new Doctrine_Sequence_TestCase()); -$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()); +$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); // Export module (not yet fully tested) - - -//$test->addTestCase(new Doctrine_Export_Reporter_TestCase()); -$test->addTestCase(new Doctrine_Export_Firebird_TestCase()); -$test->addTestCase(new Doctrine_Export_Informix_TestCase()); -$test->addTestCase(new Doctrine_Export_TestCase()); -$test->addTestCase(new Doctrine_Export_Mssql_TestCase()); -$test->addTestCase(new Doctrine_Export_Pgsql_TestCase()); -$test->addTestCase(new Doctrine_Export_Oracle_TestCase()); -$test->addTestCase(new Doctrine_Export_Record_TestCase()); -$test->addTestCase(new Doctrine_Export_Mysql_TestCase()); - -$test->addTestCase(new Doctrine_Export_Sqlite_TestCase()); +$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); //$test->addTestCase(new Doctrine_CascadingDelete_TestCase()); // Import module (not yet fully tested) -//$test->addTestCase(new Doctrine_Import_TestCase()); -$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()); - +$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); // Expression module (not yet fully tested) -$test->addTestCase(new Doctrine_Expression_TestCase()); -$test->addTestCase(new Doctrine_Expression_Driver_TestCase()); -$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()); +$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); // Core +$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); -$test->addTestCase(new Doctrine_Access_TestCase()); -//$test->addTestCase(new Doctrine_Configurable_TestCase()); - -$test->addTestCase(new Doctrine_Manager_TestCase()); - -$test->addTestCase(new Doctrine_Connection_TestCase()); - -$test->addTestCase(new Doctrine_Table_TestCase()); - - -$test->addTestCase(new Doctrine_UnitOfWork_TestCase()); - -//$test->addTestCase(new Doctrine_Collection_TestCase()); // Relation handling - -$test->addTestCase(new Doctrine_TreeStructure_TestCase()); -$test->addTestCase(new Doctrine_Relation_TestCase()); - -//$test->addTestCase(new Doctrine_Relation_Access_TestCase()); -//$test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase()); - -$test->addTestCase(new Doctrine_Relation_ManyToMany2_TestCase()); - - -$test->addTestCase(new Doctrine_Relation_OneToMany_TestCase()); - -$test->addTestCase(new Doctrine_Relation_Nest_TestCase()); - -$test->addTestCase(new Doctrine_Relation_OneToOne_TestCase()); - -$test->addTestCase(new Doctrine_Relation_Parser_TestCase()); +$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); // Datatypes -$test->addTestCase(new Doctrine_DataType_Enum_TestCase()); - -$test->addTestCase(new Doctrine_DataType_Boolean_TestCase()); +$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); // Utility components - -//$test->addTestCase(new Doctrine_PessimisticLocking_TestCase()); - - - -$test->addTestCase(new Doctrine_View_TestCase()); - -$test->addTestCase(new Doctrine_Validator_TestCase()); - -$test->addTestCase(new Doctrine_Hook_TestCase()); +$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); // Db component -$test->addTestCase(new Doctrine_Db_TestCase()); -$test->addTestCase(new Doctrine_Connection_Profiler_TestCase()); - +$db = new GroupTest('Db tests: Db and Profiler'); +$db->addTestCase(new Doctrine_Db_TestCase()); +$db->addTestCase(new Doctrine_Connection_Profiler_TestCase()); +$test->addTestCase($db); // Eventlisteners -$test->addTestCase(new Doctrine_EventListener_TestCase()); -$test->addTestCase(new Doctrine_EventListener_Chain_TestCase()); +$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); +// 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); +// 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); -$test->addTestCase(new Doctrine_Record_Filter_TestCase()); $test->addTestCase(new Doctrine_Schema_TestCase()); -$test->addTestCase(new Doctrine_Query_Condition_TestCase()); - $test->addTestCase(new Doctrine_CustomPrimaryKey_TestCase()); - $test->addTestCase(new Doctrine_CustomResultSetOrder_TestCase()); -// Query tests - -$test->addTestCase(new Doctrine_Query_MultiJoin_TestCase()); - -$test->addTestCase(new Doctrine_Query_MultiJoin2_TestCase()); - -$test->addTestCase(new Doctrine_Query_ReferenceModel_TestCase()); - -$test->addTestCase(new Doctrine_Query_ComponentAlias_TestCase()); - - - -$test->addTestCase(new Doctrine_Query_ShortAliases_TestCase()); - -$test->addTestCase(new Doctrine_Query_Expression_TestCase()); $test->addTestCase(new Doctrine_ColumnAggregationInheritance_TestCase()); $test->addTestCase(new Doctrine_ColumnAlias_TestCase()); -$test->addTestCase(new Doctrine_Query_OneToOneFetching_TestCase()); - - - -$test->addTestCase(new Doctrine_Query_Check_TestCase()); - -$test->addTestCase(new Doctrine_Query_Limit_TestCase()); - - - -//$test->addTestCase(new Doctrine_Query_IdentifierQuoting_TestCase()); -$test->addTestCase(new Doctrine_Query_Update_TestCase()); -$test->addTestCase(new Doctrine_Query_Delete_TestCase()); - -$test->addTestCase(new Doctrine_Query_Join_TestCase()); - -$test->addTestCase(new Doctrine_Record_TestCase()); - -$test->addTestCase(new Doctrine_Query_Having_TestCase()); $test->addTestCase(new Doctrine_RawSql_TestCase()); -$test->addTestCase(new Doctrine_Query_Orderby_TestCase()); - -$test->addTestCase(new Doctrine_Query_Subquery_TestCase()); - -$test->addTestCase(new Doctrine_Query_Driver_TestCase()); - -$test->addTestCase(new Doctrine_Record_Hook_TestCase()); - -$test->addTestCase(new Doctrine_Query_AggregateValue_TestCase()); - - - - $test->addTestCase(new Doctrine_NewCore_TestCase()); -// Record -$test->addTestCase(new Doctrine_Record_State_TestCase()); -$test->addTestCase(new Doctrine_Record_SerializeUnserialize_TestCase()); - -// This test used to segfault php because of infinite recursion in Connection/UnitOfWork -$test->addTestCase(new Doctrine_Record_Lock_TestCase()); - -$test->addTestCase(new Doctrine_Tokenizer_TestCase()); - - -$test->addTestCase(new Doctrine_Collection_Snapshot_TestCase()); - -$test->addTestCase(new Doctrine_Hydrate_FetchMode_TestCase()); - -$test->addTestCase(new Doctrine_Query_Where_TestCase()); - -$test->addTestCase(new Doctrine_Query_From_TestCase()); - -$test->addTestCase(new Doctrine_Query_Select_TestCase()); - -$test->addTestCase(new Doctrine_Query_JoinCondition_TestCase()); - -$test->addTestCase(new Doctrine_Query_MultipleAggregateValue_TestCase()); - -$test->addTestCase(new Doctrine_Query_TestCase()); - -$test->addTestCase(new Doctrine_Query_MysqlSubquery_TestCase()); - -$test->addTestCase(new Doctrine_Query_PgsqlSubquery_TestCase()); - -$test->addTestCase(new Doctrine_Query_MysqlSubqueryHaving_TestCase()); - -$test->addTestCase(new Doctrine_Record_ZeroValues_TestCase()); - -$test->addTestCase(new Doctrine_Query_Cache_TestCase()); - -$test->addTestCase(new Doctrine_Cache_Apc_TestCase()); - -$test->addTestCase(new Doctrine_Query_SelectExpression_TestCase()); $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()); - /** -$test->addTestCase(new Doctrine_Cache_Memcache_TestCase()); +//$test->addTestCase(new Doctrine_Template_TestCase()); -$test->addTestCase(new Doctrine_Cache_Sqlite_TestCase()); +//$test->addTestCase(new Doctrine_Import_Builder_TestCase()); -$test->addTestCase(new Doctrine_Record_SaveBlankRecord_TestCase()); +//$test->addTestCase(new Doctrine_Search_TestCase()); -$test->addTestCase(new Doctrine_Template_TestCase()); - -$test->addTestCase(new Doctrine_Import_Builder_TestCase()); - -$test->addTestCase(new Doctrine_Search_TestCase()); - */ //$test->addTestCase(new Doctrine_IntegrityAction_TestCase()); //$test->addTestCase(new Doctrine_AuditLog_TestCase()); @@ -377,13 +323,16 @@ $test->addTestCase(new Doctrine_Search_TestCase()); $test->addTestCase(new Doctrine_NestedSet_SingleRoot_TestCase()); // Cache tests -//$test->addTestCase(new Doctrine_Cache_Query_SqliteTestCase()); -//$test->addTestCase(new Doctrine_Cache_FileTestCase()); -//$test->addTestCase(new Doctrine_Cache_SqliteTestCase()); -//$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()); +$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); class CliReporter extends HtmlReporter{ @@ -479,9 +428,9 @@ if (isset($options['help'])) { 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"; - echo " -group 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 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\n"; + echo " -group 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 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"; die(); }