Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating tests to not affect other ones when run from a group

Adding NoCrossContamination group
Shortening group class names
Renaming lib_controller group
Updating test imports to include the core AppController by default
Some cosmetics




git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8123 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit fd7d6718a18a9480b8f82593fd719a580231c22c 1 parent fc7773f
@davidpersson davidpersson authored
Showing with 536 additions and 239 deletions.
  1. +13 −1 cake/tests/cases/basics.test.php
  2. +5 −6 cake/tests/cases/console/cake.test.php
  3. +4 −1 cake/tests/cases/console/libs/shell.test.php
  4. +29 −6 cake/tests/cases/dispatcher.test.php
  5. +5 −2 cake/tests/cases/libs/cache/apc.test.php
  6. +10 −7 cake/tests/cases/libs/cache/file.test.php
  7. +8 −4 cake/tests/cases/libs/cache/memcache.test.php
  8. +5 −2 cake/tests/cases/libs/cache/xcache.test.php
  9. +6 −1 cake/tests/cases/libs/cake_test_case.test.php
  10. +1 −1  cake/tests/cases/libs/code_coverage_manager.test.php
  11. +5 −3 cake/tests/cases/libs/configure.test.php
  12. +20 −5 cake/tests/cases/libs/controller/component.test.php
  13. +1 −1  cake/tests/cases/libs/controller/components/acl.test.php
  14. +21 −6 cake/tests/cases/libs/controller/components/auth.test.php
  15. +21 −4 cake/tests/cases/libs/controller/components/email.test.php
  16. +2 −2 cake/tests/cases/libs/controller/components/security.test.php
  17. +20 −0 cake/tests/cases/libs/controller/components/session.test.php
  18. +4 −2 cake/tests/cases/libs/controller/controller.test.php
  19. +28 −1 cake/tests/cases/libs/controller/pages_controller.test.php
  20. +2 −3 cake/tests/cases/libs/debugger.test.php
  21. +46 −42 cake/tests/cases/libs/error.test.php
  22. +1 −1  cake/tests/cases/libs/file.test.php
  23. +2 −2 cake/tests/cases/libs/flay.test.php
  24. +1 −1  cake/tests/cases/libs/folder.test.php
  25. +10 −0 cake/tests/cases/libs/i18n.test.php
  26. +4 −10 cake/tests/cases/libs/inflector.test.php
  27. +1 −2  cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php
  28. +1 −2  cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php
  29. +1 −1  cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
  30. +1 −1  cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php
  31. +1 −3 cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php
  32. +1 −1  cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
  33. +1 −1  cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
  34. +12 −11 cake/tests/cases/libs/model/model.test.php
  35. +3 −3 cake/tests/cases/libs/model/models.php
  36. +1 −1  cake/tests/cases/libs/overloadable.test.php
  37. +5 −0 cake/tests/cases/libs/security.test.php
  38. +10 −0 cake/tests/cases/libs/validation.test.php
  39. +3 −1 cake/tests/cases/libs/view/helpers/html.test.php
  40. +1 −1  cake/tests/cases/libs/view/helpers/js.test.php
  41. +5 −5 cake/tests/groups/cache.group.php
  42. +5 −5 cake/tests/groups/components.group.php
  43. +4 −4 cake/tests/groups/console.group.php
  44. +4 −4 cake/tests/groups/{lib_controller.group.php → controller.group.php}
  45. +5 −5 cake/tests/groups/helpers.group.php
  46. +5 −5 cake/tests/groups/lib.group.php
  47. +71 −0 cake/tests/groups/no_cross_contamination.group.php
  48. +5 −5 cake/tests/groups/no_database.group.php
  49. +5 −5 cake/tests/groups/view.group.php
  50. +1 −1  cake/tests/groups/xml.group.php
  51. +110 −58 cake/tests/lib/cake_test_case.php
