From 96baa3015e114e1ac2214647599883eda3a85e20 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Mon, 11 Apr 2011 22:23:44 -0430 Subject: [PATCH] Making all test groups run again, small fixes in some tests to make them pass --- lib/Cake/tests/Case/AllBehaviorsTest.php | 11 ++--- lib/Cake/tests/Case/AllCacheEnginesTest.php | 4 +- lib/Cake/tests/Case/AllComponentsTest.php | 8 ++-- lib/Cake/tests/Case/AllConfigureTest.php | 8 ++-- lib/Cake/tests/Case/AllControllersTest.php | 12 ++--- lib/Cake/tests/Case/AllDatabaseTest.php | 18 ++++---- lib/Cake/tests/Case/AllErrorTest.php | 6 +-- lib/Cake/tests/Case/AllHelpersTest.php | 6 +-- lib/Cake/tests/Case/AllJsHelpersTest.php | 10 ++--- lib/Cake/tests/Case/AllLibsTest.php | 21 +++------ lib/Cake/tests/Case/AllLocalizationTest.php | 6 +-- lib/Cake/tests/Case/AllModelTest.php | 9 ++-- lib/Cake/tests/Case/AllRoutingTest.php | 10 ++--- lib/Cake/tests/Case/AllSocketTest.php | 6 +-- lib/Cake/tests/Case/AllTestSuiteTest.php | 7 +-- lib/Cake/tests/Case/AllTestsTest.php | 45 +++++++++---------- lib/Cake/tests/Case/AllViewsTest.php | 5 +-- lib/Cake/tests/Case/AllXmlTest.php | 4 +- lib/Cake/tests/Case/BasicsTest.php | 6 +-- .../tests/Case/Console/AllConsoleLibsTest.php | 10 +++-- .../tests/Case/Console/AllConsoleTest.php | 8 ++-- lib/Cake/tests/Case/Console/AllShellsTest.php | 2 +- lib/Cake/tests/Case/Console/AllTasksTest.php | 2 +- .../Component/Auth/BasicAuthenticateTest.php | 2 +- .../Component/Auth/DigestAuthenticateTest.php | 2 +- .../Component/Auth/FormAuthenticate.php | 2 +- .../Component/EmailComponentTest.php | 2 +- .../tests/Case/TestSuite/CakeTestCaseTest.php | 4 +- .../Case/TestSuite/ControllerTestCaseTest.php | 2 +- lib/Cake/tests/Case/Utility/FileTest.php | 4 +- lib/Cake/tests/Case/Utility/XmlTest.php | 10 ++--- 31 files changed, 113 insertions(+), 139 deletions(-) diff --git a/lib/Cake/tests/Case/AllBehaviorsTest.php b/lib/Cake/tests/Case/AllBehaviorsTest.php index 88720d386..a388d1ccc 100644 --- a/lib/Cake/tests/Case/AllBehaviorsTest.php +++ b/lib/Cake/tests/Case/AllBehaviorsTest.php @@ -31,15 +31,12 @@ class AllBehaviorsTest extends PHPUnit_Framework_TestSuite { * @return void */ public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('Model Behavior and all behaviors'); + $suite = new CakeTestSuite('Model Behavior and all behaviors'); - $path = CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'behaviors' . DS; - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'behavior_collection.test.php'); + $path = CORE_TEST_CASES . DS . 'Model' . DS . 'Behavior' . DS; + $suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'BehaviorCollectionTest.php'); - $suite->addTestFile($path . 'acl.test.php'); - $suite->addTestFile($path . 'containable.test.php'); - $suite->addTestFile($path . 'translate.test.php'); - $suite->addTestFile($path . 'tree.test.php'); + $suite->addTestDirectory($path); return $suite; } } diff --git a/lib/Cake/tests/Case/AllCacheEnginesTest.php b/lib/Cake/tests/Case/AllCacheEnginesTest.php index 5c03437cd..29cf33a19 100644 --- a/lib/Cake/tests/Case/AllCacheEnginesTest.php +++ b/lib/Cake/tests/Case/AllCacheEnginesTest.php @@ -33,9 +33,7 @@ class AllCacheEnginesTest extends PHPUnit_Framework_TestSuite { */ public static function suite() { $suite = new CakeTestSuite('All Cache related class tests'); - - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cache.test.php'); - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'cache'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Cache'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllComponentsTest.php b/lib/Cake/tests/Case/AllComponentsTest.php index 480c93219..f9d7358eb 100644 --- a/lib/Cake/tests/Case/AllComponentsTest.php +++ b/lib/Cake/tests/Case/AllComponentsTest.php @@ -34,10 +34,10 @@ class AllComponentsTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All component class tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'component.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'component_collection.test.php'); - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components'); - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components' . DS . 'auth'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Controller' . DS . 'ComponentTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Controller' . DS . 'ComponentCollectionTest.php'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Controller' . DS . 'Component'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Controller' . DS . 'Component' . DS . 'Auth'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllConfigureTest.php b/lib/Cake/tests/Case/AllConfigureTest.php index 6e35aef74..22c6f216e 100644 --- a/lib/Cake/tests/Case/AllConfigureTest.php +++ b/lib/Cake/tests/Case/AllConfigureTest.php @@ -32,12 +32,10 @@ class AllConfigureTest extends PHPUnit_Framework_TestSuite { * @return void */ public static function suite() { - $suite = new CakeTestSuite('All Configure, App and ClassRegistry related tests'); + $suite = new CakeTestSuite('All Configure and Core related tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'configure.test.php'); - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'config'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'app.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'class_registry.test.php'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Core'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Configure'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllControllersTest.php b/lib/Cake/tests/Case/AllControllersTest.php index 8164896d9..71f2bec62 100644 --- a/lib/Cake/tests/Case/AllControllersTest.php +++ b/lib/Cake/tests/Case/AllControllersTest.php @@ -32,13 +32,13 @@ class AllControllersTest extends PHPUnit_Framework_TestSuite { * @return void */ public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('All Controller related class tests'); + $suite = new CakeTestSuite('All Controller related class tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'controller.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'scaffold.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'pages_controller.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'component.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'controller_merge_vars.test.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Controller' . DS . 'ControllerTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Controller' . DS . 'ScaffoldTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Controller' . DS . 'PagesControllerTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Controller' . DS . 'ComponentTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Controller' . DS . 'ControllerMergeVarsTest.php'); return $suite; } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/AllDatabaseTest.php b/lib/Cake/tests/Case/AllDatabaseTest.php index 21cef27b6..d4f0ba82f 100644 --- a/lib/Cake/tests/Case/AllDatabaseTest.php +++ b/lib/Cake/tests/Case/AllDatabaseTest.php @@ -34,18 +34,18 @@ class AllDatabaseTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new PHPUnit_Framework_TestSuite('Datasources, Schema and DbAcl tests'); - $path = CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS; + $path = CORE_TEST_CASES . DS . 'Model' . DS; $tasks = array( - 'db_acl', - 'cake_schema', - 'connection_manager', - 'datasources' . DS . 'dbo_source', - 'datasources' . DS . 'dbo' . DS . 'dbo_mysql', - 'datasources' . DS . 'dbo' . DS . 'dbo_postgres', - 'datasources' . DS . 'dbo' . DS . 'dbo_sqlite' + 'DbAcl', + 'CakeSchema', + 'ConnectionManager', + 'Datasource' . DS . 'DboSource', + 'Datasource' . DS . 'Database' . DS . 'MySql', + 'Datasource' . DS . 'Database' . DS . 'Postgres', + 'Datasource' . DS . 'Database' . DS . 'Sqlite' ); foreach ($tasks as $task) { - $suite->addTestFile($path . $task . '.test.php'); + $suite->addTestFile($path . $task . 'Test.php'); } return $suite; } diff --git a/lib/Cake/tests/Case/AllErrorTest.php b/lib/Cake/tests/Case/AllErrorTest.php index b64c87542..4d18079d1 100644 --- a/lib/Cake/tests/Case/AllErrorTest.php +++ b/lib/Cake/tests/Case/AllErrorTest.php @@ -34,10 +34,10 @@ class AllErrorTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new PHPUnit_Framework_TestSuite('All Error handling tests'); - $libs = CORE_TEST_CASES . DS . 'libs' . DS; + $libs = CORE_TEST_CASES . DS; - $suite->addTestFile($libs . 'error' . DS . 'error_handler.test.php'); - $suite->addTestFile($libs . 'error' . DS . 'exception_renderer.test.php'); + $suite->addTestFile($libs . 'Error' . DS . 'ErrorHandlerTest.php'); + $suite->addTestFile($libs . 'Error' . DS . 'ExceptionRendererTest.php'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllHelpersTest.php b/lib/Cake/tests/Case/AllHelpersTest.php index 247a10deb..460fce9ee 100644 --- a/lib/Cake/tests/Case/AllHelpersTest.php +++ b/lib/Cake/tests/Case/AllHelpersTest.php @@ -35,9 +35,9 @@ class AllHelpersTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All Helper tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helper.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helper_collection.test.php'); - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS); + $suite->addTestFile(CORE_TEST_CASES . DS . 'View' . DS . 'HelperTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'View' . DS . 'HelperCollectionTest.php'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'View' . DS . 'Helper' . DS); return $suite; } } diff --git a/lib/Cake/tests/Case/AllJsHelpersTest.php b/lib/Cake/tests/Case/AllJsHelpersTest.php index 9dd0ab750..820291bbb 100644 --- a/lib/Cake/tests/Case/AllJsHelpersTest.php +++ b/lib/Cake/tests/Case/AllJsHelpersTest.php @@ -34,11 +34,11 @@ class AllJavascriptHelpersTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new PHPUnit_Framework_TestSuite('Js Helper and all Engine Helpers'); - $helperTestPath = CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS; - $suite->addTestFile($helperTestPath . 'js.test.php'); - $suite->addTestFile($helperTestPath . 'jquery_engine.test.php'); - $suite->addTestFile($helperTestPath . 'mootools_engine.test.php'); - $suite->addTestFile($helperTestPath . 'prototype_engine.test.php'); + $helperTestPath = CORE_TEST_CASES . DS . 'View' . DS . 'Helper' . DS; + $suite->addTestFile($helperTestPath . 'JsHelperTest.php'); + $suite->addTestFile($helperTestPath . 'JqueryEngineHelperTest.php'); + $suite->addTestFile($helperTestPath . 'MootoolsEngineHelperTest.php'); + $suite->addTestFile($helperTestPath . 'PrototypeEngineHelperTest.php'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllLibsTest.php b/lib/Cake/tests/Case/AllLibsTest.php index ba0388850..73a331385 100644 --- a/lib/Cake/tests/Case/AllLibsTest.php +++ b/lib/Cake/tests/Case/AllLibsTest.php @@ -32,22 +32,13 @@ class AllLibsTest extends PHPUnit_Framework_TestSuite { * @return void */ public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('All non-MVC lib class tests'); + $suite = new CakeTestSuite('All non-MVC lib class tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'basics.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cake_session.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'debugger.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'file.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'folder.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'inflector.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'log' . DS . 'file_log.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cake_log.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'class_registry.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'sanitize.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'set.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'string.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'validation.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'object_collection.test.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'BasicsTest.php'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Utility'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Log'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'Datasource' . DS . 'CakeSessionTest.php'); + //$suite->addTestDirectory(CORE_TEST_CASES . DS . 'Model' . DS . 'Datasource' . DS . 'Session'); return $suite; } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/AllLocalizationTest.php b/lib/Cake/tests/Case/AllLocalizationTest.php index d30ab86b0..47bfe6a79 100644 --- a/lib/Cake/tests/Case/AllLocalizationTest.php +++ b/lib/Cake/tests/Case/AllLocalizationTest.php @@ -32,11 +32,9 @@ class AllLocalizationTest extends PHPUnit_Framework_TestSuite { * @return void */ public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('All localization class tests'); + $suite = new CakeTestSuite('All localization class tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'i18n.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'l10n.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'multibyte.test.php'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'I18n'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllModelTest.php b/lib/Cake/tests/Case/AllModelTest.php index bf968b0c3..e9c9f8184 100644 --- a/lib/Cake/tests/Case/AllModelTest.php +++ b/lib/Cake/tests/Case/AllModelTest.php @@ -34,11 +34,10 @@ class AllModelTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new PHPUnit_Framework_TestSuite('All Model related class tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'behavior_collection.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'model_read.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'model_write.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'model_validation.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'model_integration.test.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'ModelReadTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'ModelWriteTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'ModelValidationTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Model' . DS . 'ModelIntegrationTest.php'); return $suite; } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/AllRoutingTest.php b/lib/Cake/tests/Case/AllRoutingTest.php index 68f0520f9..a8e7f0707 100644 --- a/lib/Cake/tests/Case/AllRoutingTest.php +++ b/lib/Cake/tests/Case/AllRoutingTest.php @@ -34,13 +34,11 @@ class AllRoutingTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All Router and Dispatcher class tests'); - $libs = CORE_TEST_CASES . DS . 'libs' . DS; + $libs = CORE_TEST_CASES . DS; - $suite->addTestFile($libs . 'dispatcher.test.php'); - $suite->addTestFile($libs . 'router.test.php'); - $suite->addTestDirectory($libs . 'route' . DS); - $suite->addTestFile($libs . 'cake_response.test.php'); - $suite->addTestFile($libs . 'cake_request.test.php'); + $suite->addTestDirectory($libs . 'Routing'); + $suite->addTestFile($libs . 'Network' . DS . 'CakeResponseTest.php'); + $suite->addTestFile($libs . 'Network' . DS . 'CakeRequestTest.php'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllSocketTest.php b/lib/Cake/tests/Case/AllSocketTest.php index 811822f9e..522a129b2 100644 --- a/lib/Cake/tests/Case/AllSocketTest.php +++ b/lib/Cake/tests/Case/AllSocketTest.php @@ -34,10 +34,8 @@ class AllSocketTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All Socket related class tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cake_socket.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'http_socket.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'http_response.test.php'); - $suite->addTestDirectory(CORE_TEST_CASES . DS . 'libs' . DS . 'http'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Network' . DS . 'CakeSocketTest.php'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'Network' . DS . 'Http'); return $suite; } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/AllTestSuiteTest.php b/lib/Cake/tests/Case/AllTestSuiteTest.php index 6740003b7..9ce3e2aa6 100644 --- a/lib/Cake/tests/Case/AllTestSuiteTest.php +++ b/lib/Cake/tests/Case/AllTestSuiteTest.php @@ -32,12 +32,9 @@ class AllTestSuiteTest extends PHPUnit_Framework_TestSuite { * @return void */ public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('All Test Suite classes tests'); + $suite = new CakeTestSuite('All Test Suite classes tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cake_test_case.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'cake_test_fixture.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'html_coverage_report.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'controller_test_case.test.php'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'TestSuite'); return $suite; } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/AllTestsTest.php b/lib/Cake/tests/Case/AllTestsTest.php index f7bdc72d3..a663781b9 100644 --- a/lib/Cake/tests/Case/AllTestsTest.php +++ b/lib/Cake/tests/Case/AllTestsTest.php @@ -12,7 +12,7 @@ * * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project - * @package cake.tests.cases + * @package cakeTests.cases * @since CakePHP(tm) v 2.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -21,7 +21,7 @@ * * This test group will run all test in the cases/libs/models/behaviors directory * - * @package cake.tests.groups + * @package cakeTests.groups */ class AllTests extends PHPUnit_Framework_TestSuite { @@ -33,29 +33,26 @@ class AllTests extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new PHPUnit_Framework_TestSuite('All Tests'); - $path = CORE_TEST_CASES . DS . 'libs' . DS; - $console = CORE_TEST_CASES . DS . 'console' . DS; + $path = CORE_TEST_CASES . DS; + $console = $path . 'Console' . DS; - $suite->addTestFile($console . 'all_console_libs.test.php'); - $suite->addTestFile($console . 'all_shells.test.php'); - $suite->addTestFile($console . 'all_tasks.test.php'); - - $suite->addTestFile($path . 'all_behaviors.test.php'); - $suite->addTestFile($path . 'all_cache_engines.test.php'); - $suite->addTestFile($path . 'all_components.test.php'); - $suite->addTestFile($path . 'all_configure.test.php'); - $suite->addTestFile($path . 'all_controllers.test.php'); - $suite->addTestFile($path . 'all_database.test.php'); - $suite->addTestFile($path . 'all_error.test.php'); - $suite->addTestFile($path . 'all_helpers.test.php'); - $suite->addTestFile($path . 'all_libs.test.php'); - $suite->addTestFile($path . 'all_localization.test.php'); - $suite->addTestFile($path . 'all_model.test.php'); - $suite->addTestFile($path . 'all_routing.test.php'); - $suite->addTestFile($path . 'all_socket.test.php'); - $suite->addTestFile($path . 'all_test_suite.test.php');; - $suite->addTestFile($path . 'all_views.test.php'); - $suite->addTestFile($path . 'all_xml.test.php'); + $suite->addTestFile($console . 'AllConsoleTest.php'); + $suite->addTestFile($path . 'AllBehaviorsTest.php'); + $suite->addTestFile($path . 'AllCacheEnginesTest.php'); + $suite->addTestFile($path . 'AllComponentsTest.php'); + $suite->addTestFile($path . 'AllConfigureTest.php'); + $suite->addTestFile($path . 'AllControllersTest.php'); + $suite->addTestFile($path . 'AllDatabaseTest.php'); + $suite->addTestFile($path . 'AllErrorTest.php'); + $suite->addTestFile($path . 'AllHelpersTest.php'); + $suite->addTestFile($path . 'AllLibsTest.php'); + $suite->addTestFile($path . 'AllLocalizationTest.php'); + $suite->addTestFile($path . 'AllModelTest.php'); + $suite->addTestFile($path . 'AllRoutingTest.php'); + $suite->addTestFile($path . 'AllSocketTest.php'); + $suite->addTestFile($path . 'AllTestSuiteTest.php');; + $suite->addTestFile($path . 'AllViewsTest.php'); + $suite->addTestFile($path . 'AllXmlTest.php'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllViewsTest.php b/lib/Cake/tests/Case/AllViewsTest.php index 0201426e4..46a094625 100644 --- a/lib/Cake/tests/Case/AllViewsTest.php +++ b/lib/Cake/tests/Case/AllViewsTest.php @@ -32,10 +32,9 @@ class AllViewsTest extends PHPUnit_Framework_TestSuite { * @return void */ public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('All View class tests'); + $suite = new CakeTestSuite('All View class tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'view.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'theme.test.php'); + $suite->addTestDirectory(CORE_TEST_CASES . DS . 'View'); return $suite; } } diff --git a/lib/Cake/tests/Case/AllXmlTest.php b/lib/Cake/tests/Case/AllXmlTest.php index e56714ab0..69f7a0986 100644 --- a/lib/Cake/tests/Case/AllXmlTest.php +++ b/lib/Cake/tests/Case/AllXmlTest.php @@ -34,8 +34,8 @@ class AllXmlTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new PHPUnit_Framework_TestSuite('All Xml related class tests'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'xml.test.php'); - $suite->addTestFile(CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS . 'rss.test.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'Utility' . DS . 'XmlTest.php'); + $suite->addTestFile(CORE_TEST_CASES . DS . 'View' . DS . 'Helper' . DS . 'RssHelperTest.php'); return $suite; } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/BasicsTest.php b/lib/Cake/tests/Case/BasicsTest.php index 4de7ac0ce..48da9c85b 100644 --- a/lib/Cake/tests/Case/BasicsTest.php +++ b/lib/Cake/tests/Case/BasicsTest.php @@ -678,7 +678,7 @@ class BasicsTest extends CakeTestCase { ob_start(); debug('this-is-a-test'); $result = ob_get_clean(); - $pattern = '/(.+?tests(\/|\\\)cases(\/|\\\)basics\.test\.php|'; + $pattern = '/(.+?tests(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s'; $this->assertPattern($pattern, $result); @@ -686,7 +686,7 @@ class BasicsTest extends CakeTestCase { ob_start(); debug('
this-is-a-test
', true); $result = ob_get_clean(); - $pattern = '/(.+?tests(\/|\\\)cases(\/|\\\)basics\.test\.php|'; + $pattern = '/(.+?tests(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*<div>this-is-a-test<\/div>.*/s'; $this->assertPattern($pattern, $result); @@ -694,7 +694,7 @@ class BasicsTest extends CakeTestCase { ob_start(); debug('
this-is-a-test
', false); $result = ob_get_clean(); - $pattern = '/(.+?tests(\/|\\\)cases(\/|\\\)basics\.test\.php|'; + $pattern = '/(.+?tests(\/|\\\)Case(\/|\\\)BasicsTest\.php|'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')'; $pattern .= '.*line.*' . (__LINE__ - 4) . '.*\this-is-a-test\<\/div\>.*/s'; $this->assertPattern($pattern, $result); diff --git a/lib/Cake/tests/Case/Console/AllConsoleLibsTest.php b/lib/Cake/tests/Case/Console/AllConsoleLibsTest.php index ad1f60fbd..708482c7a 100644 --- a/lib/Cake/tests/Case/Console/AllConsoleLibsTest.php +++ b/lib/Cake/tests/Case/Console/AllConsoleLibsTest.php @@ -34,9 +34,13 @@ class AllConsoleLibsTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All console lib classes'); - $path = CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS; - - $suite->addTestDirectory($path); + $path = CORE_TEST_CASES . DS . 'Console'; + foreach (new DirectoryIterator(dirname(__FILE__)) as $file) { + if (!$file->isFile() || strpos($file, 'All') === 0) { + continue; + } + $suite->addTestFile($file->getRealPath()); + } return $suite; } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/Console/AllConsoleTest.php b/lib/Cake/tests/Case/Console/AllConsoleTest.php index 305ebbfc3..a83159d4f 100644 --- a/lib/Cake/tests/Case/Console/AllConsoleTest.php +++ b/lib/Cake/tests/Case/Console/AllConsoleTest.php @@ -34,11 +34,11 @@ class AllConsoleTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All console classes'); - $path = CORE_TEST_CASES . DS . 'console' . DS; + $path = CORE_TEST_CASES . DS . 'Console' . DS; - $suite->addTestFile($path . 'all_console_libs.test.php'); - $suite->addTestFile($path . 'all_shells.test.php'); - $suite->addTestFile($path . 'all_tasks.test.php'); + $suite->addTestFile($path . 'AllConsoleLibsTest.php'); + $suite->addTestFile($path . 'AllTasksTest.php'); + $suite->addTestFile($path . 'AllShellsTest.php'); return $suite; } } \ No newline at end of file diff --git a/lib/Cake/tests/Case/Console/AllShellsTest.php b/lib/Cake/tests/Case/Console/AllShellsTest.php index e8ca96ac5..3288c53ff 100644 --- a/lib/Cake/tests/Case/Console/AllShellsTest.php +++ b/lib/Cake/tests/Case/Console/AllShellsTest.php @@ -34,7 +34,7 @@ class AllShellsTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All shell classes'); - $path = CORE_TEST_CASES . DS . 'console' . DS . 'shells' . DS; + $path = CORE_TEST_CASES . DS . 'Console' . DS . 'Command' . DS; $suite->addTestDirectory($path); return $suite; diff --git a/lib/Cake/tests/Case/Console/AllTasksTest.php b/lib/Cake/tests/Case/Console/AllTasksTest.php index 91ca6abdc..5e15c276d 100644 --- a/lib/Cake/tests/Case/Console/AllTasksTest.php +++ b/lib/Cake/tests/Case/Console/AllTasksTest.php @@ -34,7 +34,7 @@ class AllTasksTest extends PHPUnit_Framework_TestSuite { public static function suite() { $suite = new CakeTestSuite('All Tasks tests'); - $path = CORE_TEST_CASES . DS . 'console' . DS . 'shells' . DS . 'tasks' . DS; + $path = CORE_TEST_CASES . DS . 'Console' . DS . 'Command' . DS . 'Task' . DS; $suite->addTestDirectory($path); return $suite; } diff --git a/lib/Cake/tests/Case/Controller/Component/Auth/BasicAuthenticateTest.php b/lib/Cake/tests/Case/Controller/Component/Auth/BasicAuthenticateTest.php index 6e0c9df57..b43c50c22 100644 --- a/lib/Cake/tests/Case/Controller/Component/Auth/BasicAuthenticateTest.php +++ b/lib/Cake/tests/Case/Controller/Component/Auth/BasicAuthenticateTest.php @@ -21,7 +21,7 @@ App::uses('CakeRequest', 'Network'); App::uses('CakeResponse', 'Network'); -require_once CAKE_TESTS . 'cases' . DS . 'libs' . DS . 'model' . DS . 'models.php'; +require_once CAKE_TESTS . 'Case' . DS . 'Model' . DS . 'models.php'; /** * Test case for BasicAuthentication diff --git a/lib/Cake/tests/Case/Controller/Component/Auth/DigestAuthenticateTest.php b/lib/Cake/tests/Case/Controller/Component/Auth/DigestAuthenticateTest.php index 829d5bda6..72047c5e8 100644 --- a/lib/Cake/tests/Case/Controller/Component/Auth/DigestAuthenticateTest.php +++ b/lib/Cake/tests/Case/Controller/Component/Auth/DigestAuthenticateTest.php @@ -19,7 +19,7 @@ App::uses('AppModel', 'Model'); App::uses('CakeRequest', 'Network'); App::uses('CakeResponse', 'Network'); -require_once CAKE_TESTS . 'cases' . DS . 'libs' . DS . 'model' . DS . 'models.php'; +require_once CAKE_TESTS . 'Case' . DS . 'Model' . DS . 'models.php'; /** * Test case for DigestAuthentication diff --git a/lib/Cake/tests/Case/Controller/Component/Auth/FormAuthenticate.php b/lib/Cake/tests/Case/Controller/Component/Auth/FormAuthenticate.php index cc0e22bd1..e11150611 100644 --- a/lib/Cake/tests/Case/Controller/Component/Auth/FormAuthenticate.php +++ b/lib/Cake/tests/Case/Controller/Component/Auth/FormAuthenticate.php @@ -20,7 +20,7 @@ App::uses('AppModel', 'Model'); App::uses('CakeRequest', 'Network'); App::uses('CakeResponse', 'Network'); -require_once CAKE_TESTS . 'cases' . DS . 'libs' . DS . 'model' . DS . 'models.php'; +require_once CAKE_TESTS . 'Case' . DS . 'Model' . DS . 'models.php'; /** * Test case for FormAuthentication diff --git a/lib/Cake/tests/Case/Controller/Component/EmailComponentTest.php b/lib/Cake/tests/Case/Controller/Component/EmailComponentTest.php index 1bf37d5d4..949daf8c2 100644 --- a/lib/Cake/tests/Case/Controller/Component/EmailComponentTest.php +++ b/lib/Cake/tests/Case/Controller/Component/EmailComponentTest.php @@ -1058,7 +1058,7 @@ HTMLBLOC; $this->Controller->EmailTest->sendAs = 'text'; $this->assertTrue($this->Controller->EmailTest->send($body)); $msg = $this->Controller->Session->read('Message.email.message'); - $this->assertPattern('/' . preg_quote('Content-Disposition: attachment; filename="email.test.php"') . '/', $msg); + $this->assertPattern('/' . preg_quote('Content-Disposition: attachment; filename="EmailComponentTest.php"') . '/', $msg); $this->assertPattern('/' . preg_quote('Content-Disposition: attachment; filename="some-name.php"') . '/', $msg); } diff --git a/lib/Cake/tests/Case/TestSuite/CakeTestCaseTest.php b/lib/Cake/tests/Case/TestSuite/CakeTestCaseTest.php index 589c72bf4..72743e3a9 100644 --- a/lib/Cake/tests/Case/TestSuite/CakeTestCaseTest.php +++ b/lib/Cake/tests/Case/TestSuite/CakeTestCaseTest.php @@ -36,8 +36,8 @@ if (!class_exists('AppController', false)) { class CakeTestCaseTest extends CakeTestCase { public static function setUpBeforeClass() { - require_once LIBS . 'tests' . DS . 'fixtures' . DS . 'assert_tags_test_case.php'; - require_once LIBS . 'tests' . DS . 'fixtures' . DS . 'fixturized_test_case.php'; + require_once LIBS . 'tests' . DS . 'Fixture' . DS . 'AssertTagsTestCase.php'; + require_once LIBS . 'tests' . DS . 'Fixture' . DS . 'FixturizedTestCase.php'; } /** diff --git a/lib/Cake/tests/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/tests/Case/TestSuite/ControllerTestCaseTest.php index aaf6f00f9..1bf23d8d3 100644 --- a/lib/Cake/tests/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/tests/Case/TestSuite/ControllerTestCaseTest.php @@ -24,7 +24,7 @@ App::uses('Model', 'Model'); App::uses('AppModel', 'Model'); App::uses('CakeHtmlReporter', 'TestSuite/Reporter'); -require_once dirname(__FILE__) . DS . 'model' . DS . 'models.php'; +require_once dirname(dirname(__FILE__)) . DS . 'Model' . DS . 'models.php'; /** diff --git a/lib/Cake/tests/Case/Utility/FileTest.php b/lib/Cake/tests/Case/Utility/FileTest.php index d2d6fabee..5059816f3 100644 --- a/lib/Cake/tests/Case/Utility/FileTest.php +++ b/lib/Cake/tests/Case/Utility/FileTest.php @@ -75,7 +75,7 @@ class FileTest extends CakeTestCase { $result = $this->File->info(); $expecting = array( 'dirname' => dirname(__FILE__), 'basename' => basename(__FILE__), - 'extension' => 'php', 'filename' =>'file.test' + 'extension' => 'php', 'filename' =>'FileTest' ); $this->assertEqual($result, $expecting); @@ -84,7 +84,7 @@ class FileTest extends CakeTestCase { $this->assertEqual($result, $expecting); $result = $this->File->name(); - $expecting = 'file.test'; + $expecting = 'FileTest'; $this->assertEqual($result, $expecting); $result = $this->File->md5(); diff --git a/lib/Cake/tests/Case/Utility/XmlTest.php b/lib/Cake/tests/Case/Utility/XmlTest.php index deda75584..ccc71f07e 100644 --- a/lib/Cake/tests/Case/Utility/XmlTest.php +++ b/lib/Cake/tests/Case/Utility/XmlTest.php @@ -133,7 +133,7 @@ class XmlTest extends CakeTestCase { $this->assertEqual($obj->firstChild->nodeName, 'tag'); $this->assertEqual($obj->firstChild->nodeValue, 'value'); - $xml = LIBS . 'tests' . DS . 'fixtures' . DS . 'sample.xml'; + $xml = LIBS . 'tests' . DS . 'Fixture' . DS . 'sample.xml'; $obj = Xml::build($xml); $this->assertEqual($obj->getName(), 'tags'); $this->assertEqual(count($obj), 2); @@ -374,7 +374,7 @@ class XmlTest extends CakeTestCase { $obj = Xml::build($xml); $this->assertEqual(Xml::toArray($obj), array('tag' => 'name')); - $xml = LIBS . 'tests' . DS . 'fixtures' . DS . 'sample.xml'; + $xml = LIBS . 'tests' . DS . 'Fixture' . DS . 'sample.xml'; $obj = Xml::build($xml); $expected = array( 'tags' => array( @@ -516,7 +516,7 @@ class XmlTest extends CakeTestCase { * @return void */ public function testRss() { - $rss = file_get_contents(LIBS . 'tests' . DS . 'fixtures' . DS . 'rss.xml'); + $rss = file_get_contents(LIBS . 'tests' . DS . 'Fixture' . DS . 'rss.xml'); $rssAsArray = Xml::toArray(Xml::build($rss)); $this->assertEqual($rssAsArray['rss']['@version'], '2.0'); $this->assertEqual(count($rssAsArray['rss']['channel']['item']), 2); @@ -647,7 +647,7 @@ class XmlTest extends CakeTestCase { * @return void */ public function testSoap() { - $xmlRequest = Xml::build(LIBS . 'tests' . DS . 'fixtures' . DS . 'soap_request.xml'); + $xmlRequest = Xml::build(LIBS . 'tests' . DS . 'Fixture' . DS . 'soap_request.xml'); $expected = array( 'Envelope' => array( '@soap:encodingStyle' => 'http://www.w3.org/2001/12/soap-encoding', @@ -660,7 +660,7 @@ class XmlTest extends CakeTestCase { ); $this->assertEqual(Xml::toArray($xmlRequest), $expected); - $xmlResponse = Xml::build(LIBS . 'tests' . DS . 'fixtures' . DS . 'soap_response.xml'); + $xmlResponse = Xml::build(LIBS . 'tests' . DS . 'Fixture' . DS . 'soap_response.xml'); $expected = array( 'Envelope' => array( '@soap:encodingStyle' => 'http://www.w3.org/2001/12/soap-encoding',