View
14 cake/tests/cases/basics.test.php
@@ -40,7 +40,19 @@ class BasicsTest extends CakeTestCase {
* @return void
*/
function setUp() {
+ $this->_localePaths = Configure::read('localePaths');
Configure::write('localePaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale'));
+ $this->_language = Configure::read('Config.language');
+ }
+/**
+ * tearDown method
+ *
+ * @access public
+ * @return void
+ */
+ function tearDown() {
+ Configure::write('localePaths', $this->_localePaths);
+ Configure::write('Config.language', $this->_language);
}
/**
* testHttpBase method
@@ -119,7 +131,7 @@ function testEnv() {
* @return void
*/
function testUses() {
- $this->skipIf(class_exists('Security') || class_exists('Sanitize'), 'Security and/or Sanitize class already loaded');
+ $this->skipIf(class_exists('Security') || class_exists('Sanitize'), '%s Security and/or Sanitize class already loaded');
$this->assertFalse(class_exists('Security'));
$this->assertFalse(class_exists('Sanitize'));
View
11 cake/tests/cases/console/cake.test.php
@@ -123,10 +123,9 @@ class ShellDispatcherTest extends UnitTestCase {
* @return void
*/
function setUp() {
- if (!isset($this->pluginPaths)) {
- $this->pluginPaths = Configure::read('pluginPaths');
- $this->shellPaths = Configure::read('shellPaths');
- }
+ $this->_pluginPaths = Configure::read('pluginPaths');
+ $this->_shellPaths = Configure::read('shellPaths');
+
Configure::write('pluginPaths', array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
));
@@ -142,8 +141,8 @@ function setUp() {
* @return void
*/
function tearDown() {
- Configure::write('pluginPaths', $this->pluginPaths);
- Configure::write('shellPaths', $this->shellPaths);
+ Configure::write('pluginPaths', $this->_pluginPaths);
+ Configure::write('shellPaths', $this->_shellPaths);
}
/**
* testParseParams method
View
5 cake/tests/cases/console/libs/shell.test.php
@@ -78,7 +78,10 @@ class ShellTest extends CakeTestCase {
* @var array
* @access public
*/
- var $fixtures = array('core.post', 'core.comment');
+ var $fixtures = array(
+ 'core.post', 'core.comment', 'core.article', 'core.user',
+ 'core.tag', 'core.articles_tag', 'core.attachment'
+ );
/**
* setUp method
*
View
35 cake/tests/cases/dispatcher.test.php
@@ -24,8 +24,13 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-require_once CAKE.'dispatcher.php';
-App::import('Core', 'AppController');
+require_once CAKE . 'dispatcher.php';
+
+if (!class_exists('AppController')) {
+ require_once LIBS . 'controller' . DS . 'app_controller.php';
+} elseif (!defined('APP_CONTROLLER_EXISTS')){
+ define('APP_CONTROLLER_EXISTS', true);
+}
/**
* TestDispatcher class
*
@@ -491,11 +496,23 @@ class DispatcherTest extends CakeTestCase {
function setUp() {
$this->_get = $_GET;
$_GET = array();
+ $this->_post = $_POST;
+ $this->_files = $_FILES;
+ $this->_server = $_SERVER;
+
+ $this->_app = Configure::read('App');
Configure::write('App.base', false);
Configure::write('App.baseUrl', false);
Configure::write('App.dir', 'app');
Configure::write('App.webroot', 'webroot');
+
+ $this->_cache = Configure::read('Cache');
Configure::write('Cache.disable', true);
+
+ $this->_vendorPaths = Configure::read('vendorPaths');
+ $this->_pluginPaths = Configure::read('pluginPaths');
+ $this->_viewPaths = Configure::read('viewPaths');
+ $this->_debug = Configure::read('debug');
}
/**
* tearDown method
@@ -505,6 +522,15 @@ function setUp() {
*/
function tearDown() {
$_GET = $this->_get;
+ $_POST = $this->_post;
+ $_FILES = $this->_files;
+ $_SERVER = $this->_server;
+ Configure::write('App', $this->_app);
+ Configure::write('Cache', $this->_cache);
+ Configure::write('vendorPaths', $this->_vendorPaths);
+ Configure::write('pluginPaths', $this->_pluginPaths);
+ Configure::write('viewPaths', $this->_viewPaths);
+ Configure::write('debug', $this->_debug);
}
/**
* testParseParamsWithoutZerosAndEmptyPost method
@@ -626,8 +652,6 @@ function testQueryStringOnRoot() {
$this->assertTrue(isset($result['url']['sleep']));
$this->assertTrue(isset($result['url']['coffee']));
$this->assertEqual($result['url']['coffee'], 'life');
-
- $_GET = $this->_get;
}
/**
* testFileUploadArrayStructure method
@@ -854,8 +878,6 @@ function testFileUploadArrayStructure() {
)
);
$this->assertEqual($result['data'], $expected);
-
- $_FILES = array();
}
/**
* testGetUrl method
@@ -1614,6 +1636,7 @@ function testTestPluginDispatch() {
* @return void
*/
function testChangingParamsFromBeforeFilter() {
+ $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
$Dispatcher =& new TestDispatcher();
$url = 'some_posts/index/param:value/param2:value2';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
View
7 cake/tests/cases/libs/cache/apc.test.php
@@ -45,7 +45,7 @@ function skip() {
if (Cache::engine('Apc')) {
$skip = false;
}
- $this->skipif($skip, 'Apc is not installed or configured properly');
+ $this->skipIf($skip, '%s Apc is not installed or configured properly');
}
/**
* setUp method
@@ -54,7 +54,9 @@ function skip() {
* @return void
*/
function setUp() {
- Cache::config('apc', array('engine'=>'Apc', 'prefix' => 'cake_'));
+ $this->_cacheDisable = Configure::read('Cache.disable');
+ Configure::write('Cache.disable', false);
+ Cache::config('apc', array('engine' => 'Apc', 'prefix' => 'cake_'));
}
/**
* tearDown method
@@ -63,6 +65,7 @@ function setUp() {
* @return void
*/
function tearDown() {
+ Configure::write('Cache.disable', $this->_cacheDisable);
Cache::config('default');
}
/**
View
17 cake/tests/cases/libs/cache/file.test.php
@@ -45,23 +45,26 @@ class FileEngineTest extends CakeTestCase {
*/
var $config = array();
/**
- * start method
+ * startCase method
*
* @access public
* @return void
*/
- function start() {
- $this->config = Cache::config('default');
- $settings = Cache::config('default', array('engine'=> 'File', 'path' => CACHE));
+ function startCase() {
+ $this->_cacheDisable = Configure::read('Cache.disable');
+ $this->_cacheConfig = Cache::config('default');
+ Configure::write('Cache.disable', false);
+ Cache::config('default', array('engine' => 'File', 'path' => CACHE));
}
/**
- * end method
+ * endCase method
*
* @access public
* @return void
*/
- function end() {
- Cache::config('default', $this->config['settings']);
+ function endCase() {
+ Configure::write('Cache.disable', $this->_cacheDisable);
+ Cache::config('default', $this->_cacheConfig['settings']);
}
/**
* testCacheDirChange method
View
12 cake/tests/cases/libs/cache/memcache.test.php
@@ -26,7 +26,8 @@
*/
if (!class_exists('Cache')) {
require LIBS . 'cache.php';
-}/**
+}
+/**
* MemcacheEngineTest class
*
* @package cake
@@ -50,7 +51,7 @@ function skip() {
if (Cache::engine('Memcache')) {
$skip = false;
}
- $this->skipIf($skip, 'Memcache is not installed or configured properly');
+ $this->skipIf($skip, '%s Memcache is not installed or configured properly');
}
/**
* setUp method
@@ -59,7 +60,9 @@ function skip() {
* @return void
*/
function setUp() {
- Cache::config('memcache', array('engine'=>'Memcache', 'prefix' => 'cake_'));
+ $this->_cacheDisable = Configure::read('Cache.disable');
+ Configure::write('Cache.disable', false);
+ Cache::config('memcache', array('engine' => 'Memcache', 'prefix' => 'cake_'));
}
/**
* tearDown method
@@ -68,6 +71,7 @@ function setUp() {
* @return void
*/
function tearDown() {
+ Configure::write('Cache.disable', $this->_cacheDisable);
Cache::config('default');
}
/**
@@ -107,7 +111,7 @@ function testMultipleServers() {
}
}
- if ($this->skipIf(!$available, 'Need memcache servers at ' . implode(', ', $servers) . ' to run this test')) {
+ if ($this->skipIf(!$available, '%s Need memcache servers at ' . implode(', ', $servers) . ' to run this test')) {
return;
}
View
7 cake/tests/cases/libs/cache/xcache.test.php
@@ -45,7 +45,7 @@ function skip() {
if ($result = Cache::engine('Xcache')) {
$skip = false;
}
- $this->skipif($skip, 'Xcache is not installed or configured properly');
+ $this->skipIf($skip, '%s Xcache is not installed or configured properly');
}
/**
* setUp method
@@ -54,7 +54,9 @@ function skip() {
* @return void
*/
function setUp() {
- Cache::config('xcache', array('engine'=>'Xcache', 'prefix' => 'cake_'));
+ $this->_cacheDisable = Configure::read('Cache.disable');
+ Configure::write('Cache.disable', false);
+ Cache::config('xcache', array('engine' => 'Xcache', 'prefix' => 'cake_'));
}
/**
* tearDown method
@@ -63,6 +65,7 @@ function setUp() {
* @return void
*/
function tearDown() {
+ Configure::write('Cache.disable', $this->_cacheDisable);
Cache::config('default');
}
/**
View
7 cake/tests/cases/libs/cake_test_case.test.php
@@ -25,7 +25,12 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
App::import('Core', 'CakeTestCase');
-App::import('Core', 'AppController');
+
+if (!class_exists('AppController')) {
+ require_once LIBS . 'controller' . DS . 'app_controller.php';
+} elseif (!defined('APP_CONTROLLER_EXISTS')) {
+ define('APP_CONTROLLER_EXISTS', true);
+}
Mock::generate('CakeHtmlReporter');
Mock::generate('CakeTestCase', 'CakeDispatcherMockTestCase');
View
2  cake/tests/cases/libs/code_coverage_manager.test.php
@@ -40,7 +40,7 @@ class CodeCoverageManagerTest extends CakeTestCase {
* @access public
*/
function skip() {
- $this->skipif (!extension_loaded('xdebug'), 'XDebug not installed');
+ $this->skipIf(!extension_loaded('xdebug'), '%s XDebug not installed');
}
/**
* startTest Method
View
8 cake/tests/cases/libs/configure.test.php
@@ -39,8 +39,10 @@ class ConfigureTest extends CakeTestCase {
* @return void
*/
function setUp() {
- parent::setUp();
+ $this->_cacheDisable = Configure::read('Cache.disable');
Configure::write('Cache.disable', true);
+
+ $this->_debug = Configure::read('debug');
}
/**
* tearDown method
@@ -67,8 +69,8 @@ function tearDown() {
if (file_exists(TMP . 'cache' . DS . 'persistent' . DS . 'test.php')) {
unlink(TMP . 'cache' . DS . 'persistent' . DS . 'test.php');
}
- Configure::write('debug', 2);
- parent::tearDown();
+ Configure::write('debug', $this->_debug);
+ Configure::write('Cache.disable', $this->_cacheDisable);
}
/**
* testListObjects method
View
25 cake/tests/cases/libs/controller/component.test.php
@@ -62,9 +62,8 @@ class AppController extends Controller {
* @access public
*/
var $components = array('Orange' => array('colour' => 'blood orange'));
-
}
-} else if (!defined('APP_CONTROLLER_EXISTS')){
+} elseif (!defined('APP_CONTROLLER_EXISTS')){
define('APP_CONTROLLER_EXISTS', true);
}
/**
@@ -281,11 +280,22 @@ class ComponentTest extends CakeTestCase {
* @return void
*/
function setUp() {
+ $this->_pluginPaths = Configure::read('pluginPaths');
Configure::write('pluginPaths', array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
));
}
/**
+ * tearDown method
+ *
+ * @access public
+ * @return void
+ */
+ function tearDown() {
+ Configure::write('pluginPaths', $this->_pluginPaths);
+ ClassRegistry::flush();
+ }
+/**
* testLoadComponents method
*
* @access public
@@ -395,7 +405,9 @@ function testMultipleComponentInitialize() {
* @return void
*/
function testComponentsWithParams() {
- $this->skipIf(defined('APP_CONTROLLER_EXISTS'), 'Components with Params test will be skipped as it needs a non-existent AppController. As the an AppController class exists, this cannot be run.');
+ if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
+ return;
+ }
$Controller =& new ComponentTestController();
$Controller->components = array('ParamTest' => array('test' => 'value', 'flag'), 'Apple');
@@ -475,11 +487,14 @@ function testSomethingReferencingEmailComponent() {
));
}
/**
- * test that SessionComponent doesn't get added if its already in the components array.
+ * Test that SessionComponent doesn't get added if its already in the components array.
*
* @return void
- **/
+ * @access public
+ */
function testDoubleLoadingOfSessionComponent() {
+ $this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController');
+
$Controller =& new ComponentTestController();
$Controller->uses = array();
$Controller->components = array('Session');
View
2  cake/tests/cases/libs/controller/components/acl.test.php
@@ -27,7 +27,7 @@
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
}
-App::import(array('controller'.DS.'components'.DS.'acl', 'model'.DS.'db_acl'));
+App::import(array('controller' .DS . 'components' . DS . 'acl', 'model' . DS . 'db_acl'));
/**
* AclNodeTwoTestBase class
*
View
27 cake/tests/cases/libs/controller/components/auth.test.php
@@ -25,10 +25,8 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
App::import(array('controller' . DS . 'components' . DS .'auth', 'controller' . DS . 'components' . DS .'acl'));
-App::import(array('controller'.DS.'components'.DS.'acl', 'model'.DS.'db_acl'));
+App::import(array('controller' . DS . 'components' . DS . 'acl', 'model' . DS . 'db_acl'));
App::import('Core', 'Xml');
-
-Configure::write('Security.salt', 'JfIxfs2guVoUubWDYhG93b0qyJfIxfs2guwvniR2G0FgaC9mi');
/**
* TestAuthComponent class
*
@@ -437,6 +435,13 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function startTest() {
+ $this->_server = $_SERVER;
+ $this->_env = $_ENV;
+
+ $this->_securitySalt = Configure::read('Security.salt');
+ Configure::write('Security.salt', 'JfIxfs2guVoUubWDYhG93b0qyJfIxfs2guwvniR2G0FgaC9mi');
+
+ $this->_acl = Configure::read('Acl');
Configure::write('Acl.database', 'test_suite');
Configure::write('Acl.classname', 'DbAcl');
@@ -444,17 +449,28 @@ function startTest() {
$this->Controller->Component->init($this->Controller);
ClassRegistry::addObject('view', new View($this->Controller));
+
$this->Controller->Session->del('Auth');
$this->Controller->Session->del('Message.auth');
+
+ Router::reload();
+
$this->initialized = true;
}
/**
- * tearDown method
+ * endTest method
*
* @access public
* @return void
*/
- function tearDown() {
+ function endTest() {
+ $_SERVER = $this->_server;
+ $_ENV = $this->_env;
+ Configure::write('Acl', $this->_acl);
+ Configure::write('Security.salt', $this->_securitySalt);
+ $this->Controller->Session->del('Auth');
+ $this->Controller->Session->del('Message.auth');
+ ClassRegistry::flush();
unset($this->Controller, $this->AuthUser);
}
/**
@@ -578,7 +594,6 @@ function testAuthorizeFalse() {
$this->assertFalse($result);
$this->assertTrue($this->Controller->Session->check('Message.auth'));
-
$this->Controller->params = Router::parse('auth_test/camelCase');
$result = $this->Controller->Auth->startup($this->Controller);
$this->assertFalse($result);
View
25 cake/tests/cases/libs/controller/components/email.test.php
@@ -24,7 +24,6 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-Configure::write('App.encoding', 'UTF-8');
App::import('Component', 'Email');
/**
* EmailTestController class
@@ -90,6 +89,9 @@ class EmailComponentTest extends CakeTestCase {
* @return void
*/
function setUp() {
+ $this->_appEncoding = Configure::read('App.encoding');
+ Configure::write('App.encoding', 'UTF-8');
+
$this->Controller =& new EmailTestController();
restore_error_handler();
@@ -98,10 +100,25 @@ function setUp() {
$this->Controller->Email->initialize($this->Controller, array());
ClassRegistry::addObject('view', new View($this->Controller));
+
+ $this->_viewPaths = Configure::read('viewPaths');
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS));
}
/**
+ * tearDown method
+ *
+ * @access public
+ * @return void
+ */
+ function tearDown() {
+ Configure::write('App.encoding', $this->_appEncoding);
+ Configure::write('viewPaths', $this->_viewPaths);
+ $this->Controller->Session->del('Message');
+ restore_error_handler();
+ ClassRegistry::flush();
+ }
+/**
* testBadSmtpSend method
*
* @access public
@@ -119,7 +136,7 @@ function testBadSmtpSend() {
* @return void
*/
function testSmtpSend() {
- if (!$this->skipIf(!@fsockopen('localhost', 25), 'No SMTP server running on localhost')) {
+ if (!$this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) {
return;
}
$this->Controller->Email->reset();
@@ -167,7 +184,7 @@ function testSmtpSend() {
* @return void
*/
function testAuthenticatedSmtpSend() {
- $this->skipIf(!@fsockopen('localhost', 25), 'No SMTP server running on localhost');
+ $this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost');
$this->Controller->Email->reset();
$this->Controller->Email->to = 'postmaster@localhost';
@@ -181,7 +198,7 @@ function testAuthenticatedSmtpSend() {
$this->Controller->Email->delivery = 'smtp';
$result = $this->Controller->Email->send('This is the body of the message');
$code = substr($this->Controller->Email->smtpError, 0, 3);
- $this->skipIf(!$code, 'Authentication not enabled on server');
+ $this->skipIf(!$code, '%s Authentication not enabled on server');
$this->assertTrue(!$result && $code == '535');
}
/**
View
4 cake/tests/cases/libs/controller/components/security.test.php
@@ -141,7 +141,6 @@ function setUp() {
$this->Controller->Component->init($this->Controller);
$this->Controller->Security =& $this->Controller->TestSecurity;
$this->Controller->Security->blackHoleCallback = 'fail';
-
$this->oldSalt = Configure::read('Security.salt');
Configure::write('Security.salt', 'foo!');
}
@@ -152,10 +151,11 @@ function setUp() {
* @return void
*/
function tearDown() {
+ Configure::write('Security.salt', $this->oldSalt);
+ $this->Controller->Session->del('_Token');
unset($this->Controller->Security);
unset($this->Controller->Component);
unset($this->Controller);
- Configure::write('Security.salt', $this->oldSalt);
}
/**
* testStartup method
View
20 cake/tests/cases/libs/controller/components/session.test.php
@@ -82,6 +82,24 @@ function session_id() {
*/
class SessionComponentTest extends CakeTestCase {
/**
+ * setUp method
+ *
+ * @access public
+ * @return void
+ */
+ function setUp() {
+ $this->_session = Configure::read('Session');
+ }
+/**
+ * tearDown method
+ *
+ * @access public
+ * @return void
+ */
+ function tearDown() {
+ Configure::write('Session', $this->_session);
+ }
+/**
* testSessionAutoStart method
*
* @access public
@@ -322,6 +340,8 @@ function testSessionFlash() {
$Session->setFlash('This is a test message', 'non_existing_layout');
$this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array()));
+
+ $Session->del('Message');
}
/**
* testSessionId method
View
6 cake/tests/cases/libs/controller/controller.test.php
@@ -63,7 +63,7 @@ class AppController extends Controller {
*/
var $components = array('Cookie');
}
-} else if (!defined('APP_CONTROLLER_EXISTS')) {
+} elseif (!defined('APP_CONTROLLER_EXISTS')) {
define('APP_CONTROLLER_EXISTS', true);
}
/**
@@ -867,7 +867,9 @@ function testRedirect() {
* @return void
*/
function testMergeVars() {
- $this->skipIf(defined('APP_CONTROLLER_EXISTS'), 'MergeVars will be skipped as it needs a non-existent AppController. As the an AppController class exists, this cannot be run.');
+ if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
+ return;
+ }
$TestController =& new TestController();
$TestController->constructClasses();
View
29 cake/tests/cases/libs/controller/pages_controller.test.php
@@ -24,7 +24,12 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-App::import('Core', array('Controller', 'AppController', 'PagesController'));
+if (!class_exists('AppController')) {
+ require_once LIBS . 'controller' . DS . 'app_controller.php';
+} elseif (!defined('APP_CONTROLLER_EXISTS')) {
+ define('APP_CONTROLLER_EXISTS', true);
+}
+App::import('Core', array('Controller', 'PagesController'));
/**
* PagesControllerTest class
*
@@ -33,12 +38,34 @@
*/
class PagesControllerTest extends CakeTestCase {
/**
+ * setUp method
+ *
+ * @access public
+ * @return void
+ */
+ function setUp() {
+ $this->_viewPaths = Configure::read('viewPaths');
+ }
+/**
+ * tearDown method
+ *
+ * @access public
+ * @return void
+ */
+ function tearDown() {
+ Configure::write('viewPaths', $this->_viewPaths);
+ }
+/**
* testDisplay method
*
* @access public
* @return void
*/
function testDisplay() {
+ if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
+ return;
+ }
+
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS));
$Pages =& new PagesController();
View
5 cake/tests/cases/libs/debugger.test.php
@@ -218,15 +218,14 @@ function testLog() {
Debugger::log('cool');
$result = file_get_contents(LOGS . 'debug.log');
- $this->assertPattern('/DebuggerTest::testLog/', $result);
+ $this->assertPattern('/DebuggerTest\:\:testLog/', $result);
$this->assertPattern('/"cool"/', $result);
unlink(TMP . 'logs' . DS . 'debug.log');
Debugger::log(array('whatever', 'here'));
$result = file_get_contents(TMP . 'logs' . DS . 'debug.log');
-
- $this->assertPattern('/DebuggerTest::testLog/', $result);
+ $this->assertPattern('/DebuggerTest\:\:testLog/', $result);
$this->assertPattern('/array/', $result);
$this->assertPattern('/"whatever",/', $result);
$this->assertPattern('/"here"/', $result);
View
88 cake/tests/cases/libs/error.test.php
@@ -95,48 +95,50 @@ class AuthBlueberryUser extends CakeTestModel {
var $useTable = false;
}
if (!class_exists('AppController')) {
-/**
- * AppController class
- *
- * @package cake
- * @subpackage cake.tests.cases.libs
- */
-class AppController extends Controller {
-/**
- * components property
- *
- * @access public
- * @return void
- */
- var $components = array('Blueberry');
-/**
- * beforeRender method
- *
- * @access public
- * @return void
- */
- function beforeRender() {
- echo $this->Blueberry->testName;
- }
-/**
- * header method
- *
- * @access public
- * @return void
- */
- function header($header) {
- echo $header;
+ /**
+ * AppController class
+ *
+ * @package cake
+ * @subpackage cake.tests.cases.libs
+ */
+ class AppController extends Controller {
+ /**
+ * components property
+ *
+ * @access public
+ * @return void
+ */
+ var $components = array('Blueberry');
+ /**
+ * beforeRender method
+ *
+ * @access public
+ * @return void
+ */
+ function beforeRender() {
+ echo $this->Blueberry->testName;
+ }
+ /**
+ * header method
+ *
+ * @access public
+ * @return void
+ */
+ function header($header) {
+ echo $header;
+ }
+ /**
+ * _stop method
+ *
+ * @access public
+ * @return void
+ */
+ function _stop($status = 0) {
+ echo 'Stopped with status: ' . $status;
+ }
}
-/**
- * _stop method
- *
- * @access public
- * @return void
- */
- function _stop($status = 0) {
- echo 'Stopped with status: ' . $status;
- }
-}
+} elseif (!defined('APP_CONTROLLER_EXISTS')){
+ define('APP_CONTROLLER_EXISTS', true);
}
App::import('Core', array('Error', 'Controller'));
/**
@@ -224,7 +226,7 @@ class ErrorHandlerTest extends CakeTestCase {
* @return void
*/
function skip() {
- $this->skipif ((PHP_SAPI == 'cli'), 'TestErrorHandlerTest cannot be run from console');
+ $this->skipIf(PHP_SAPI === 'cli', '%s Cannot be run from console');
}
/**
* testError method
@@ -277,6 +279,8 @@ function testError404() {
* @return void
*/
function testMissingController() {
+ $this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController');
+
ob_start();
$TestErrorHandler = new TestErrorHandler('missingController', array('className' => 'PostsController'));
$result = ob_get_clean();
View
2  cake/tests/cases/libs/file.test.php
@@ -95,7 +95,7 @@ function testBasic() {
$result = $this->File->Folder();
$this->assertIsA($result, 'Folder');
- $this->skipIf(DIRECTORY_SEPARATOR === '\\', 'File permissions tests not supported on Windows');
+ $this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s File permissions tests not supported on Windows');
$result = $this->File->perms();
$expecting = '0644';
$this->assertEqual($result, $expecting);
View
4 cake/tests/cases/libs/flay.test.php
@@ -31,7 +31,7 @@
* @package cake
* @subpackage cake.tests.cases.libs
*/
-class FlayTest extends UnitTestCase {
+class FlayTest extends CakeTestCase {
/**
* skip method
*
@@ -39,7 +39,7 @@ class FlayTest extends UnitTestCase {
* @return void
*/
function skip() {
- $this->skipif(true, 'FlayTest not implemented');
+ $this->skipIf(true, '%s FlayTest not implemented');
}
}
?>
View
2  cake/tests/cases/libs/folder.test.php
@@ -161,7 +161,7 @@ function testOperations() {
* @access public
*/
function testChmod() {
- $this->skipIf(DIRECTORY_SEPARATOR === '\\', 'Folder permissions tests not supported on Windows');
+ $this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Folder permissions tests not supported on Windows');
$path = TEST_CAKE_CORE_INCLUDE_PATH . 'console' . DS . 'libs' . DS . 'templates' . DS . 'skel';
$Folder =& new Folder($path);
View
10 cake/tests/cases/libs/i18n.test.php
@@ -39,9 +39,19 @@ class I18nTest extends CakeTestCase {
* @return void
*/
function setUp() {
+ $this->_localePaths = Configure::read('localePaths');
Configure::write('localePaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale'));
}
/**
+ * tearDown method
+ *
+ * @access public
+ * @return void
+ */
+ function tearDown() {
+ Configure::write('localePaths', $this->_localePaths);
+ }
+/**
* testDefaultStrings method
*
* @access public
View
14 cake/tests/cases/libs/inflector.test.php
@@ -33,20 +33,12 @@
*/
class InflectorTest extends CakeTestCase {
/**
- * Inflector property
- *
- * @var mixed null
- * @access public
- */
- var $Inflector = null;
-/**
* setUp method
*
* @access public
* @return void
*/
function setUp() {
- $this->Inflector = Inflector::getInstance();
}
/**
* tearDown method
@@ -55,7 +47,6 @@ function setUp() {
* @return void
*/
function tearDown() {
- unset($this->Inflector);
}
/**
* testInstantiation method
@@ -64,7 +55,10 @@ function tearDown() {
* @return void
*/
function testInstantiation() {
- $this->assertEqual(new Inflector(), $this->Inflector);
+ $this->skipUnless(strpos(Debugger::trace(), 'GroupTest') === false, '%s Cannot be run from within a group test');
+
+ $Instance = Inflector::getInstance();
+ $this->assertEqual(new Inflector(), $Instance);
}
/**
* testInflectingSingulars method
View
3  cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php
@@ -164,7 +164,6 @@ class Article extends CakeTestModel {
* @access public
*/
var $name = 'Article';
-
}
}
/**
@@ -196,7 +195,7 @@ class DboAdodbTest extends CakeTestCase {
function skip() {
$this->_initDb();
$db =& ConnectionManager::getDataSource('test_suite');
- $this->skipif($db->config['driver'] != 'adodb', 'Adodb connection not available');
+ $this->skipIf($db->config['driver'] != 'adodb', '%s Adodb connection not available');
}
/**
* Sets up a Dbo class instance for testing
View
3  cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php
@@ -219,7 +219,7 @@ class DboMssqlTest extends CakeTestCase {
*/
function skip() {
$this->_initDb();
- $this->skipif ($this->db->config['driver'] != 'mssql', 'SQL Server connection not available');
+ $this->skipUnless($this->db->config['driver'] == 'mssql', '%s SQL Server connection not available');
}
/**
* Sets up a Dbo class instance for testing
@@ -240,7 +240,6 @@ function setUp() {
function tearDown() {
unset($this->model);
}
-
/**
* testQuoting method
*
View
2  cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
@@ -167,7 +167,7 @@ class DboMysqlTest extends CakeTestCase {
*/
function skip() {
$this->_initDb();
- $this->skipif($this->db->config['driver'] != 'mysql', 'MySQL connection not available');
+ $this->skipUnless($this->db->config['driver'] == 'mysql', '%s MySQL connection not available');
}
/**
* Sets up a Dbo class instance for testing
View
2  cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php
@@ -168,7 +168,7 @@ class DboMysqliTest extends CakeTestCase {
*/
function skip() {
$this->_initDb();
- $this->skipif($this->db->config['driver'] != 'mysqli', 'MySQLi connection not available');
+ $this->skipUnless($this->db->config['driver'] == 'mysqli', '%s MySQLi connection not available');
}
/**
* Sets up a Dbo class instance for testing
View
4 cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php
@@ -55,9 +55,7 @@ function setUp() {
*/
function skip() {
$this->_initDb();
- $this->skipif(
- $this->db->config['driver'] != 'oracle', 'Oracle connection not available'
- );
+ $this->skipUnless($this->db->config['driver'] == 'oracle', '%s Oracle connection not available');
}
/**
* testLastErrorStatement method
View
2  cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
@@ -180,7 +180,7 @@ class DboPostgresTest extends CakeTestCase {
*/
function skip() {
$this->_initDb();
- $this->skipif($this->db->config['driver'] != 'postgres', 'PostgreSQL connection not available');
+ $this->skipUnless($this->db->config['driver'] == 'postgres', '%s PostgreSQL connection not available');
}
/**
* Set up test suite database connection
View
2  cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
@@ -100,7 +100,7 @@ class DboSqliteTest extends CakeTestCase {
*/
function skip() {
$this->_initDb();
- $this->skipif($this->db->config['driver'] != 'sqlite', 'SQLite connection not available');
+ $this->skipUnless($this->db->config['driver'] == 'sqlite', '%s SQLite connection not available');
}
/**
* Set up test suite database connection
View
23 cake/tests/cases/libs/model/model.test.php
@@ -1815,10 +1815,11 @@ function testFindCount() {
/**
* Test find(count) with Db::expression
*
+ * @access public
* @return void
- **/
+ */
function testFindCountWithDbExpressions() {
- if ($this->skipif($this->db->config['driver'] == 'postgres', 'testFindCountWithExpressions is not compatible with Postgres')) {
+ if ($this->skipIf($this->db->config['driver'] == 'postgres', '%s testFindCountWithExpressions is not compatible with Postgres')) {
return;
}
$this->loadFixtures('Project');
@@ -4795,7 +4796,7 @@ function testSaveEmpty() {
$this->assertFalse($expected);
}
// function testBasicValidation() {
- // $TestModel =& new ValidationTest();
+ // $TestModel =& new ValidationTest1();
// $TestModel->testing = true;
// $TestModel->set(array('title' => '', 'published' => 1));
// $this->assertEqual($TestModel->invalidFields(), array('title' => 'This field cannot be left blank'));
@@ -4936,7 +4937,7 @@ function testFindAllWithConditionsHavingMixedDataTypes() {
* @return void
*/
function testMultipleValidation() {
- $TestModel =& new ValidationTest();
+ $TestModel =& new ValidationTest1();
}
/**
* Tests validation parameter order in custom validation methods
@@ -4945,7 +4946,7 @@ function testMultipleValidation() {
* @return void
*/
function testValidationParams() {
- $TestModel =& new ValidationTest();
+ $TestModel =& new ValidationTest1();
$TestModel->validate['title'] = array('rule' => 'customValidatorWithParams', 'required' => true);
$TestModel->create(array('title' => 'foo'));
$TestModel->invalidFields();
@@ -4972,7 +4973,7 @@ function testValidationParams() {
* @return void
*/
function testInvalidFieldsWithFieldListParams() {
- $TestModel =& new ValidationTest();
+ $TestModel =& new ValidationTest1();
$TestModel->validate = $validate = array(
'title' => array('rule' => 'customValidator', 'required' => true),
'name' => array('rule' => 'allowEmpty', 'required' => true),
@@ -5007,10 +5008,10 @@ function testInvalidFieldsWithFieldListParams() {
* @return void
*/
function testAllowSimulatedFields() {
- $TestModel =& new ValidationTest();
+ $TestModel =& new ValidationTest1();
$TestModel->create(array('title' => 'foo', 'bar' => 'baz'));
- $expected = array('ValidationTest' => array('title' => 'foo', 'bar' => 'baz'));
+ $expected = array('ValidationTest1' => array('title' => 'foo', 'bar' => 'baz'));
$this->assertEqual($TestModel->data, $expected);
}
/**
@@ -5020,7 +5021,7 @@ function testAllowSimulatedFields() {
* @return void
*/
function testInvalidAssociation() {
- $TestModel =& new ValidationTest();
+ $TestModel =& new ValidationTest1();
$this->assertNull($TestModel->getAssociated('Foo'));
}
/**
@@ -5533,7 +5534,7 @@ function testAutoSaveUuid() {
function testZeroDefaultFieldValue() {
$this->skipIf(
$this->db->config['driver'] == 'sqlite',
- 'SQLite uses loose typing, this operation is unsupported'
+ '%s SQLite uses loose typing, this operation is unsupported'
);
$this->loadFixtures('DataTest');
$TestModel =& new DataTest();
@@ -6162,7 +6163,7 @@ function testUnderscoreFieldSave() {
function testGroupBy() {
$db = ConnectionManager::getDataSource('test_suite');
$isStrictGroupBy = in_array($db->config['driver'], array('postgres', 'oracle'));
- if ($this->skipif($isStrictGroupBy, 'Postgresql and Oracle have strict GROUP BY and are incompatible with this test.')) {
+ if ($this->skipIf($isStrictGroupBy, '%s Postgresql and Oracle have strict GROUP BY and are incompatible with this test.')) {
return;
}
View
6 cake/tests/cases/libs/model/models.php
@@ -1804,19 +1804,19 @@ class TheVoid extends CakeTestModel {
var $useTable = false;
}
/**
- * ValidationTest class
+ * ValidationTest1 class
*
* @package cake
* @subpackage cake.tests.cases.libs.model
*/
-class ValidationTest extends CakeTestModel {
+class ValidationTest1 extends CakeTestModel {
/**
* name property
*
* @var string 'ValidationTest'
* @access public
*/
- var $name = 'ValidationTest';
+ var $name = 'ValidationTest1';
/**
* useTable property
*
View
2  cake/tests/cases/libs/overloadable.test.php
@@ -39,7 +39,7 @@ class OverloadableTest extends CakeTestCase {
* @return void
*/
function skip() {
- $this->skipif(true, 'OverloadableTest not implemented');
+ $this->skipIf(true, ' %s OverloadableTest not implemented');
}
}
?>
View
5 cake/tests/cases/libs/security.test.php
@@ -90,6 +90,9 @@ function testValidateAuthKey() {
* @return void
*/
function testHash() {
+ $Security = Security::getInstance();
+ $_hashType = $Security->hashType;
+
$key = 'someKey';
$hash = 'someHash';
@@ -126,6 +129,8 @@ function testHash() {
$this->assertIdentical(strlen(Security::hash($key, 'sha256', false)), 64);
$this->assertIdentical(strlen(Security::hash($key, 'sha256', true)), 64);
}
+
+ Security::setHash($_hashType);
}
/**
* testCipher method
View
10 cake/tests/cases/libs/validation.test.php
@@ -65,6 +65,16 @@ class ValidationTest extends CakeTestCase {
*/
function setUp() {
$this->Validation =& Validation::getInstance();
+ $this->_appEncoding = Configure::read('App.encoding');
+ }
+/**
+ * tearDown method
+ *
+ * @access public
+ * @return void
+ */
+ function tearDown() {
+ Configure::write('App.encoding', $this->_appEncoding);
}
/**
* testNotEmpty method
View
4 cake/tests/cases/libs/view/helpers/html.test.php
@@ -72,6 +72,7 @@ function setUp() {
$this->Html =& new HtmlHelper();
$view =& new View(new TheHtmlTestController());
ClassRegistry::addObject('view', $view);
+ $this->_appEncoding = Configure::read('App.encoding');
}
/**
* tearDown method
@@ -80,7 +81,8 @@ function setUp() {
* @return void
*/
function tearDown() {
- unset($this->Html);
+ Configure::write('App.encoding', $this->_appEncoding);
+ ClassRegistry::flush();
}
/**
* testDocType method
View
2  cake/tests/cases/libs/view/helpers/js.test.php
@@ -48,7 +48,7 @@ class JsHelperTest extends UnitTestCase {
* @return void
*/
function skip() {
- $this->skipif (true, 'JsHelper test not implemented');
+ $this->skipIf(true, '%s JsHelper test not implemented');
}
/**
* setUp method
View
10 cake/tests/groups/cache.group.php
@@ -1,7 +1,7 @@
<?php
/* SVN FILE: $Id$ */
/**
- * AllCacheEnginesGroupTest file
+ * CacheGroupTest file
*
* Long description for file
*
@@ -25,14 +25,14 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
- * AllCacheEnginesGroupTest class
+ * CacheGroupTest class
*
* This test group will run all the Cache class test and all core cache engine tests
*
* @package cake
* @subpackage cake.tests.groups
*/
-class AllCacheEnginesGroupTest extends GroupTest {
+class CacheGroupTest extends GroupTest {
/**
* label property
*
@@ -41,12 +41,12 @@ class AllCacheEnginesGroupTest extends GroupTest {
*/
var $label = 'Cache and all CacheEngines';
/**
- * AllCacheEnginesGroupTest method
+ * CacheGroupTest method
*
* @access public
* @return void
*/
- function AllCacheEnginesGroupTest() {
+ function CacheGroupTest() {
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'cache');
TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'cache');
}
View
10 cake/tests/groups/components.group.php
@@ -1,7 +1,7 @@
<?php
/* SVN FILE: $Id$ */
/**
- * AllCoreComponentsGroupTest file
+ * ComponentsGroupTest file
*
* Long description for file
*
@@ -25,14 +25,14 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
- * AllCoreComponentsGroupTest class
+ * ComponentsGroupTest class
*
* This test group will run all tests in the cases/libs/controller/components directory.
*
* @package cake
* @subpackage cake.tests.groups
*/
-class AllCoreComponentsGroupTest extends GroupTest {
+class ComponentsGroupTest extends GroupTest {
/**
* label property
*
@@ -41,12 +41,12 @@ class AllCoreComponentsGroupTest extends GroupTest {
*/
var $label = 'All Components';
/**
- * AllCoreComponentsGroupTest method
+ * CoreComponentsGroupTest method
*
* @access public
* @return void
*/
- function AllCoreComponentsGroupTest() {
+ function ComponentsGroupTest() {
TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components');
}
}
View
8 cake/tests/groups/console.group.php
@@ -25,14 +25,14 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
- * AllConsoleGroupTest class
+ * ConsoleGroupTest class
*
* This test group will run all console tests
*
* @package cake
* @subpackage cake.tests.groups
*/
-class AllConsoleGroupTest extends GroupTest {
+class ConsoleGroupTest extends GroupTest {
/**
* label property
*
@@ -41,12 +41,12 @@ class AllConsoleGroupTest extends GroupTest {
*/
var $label = 'ShellDispatcher, Shell and all Tasks';
/**
- * AllConsoleGroupTest method
+ * ConsoleGroupTest method
*
* @access public
* @return void
*/
- function AllConsoleGroupTest() {
+ function ConsoleGroupTest() {
TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'console');
}
}
View
8 cake/tests/groups/lib_controller.group.php → cake/tests/groups/controller.group.php
@@ -1,7 +1,7 @@
<?php
/* SVN FILE: $Id$ */
/**
- * LibControllerGroupTest file
+ * ControllerGroupTest file
*
* Long description for file
*
@@ -25,12 +25,12 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
- * LibControllerGroupTest
+ * ControllerGroupTest
*
* @package cake
* @subpackage cake.tests.groups
*/
-class LibControllerGroupTest extends GroupTest {
+class ControllerGroupTest extends GroupTest {
/**
* label property
*
@@ -44,7 +44,7 @@ class LibControllerGroupTest extends GroupTest {
* @access public
* @return void
*/
- function LibControllerGroupTest() {
+ function ControllerGroupTest() {
TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller');
}
}
View
10 cake/tests/groups/helpers.group.php
@@ -1,7 +1,7 @@
<?php
/* SVN FILE: $Id$ */
/**
- * AllCoreHelpersGroupTest file
+ * HelpersGroupTest file
*
* Long description for file
*
@@ -25,14 +25,14 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
- * AllCoreHelpersGroupTest class
+ * HelpersGroupTest class
*
* This test group will run all test in the cases/libs/view/helpers directory.
*
* @package cake
* @subpackage cake.tests.groups
*/
-class AllCoreHelpersGroupTest extends GroupTest {
+class HelpersGroupTest extends GroupTest {
/**
* label property
*
@@ -41,12 +41,12 @@ class AllCoreHelpersGroupTest extends GroupTest {
*/
var $label = 'All Helpers';
/**
- * AllCoreHelpersGroupTest method
+ * HelpersGroupTest method
*
* @access public
* @return void
*/
- function AllCoreHelpersGroupTest() {
+ function HelpersGroupTest() {
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helper');
TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers');
}
View
10 cake/tests/groups/lib.group.php
@@ -1,7 +1,7 @@
<?php
/* SVN FILE: $Id$ */
/**
- * AllCoreLibGroupTest file
+ * LibGroupTest file
*
* Long description for file
*
@@ -25,14 +25,14 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
- * AllCoreLibGroupTest class
+ * LibGroupTest class
*
* This test group will run all test in the cases/libs directory.
*
* @package cake
* @subpackage cake.tests.groups
*/
-class AllCoreLibGroupTest extends GroupTest {
+class LibGroupTest extends GroupTest {
/**
* label property
*
@@ -41,12 +41,12 @@ class AllCoreLibGroupTest extends GroupTest {
*/
var $label = 'All Libs';
/**
- * AllCoreLibGroupTest method
+ * LibGroupTest method
*
* @access public
* @return void
*/
- function AllCoreLibGroupTest() {
+ function LibGroupTest() {
TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs');
}
}
View
71 cake/tests/groups/no_cross_contamination.group.php
@@ -0,0 +1,71 @@
+<?php
+/* SVN FILE: $Id$ */
+/**
+ * NoCrossContaminationGroupTest file
+ *
+ * Long description for file
+ *
+ * PHP versions 4 and 5
+ *
+ * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
+ * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ *
+ * Licensed under The Open Group Test Suite License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @filesource
+ * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
+ * @package cake
+ * @subpackage cake.tests.groups
+ * @since CakePHP(tm) v 1.2.0.4206
+ * @version $Revision$
+ * @modifiedby $LastChangedBy$
+ * @lastmodified $Date$
+ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
+ */
+/**
+ * NoCrossContaminationGroupTest class
+ *
+ * This test group will run all tests
+ * that are proper isolated to be run in sequence
+ * without affected each other
+ *
+ * @package cake
+ * @subpackage cake.tests.groups
+ */
+class NoCrossContaminationGroupTest extends GroupTest {
+/**
+ * label property
+ *
+ * @var string
+ * @access public
+ */
+ var $label = 'No Cross Contamination';
+/**
+ * blacklist property
+ *
+ * @var string
+ * @access public
+ */
+ var $blacklist = array('cake_test_case.test.php', 'object.test.php');
+/**
+ * NoCrossContaminationGroupTest method
+ *
+ * @access public
+ * @return void
+ */
+ function NoCrossContaminationGroupTest() {
+ App::import('Core', 'Folder');
+
+ $Folder = new Folder(CORE_TEST_CASES);
+
+ foreach ($Folder->findRecursive('.*\.test\.php', true) as $file) {
+ if (in_array(basename($file), $this->blacklist)) {
+ continue;
+ }
+ TestManager::addTestFile($this, $file);
+ }
+ }
+}
+?>
View
10 cake/tests/groups/no_database.group.php
@@ -1,7 +1,7 @@
<?php
/* SVN FILE: $Id$ */
/**
- * AllCoreWithoutDatabaseGroupTest file
+ * NoDatabaseGroupTest file
*
* Long description for file
*
@@ -25,14 +25,14 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
- * AllCoreWithOutDatabaseGroupTest class
+ * NoDatabaseGroupTest class
*
* This test group will run all test in the cases/libs directory.
*
* @package cake
* @subpackage cake.tests.groups
*/
-class AllCoreWithoutDatabaseGroupTest extends GroupTest {
+class NoDatabaseGroupTest extends GroupTest {
/**
* label property
*
@@ -41,12 +41,12 @@ class AllCoreWithoutDatabaseGroupTest extends GroupTest {
*/
var $label = 'All Libs not requiring a database connection';
/**
- * AllCoreWithOutDatabaseGroupTest method
+ * NoDatabaseGroupTest method
*
* @access public
* @return void
*/
- function AllCoreWithoutDatabaseGroupTest() {
+ function NoDatabaseGroupTest() {
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'dispatcher');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'router');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'inflector');
View
10 cake/tests/groups/view.group.php
@@ -1,7 +1,7 @@
<?php
/* SVN FILE: $Id$ */
/**
- * AllCoreViewsGroupTest file
+ * ViewsGroupTest file
*
* Long description for file
*
@@ -25,14 +25,14 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
/**
- * AllCoreViewsGroupTest class
+ * ViewsGroupTest class
*
* This test group will run view class tests (view, theme)
*
* @package cake
* @subpackage cake.tests.groups
*/
-class AllCoreViewsGroupTest extends GroupTest {
+class ViewsGroupTest extends GroupTest {
/**
* label property
*
@@ -41,12 +41,12 @@ class AllCoreViewsGroupTest extends GroupTest {
*/
var $label = 'View and ThemeView';
/**
- * AllCoreViewsGroupTest method
+ * ViewsGroupTest method
*
* @access public
* @return void
*/
- function AllCoreViewsGroupTest() {
+ function ViewsGroupTest() {
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'view');
TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'theme');
}
View
2  cake/tests/groups/xml.group.php
@@ -41,7 +41,7 @@ class XmlGroupTest extends GroupTest {
*/
var $label = 'Xml based classes (Xml, XmlHelper and RssHelper)';
/**
- * AllCoreViewsGroupTest method
+ * XmlGroupTest method
*
* @access public
* @return void
View
168 cake/tests/lib/cake_test_case.php
@@ -1,7 +1,7 @@
<?php
/* SVN FILE: $Id$ */
/**
- * Short description for file.
+ * CakeTestCase file
*
* Long description for file
*
@@ -31,20 +31,40 @@
require_once CAKE_TESTS_LIB . 'cake_test_fixture.php';
App::import('Vendor', 'simpletest' . DS . 'unit_tester');
/**
- * Short description for class.
+ * CakeTestDispatcher
*
* @package cake
* @subpackage cake.cake.tests.lib
*/
class CakeTestDispatcher extends Dispatcher {
+/**
+ * controller property
+ *
+ * @var Controller
+ * @access public
+ */
var $controller;
var $testCase;
-
+/**
+ * testCase method
+ *
+ * @param CakeTestCase $testCase
+ * @return void
+ * @access public
+ */
function testCase(&$testCase) {