Merge master in 1.3

This commit is contained in:
gwoo 2009-03-19 14:10:13 -07:00
parent 6cb8b3d286
commit 643651fe56
250 changed files with 2589 additions and 2019 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ // // +---------------------------------------------------------------------------------------------------+ //
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
1.2.1.8004 1.2.2.8120

View file

@ -198,10 +198,14 @@ class ShellDispatcher {
*/ */
function __buildPaths() { function __buildPaths() {
$paths = array(); $paths = array();
$pluginPaths = Configure::read('pluginPaths'); $pluginPaths = Configure::read('pluginPaths');
if (!class_exists('Folder')) {
require LIBS . 'folder.php';
}
foreach ($pluginPaths as $pluginPath) { foreach ($pluginPaths as $pluginPath) {
$plugins = Configure::listObjects('plugin', $pluginPath); $Folder =& new Folder($pluginPath);
list($plugins,) = $Folder->read(false, true);
foreach ((array)$plugins as $plugin) { foreach ((array)$plugins as $plugin) {
$path = $pluginPath . Inflector::underscore($plugin) . DS . 'vendors' . DS . 'shells' . DS; $path = $pluginPath . Inflector::underscore($plugin) . DS . 'vendors' . DS . 'shells' . DS;
if (file_exists($path)) { if (file_exists($path)) {
@ -262,7 +266,6 @@ class ShellDispatcher {
Configure::write('debug', 1); Configure::write('debug', 1);
return true; return true;
} }
/** /**
* Dispatches a CLI request * Dispatches a CLI request
* *
@ -542,16 +545,19 @@ class ShellDispatcher {
$this->stdout("\nAvailable Shells:"); $this->stdout("\nAvailable Shells:");
$_shells = array(); $_shells = array();
foreach ($this->shellPaths as $path) { foreach ($this->shellPaths as $path) {
if (is_dir($path)) { if (is_dir($path)) {
$shells = Configure::listObjects('file', $path); $shells = Configure::listObjects('file', $path);
$path = str_replace(CORE_PATH, 'CORE/', $path); $path = str_replace(CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS, 'CORE' . DS, $path);
$path = str_replace(APP, 'APP' . DS, $path);
$path = str_replace(ROOT, 'ROOT', $path); $path = str_replace(ROOT, 'ROOT', $path);
$path = rtrim($path, DS); $path = rtrim($path, DS);
$this->stdout("\n " . $path . ":"); $this->stdout("\n " . $path . ":");
if (empty($shells)) { if (empty($shells)) {
$this->stdout("\t - none"); $this->stdout("\t - none");
} else { } else {
sort($shells);
foreach ($shells as $shell) { foreach ($shells as $shell) {
if ($shell !== 'shell.php') { if ($shell !== 'shell.php') {
$this->stdout("\t " . str_replace('.php', '', $shell)); $this->stdout("\t " . str_replace('.php', '', $shell));

View file

@ -36,7 +36,7 @@ class AclShell extends Shell {
/** /**
* Contains instance of AclComponent * Contains instance of AclComponent
* *
* @var object * @var AclComponent
* @access public * @access public
*/ */
var $Acl; var $Acl;

View file

@ -34,7 +34,7 @@ class Shell extends Object {
/** /**
* An instance of the ShellDispatcher object that loaded this script * An instance of the ShellDispatcher object that loaded this script
* *
* @var object * @var ShellDispatcher
* @access public * @access public
*/ */
var $Dispatch = null; var $Dispatch = null;
@ -49,7 +49,7 @@ class Shell extends Object {
* Holds the DATABASE_CONFIG object for the app. Null if database.php could not be found, * Holds the DATABASE_CONFIG object for the app. Null if database.php could not be found,
* or the app does not exist. * or the app does not exist.
* *
* @var object * @var DATABASE_CONFIG
* @access public * @access public
*/ */
var $DbConfig = null; var $DbConfig = null;

View file

@ -135,7 +135,7 @@ class ExtractTask extends Shell{
} else { } else {
$response = ''; $response = '';
while ($response == '') { while ($response == '') {
$response = $this->in("What is the full path you would like to extract?\nExample: " . $this->params['root'] . DS . "myapp\n[Q]uit", null, 'Q'); $response = $this->in("What is the full path you would like to extract?\nExample: " . $this->params['root'] . DS . "myapp\n[Q]uit", null, $this->params['working']);
if (strtoupper($response) === 'Q') { if (strtoupper($response) === 'Q') {
$this->out('Extract Aborted'); $this->out('Extract Aborted');
$this->_stop(); $this->_stop();

View file

@ -33,7 +33,7 @@ class Cache extends Object {
/** /**
* Cache engine to use * Cache engine to use
* *
* @var object * @var CacheEngine
* @access protected * @access protected
*/ */
var $_Engine = null; var $_Engine = null;

View file

@ -34,7 +34,7 @@ class FileEngine extends CacheEngine {
/** /**
* Instance of File class * Instance of File class
* *
* @var object * @var File
* @access private * @access private
*/ */
var $__File = null; var $__File = null;

View file

@ -33,7 +33,7 @@ class MemcacheEngine extends CacheEngine {
/** /**
* Memcache wrapper. * Memcache wrapper.
* *
* @var object * @var Memcache
* @access private * @access private
*/ */
var $__Memcache = null; var $__Memcache = null;

View file

@ -291,6 +291,32 @@ class Controller extends Object {
* @link * @link
*/ */
var $methods = array(); var $methods = array();
/**
* This controller's primary model class name, the Inflector::classify()'ed version of
* the controller's $name property.
*
* Example: For a controller named 'Comments', the modelClass would be 'Comment'
*
* @var string
* @access public
*/
var $modelClass = null;
/**
* This controller's model key name, an underscored version of the controller's $modelClass property.
*
* Example: For a controller named 'ArticleComments', the modelKey would be 'article_comment'
*
* @var string
* @access public
*/
var $modelKey = null;
/**
* Holds any validation errors produced by the last call of the validateErrors() method/
*
* @var array Validation errors, or false if none
* @access public
*/
var $validationErrors = null;
/** /**
* Constructor. * Constructor.
* *

View file

@ -39,7 +39,7 @@ class Scaffold extends Object {
/** /**
* Controller object * Controller object
* *
* @var object * @var Controller
* @access public * @access public
*/ */
var $controller = null; var $controller = null;

View file

@ -70,7 +70,7 @@ class ErrorHandler extends Object {
/** /**
* Controller instance. * Controller instance.
* *
* @var object * @var Controller
* @access public * @access public
*/ */
var $controller = null; var $controller = null;

View file

@ -42,7 +42,7 @@ class File extends Object {
/** /**
* Folder object of the File * Folder object of the File
* *
* @var object * @var Folder
* @access public * @access public
*/ */
var $Folder = null; var $Folder = null;

View file

@ -212,17 +212,18 @@ class Folder extends Object {
*/ */
function _findRecursive($pattern, $sort = false) { function _findRecursive($pattern, $sort = false) {
list($dirs, $files) = $this->read($sort); list($dirs, $files) = $this->read($sort);
$found = array(); $found = array();
foreach ($files as $file) { foreach ($files as $file) {
if (preg_match('/^' . $pattern . '$/i', $file)) { if (preg_match('/^' . $pattern . '$/i', $file)) {
$found[] = Folder::addPathElement($this->path, $file); $found[] = Folder::addPathElement($this->path, $file);
} }
} }
$start = $this->path; $start = $this->path;
foreach ($dirs as $dir) { foreach ($dirs as $dir) {
$this->cd(Folder::addPathElement($start, $dir)); $this->cd(Folder::addPathElement($start, $dir));
$found = array_merge($found, $this->findRecursive($pattern)); $found = array_merge($found, $this->findRecursive($pattern, $sort));
} }
return $found; return $found;
} }

View file

@ -40,7 +40,7 @@ class I18n extends Object {
/** /**
* Instance of the I10n class for localization * Instance of the I10n class for localization
* *
* @var object * @var I10n
* @access public * @access public
*/ */
var $l10n = null; var $l10n = null;

View file

@ -205,11 +205,11 @@ class ModelBehavior extends Object {
* @subpackage cake.cake.libs.model * @subpackage cake.cake.libs.model
*/ */
class BehaviorCollection extends Object { class BehaviorCollection extends Object {
/** /**
* Stores a reference to the attached name * Stores a reference to the attached name
* *
* @var object * @var string
* @access public
*/ */
var $modelName = null; var $modelName = null;
/** /**

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * Datasource connection manager
* *
* Long description for file * Provides an interface for loading and enumerating connections defined in app/config/database.php
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -39,7 +39,7 @@ class ConnectionManager extends Object {
/** /**
* Holds a loaded instance of the Connections object * Holds a loaded instance of the Connections object
* *
* @var object * @var DATABASE_CONFIG
* @access public * @access public
*/ */
var $config = null; var $config = null;
@ -85,7 +85,7 @@ class ConnectionManager extends Object {
/** /**
* Gets a reference to a DataSource object * Gets a reference to a DataSource object
* *
* @param string $name The name of the DataSource, as defined in app/config/connections * @param string $name The name of the DataSource, as defined in app/config/database.php
* @return object Instance * @return object Instance
* @access public * @access public
* @static * @static
@ -145,8 +145,9 @@ class ConnectionManager extends Object {
/** /**
* Loads the DataSource class for the given connection name * Loads the DataSource class for the given connection name
* *
* @param mixed $connName A string name of the connection, as defined in Connections config, * @param mixed $connName A string name of the connection, as defined in app/config/database.php,
* or an array containing the file and class name of the object. * or an array containing the filename (without extension) and class name of the object,
* to be found in app/models/datasources/ or cake/libs/model/datasources/.
* @return boolean True on success, null on failure or false if the class is already loaded * @return boolean True on success, null on failure or false if the class is already loaded
* @access public * @access public
* @static * @static

View file

@ -221,7 +221,7 @@ class Model extends Overloadable {
/** /**
* Holds the Behavior objects currently bound to this model. * Holds the Behavior objects currently bound to this model.
* *
* @var object * @var BehaviorCollection
* @access public * @access public
*/ */
var $Behaviors = null; var $Behaviors = null;
@ -2343,9 +2343,15 @@ class Model extends Overloadable {
$this->exists(); $this->exists();
$_validate = $this->validate; $_validate = $this->validate;
if (array_key_exists('fieldList', $options) && is_array($options['fieldList']) && !empty($options['fieldList'])) { $whitelist = $this->whitelist;
if (array_key_exists('fieldList', $options)) {
$whitelist = $options['fieldList'];
}
if (!empty($whitelist)) {
$validate = array(); $validate = array();
foreach ($options['fieldList'] as $f) { foreach ((array)$whitelist as $f) {
if (!empty($this->validate[$f])) { if (!empty($this->validate[$f])) {
$validate[$f] = $this->validate[$f]; $validate[$f] = $this->validate[$f];
} }

View file

@ -38,7 +38,7 @@ class Object {
/** /**
* Log object * Log object
* *
* @var object * @var CakeLog
* @access protected * @access protected
*/ */
var $_log = null; var $_log = null;
@ -248,7 +248,11 @@ class Object {
$objectArray = array(&$object); $objectArray = array(&$object);
$data = str_replace('\\', '\\\\', serialize($objectArray)); $data = str_replace('\\', '\\\\', serialize($objectArray));
$data = '<?php $' . $name . ' = \'' . str_replace('\'', '\\\'', $data) . '\' ?>'; $data = '<?php $' . $name . ' = \'' . str_replace('\'', '\\\'', $data) . '\' ?>';
cache($file, $data, '+1 day'); $duration = '+999 days';
if (Configure::read() >= 1) {
$duration = '+10 seconds';
}
cache($file, $data, $duration);
} }
/** /**
* Open the persistent class file for reading * Open the persistent class file for reading
@ -267,14 +271,16 @@ class Object {
case 'registry': case 'registry':
$vars = unserialize(${$name}); $vars = unserialize(${$name});
foreach ($vars['0'] as $key => $value) { foreach ($vars['0'] as $key => $value) {
App::import('Model', Inflector::classify($key)); if (strpos($key, '_behavior') !== false) {
App::import('Behavior', Inflector::classify(substr($key, 0, -9)));
} else {
App::import('Model', Inflector::classify($key));
}
unset ($value);
} }
unset($vars); unset($vars);
$vars = unserialize(${$name}); $vars = unserialize(${$name});
foreach ($vars['0'] as $key => $value) { foreach ($vars['0'] as $key => $value) {
foreach ($vars['0'][$key]->Behaviors->_attached as $behavior) {
App::import('Behavior', $behavior);
}
ClassRegistry::addObject($key, $value); ClassRegistry::addObject($key, $value);
unset ($value); unset ($value);
} }

View file

@ -349,7 +349,9 @@ class CakeSession extends Object {
if (empty($var)) { if (empty($var)) {
return false; return false;
} }
$this->watchKeys[] = $var; if (!in_array($var, $this->watchKeys, true)) {
$this->watchKeys[] = $var;
}
} }
/** /**
* Tells Session to stop watching a given key path * Tells Session to stop watching a given key path
@ -571,10 +573,8 @@ class CakeSession extends Object {
$this->__setError(1, 'Session Highjacking Attempted !!!'); $this->__setError(1, 'Session Highjacking Attempted !!!');
} }
} else { } else {
srand ((double)microtime() * 1000000);
$this->write('Config.userAgent', $this->_userAgent); $this->write('Config.userAgent', $this->_userAgent);
$this->write('Config.time', $this->sessionTime); $this->write('Config.time', $this->sessionTime);
$this->write('Config.rand', mt_rand());
$this->write('Config.timeout', 10); $this->write('Config.timeout', 10);
$this->valid = true; $this->valid = true;
$this->__setError(1, 'Session is valid'); $this->__setError(1, 'Session is valid');

View file

@ -374,12 +374,12 @@ class Set extends Object {
$data = $path; $data = $path;
$path = $tmp; $path = $tmp;
} }
if (empty($data)) {
return array();
}
if (strpos($path, '/') === false) { if (strpos($path, '/') === false) {
return Set::classicExtract($data, $path); return Set::classicExtract($data, $path);
} }
if (empty($data)) {
return array();
}
if ($path === '/') { if ($path === '/') {
return $data; return $data;
} }

View file

@ -42,14 +42,14 @@ class AjaxHelper extends AppHelper {
/** /**
* HtmlHelper instance * HtmlHelper instance
* *
* @var object * @var HtmlHelper
* @access public * @access public
*/ */
var $Html = null; var $Html = null;
/** /**
* JavaScriptHelper instance * JavaScriptHelper instance
* *
* @var object * @var JavaScriptHelper
* @access public * @access public
*/ */
var $Javascript = null; var $Javascript = null;

View file

@ -52,7 +52,7 @@ class CacheHelper extends AppHelper {
/** /**
* holds the View object passed in final call to CacheHelper::cache() * holds the View object passed in final call to CacheHelper::cache()
* *
* @var object * @var View
* @access public * @access public
*/ */
var $view; var $view;

View file

@ -79,6 +79,13 @@ class MediaView extends View {
'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh', 'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh',
'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml', 'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml',
'mime' => 'www/mime', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-pdb'); 'mime' => 'www/mime', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-pdb');
/**
* Holds headers sent to browser before rendering media
*
* @var array
* @access protected
*/
var $_headers = array();
/** /**
* Constructor * Constructor
* *
@ -148,13 +155,14 @@ class MediaView extends View {
)); ));
} }
foreach($contentTypes as $contentType) { foreach($contentTypes as $contentType) {
header('Content-Type: ' . $contentType); $this->_header('Content-Type: ' . $contentType);
} }
header('Content-Disposition: attachment; filename="' . $name . '.' . $extension . '";'); $this->_header(array(
header('Expires: 0'); 'Content-Disposition: attachment; filename="' . $name . '.' . $extension . '";',
header('Accept-Ranges: bytes'); 'Expires: 0',
header('Cache-Control: private', false); 'Accept-Ranges: bytes',
header('Pragma: private'); 'Cache-Control: private' => false,
'Pragma: private'));
$httpRange = env('HTTP_RANGE'); $httpRange = env('HTTP_RANGE');
if (isset($httpRange)) { if (isset($httpRange)) {
@ -163,30 +171,36 @@ class MediaView extends View {
$size = $fileSize - 1; $size = $fileSize - 1;
$length = $fileSize - $range; $length = $fileSize - $range;
header('HTTP/1.1 206 Partial Content'); $this->_header(array(
header('Content-Length: ' . $length); 'HTTP/1.1 206 Partial Content',
header('Content-Range: bytes ' . $range . $size . '/' . $fileSize); 'Content-Length: ' . $length,
'Content-Range: bytes ' . $range . $size . '/' . $fileSize));
fseek($handle, $range); fseek($handle, $range);
} else { } else {
header('Content-Length: ' . $fileSize); $this->_header('Content-Length: ' . $fileSize);
} }
} else { } else {
header('Date: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); $this->_header('Date: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
if ($cache) { if ($cache) {
if (!is_numeric($cache)) { if (!is_numeric($cache)) {
$cache = strtotime($cache) - time(); $cache = strtotime($cache) - time();
} }
header('Cache-Control: max-age=' . $cache); $this->_header(array(
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $cache) . ' GMT'); 'Cache-Control: max-age=' . $cache,
header('Pragma: cache'); 'Expires: ' . gmdate('D, d M Y H:i:s', time() + $cache) . ' GMT',
'Pragma: cache'));
} else { } else {
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); $this->_header(array(
header('Pragma: no-cache'); 'Cache-Control: must-revalidate, post-check=0, pre-check=0',
'Pragma: no-cache'));
} }
header('Last-Modified: ' . $modified); $this->_header(array(
header('Content-Type: ' . $this->mimeType[$extension]); 'Last-Modified: ' . $modified,
header('Content-Length: ' . $fileSize); 'Content-Type: ' . $this->mimeType[$extension],
'Content-Length: ' . $fileSize));
} }
$this->_output();
@ob_end_clean(); @ob_end_clean();
while (!feof($handle) && connection_status() == 0 && !connection_aborted()) { while (!feof($handle) && connection_status() == 0 && !connection_aborted()) {
@ -201,5 +215,35 @@ class MediaView extends View {
} }
return false; return false;
} }
/**
* Method to set headers
* @param mixed $header
* @param boolean $boolean
* @access protected
*/
function _header($header, $boolean = true) {
if (is_array($header)) {
foreach ($header as $string => $boolean) {
if (is_numeric($string)) {
$this->_headers[] = array($boolean => true);
} else {
$this->_headers[] = array($string => $boolean);
}
}
return;
}
$this->_headers[] = array($header => $boolean);
return;
}
/**
* Method to output headers
* @access protected
*/
function _output() {
foreach ($this->_headers as $key => $value) {
$header = key($value);
header($header, $value[$header]);
}
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * BasicsTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases * @subpackage cake.tests.cases
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -29,7 +29,7 @@ App::import('Core', 'Folder');
/** /**
* BasicsTest class * BasicsTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases * @subpackage cake.tests.cases
*/ */
class BasicsTest extends CakeTestCase { class BasicsTest extends CakeTestCase {
@ -119,6 +119,8 @@ class BasicsTest extends CakeTestCase {
* @return void * @return void
*/ */
function testUses() { function testUses() {
$this->skipIf(class_exists('Security') || class_exists('Sanitize'), 'Security and/or Sanitize class already loaded');
$this->assertFalse(class_exists('Security')); $this->assertFalse(class_exists('Security'));
$this->assertFalse(class_exists('Sanitize')); $this->assertFalse(class_exists('Sanitize'));
@ -532,15 +534,17 @@ class BasicsTest extends CakeTestCase {
ob_start(); ob_start();
debug('this-is-a-test'); debug('this-is-a-test');
$result = ob_get_clean(); $result = ob_get_clean();
$pattern = '/.*' . preg_quote(substr(__FILE__, 1), '/') $pattern = '/.*\>(cake(\/|\\\)tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
. '.*line.*' . (__LINE__ - 3) . '.*this-is-a-test.*/s'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*this-is-a-test.*/s';
$this->assertPattern($pattern, $result); $this->assertPattern($pattern, $result);
ob_start(); ob_start();
debug('<div>this-is-a-test</div>', true); debug('<div>this-is-a-test</div>', true);
$result = ob_get_clean(); $result = ob_get_clean();
$pattern = '/.*' . preg_quote(substr(__FILE__, 1), '/') $pattern = '/.*\>(cake(\/|\\\)tests(\/|\\\)cases(\/|\\\)basics\.test\.php|';
. '.*line.*' . (__LINE__ - 3) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s'; $pattern .= preg_quote(substr(__FILE__, 1), '/') . ')';
$pattern .= '.*line.*' . (__LINE__ - 4) . '.*&lt;div&gt;this-is-a-test&lt;\/div&gt;.*/s';
$this->assertPattern($pattern, $result); $this->assertPattern($pattern, $result);
} }
/** /**

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ShellDispatcherTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2007, Cake Software Foundation, Inc. * @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console * @subpackage cake.tests.cases.console
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -76,7 +76,6 @@ class TestShellDispatcher extends ShellDispatcher {
* @return void * @return void
*/ */
function _initEnvironment() { function _initEnvironment() {
//
} }
/** /**
* stderr method * stderr method
@ -111,9 +110,9 @@ class TestShellDispatcher extends ShellDispatcher {
} }
} }
/** /**
* Short description for class. * ShellDispatcherTest
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class ShellDispatcherTest extends UnitTestCase { class ShellDispatcherTest extends UnitTestCase {
@ -128,10 +127,11 @@ class ShellDispatcherTest extends UnitTestCase {
$this->pluginPaths = Configure::read('pluginPaths'); $this->pluginPaths = Configure::read('pluginPaths');
$this->shellPaths = Configure::read('shellPaths'); $this->shellPaths = Configure::read('shellPaths');
} }
Configure::write('pluginPaths', array(
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
));
Configure::write('shellPaths', array( Configure::write('shellPaths', array(
ROOT . DS . CONSOLE_LIBS, CORE_PATH ? CONSOLE_LIBS : ROOT . DS . CONSOLE_LIBS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS
)); ));
} }
@ -406,14 +406,18 @@ class ShellDispatcherTest extends UnitTestCase {
*/ */
function testBuildPaths() { function testBuildPaths() {
$Dispatcher =& new TestShellDispatcher(); $Dispatcher =& new TestShellDispatcher();
$this->assertEqual($Dispatcher->shellPaths, array(
$result = $Dispatcher->shellPaths;
$expected = array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'vendors' . DS . 'shells' . DS, TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'vendors' . DS . 'shells' . DS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS . 'vendors' . DS . 'shells' . DS, TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS . 'vendors' . DS . 'shells' . DS,
APP . 'vendors' . DS . 'shells' . DS, APP . 'vendors' . DS . 'shells' . DS,
VENDORS . 'shells' . DS, VENDORS . 'shells' . DS,
ROOT . DS . CONSOLE_LIBS, CORE_PATH ? CONSOLE_LIBS : ROOT . DS . CONSOLE_LIBS,
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS, TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS,
)); );
$this->assertIdentical(array_diff($result, $expected), array());
$this->assertIdentical(array_diff($expected, $result), array());
} }
/** /**
* testDispatch method * testDispatch method
@ -440,32 +444,26 @@ class ShellDispatcherTest extends UnitTestCase {
function testHelpCommand() { function testHelpCommand() {
$Dispatcher =& new TestShellDispatcher(); $Dispatcher =& new TestShellDispatcher();
$expected = "/ ROOT(\\\|\/)cake(\\\|\/)tests(\\\|\/)test_app(\\\|\/)plugins(\\\|\/)test_plugin(\\\|\/)vendors(\\\|\/)shells:"; $expected = "/ CORE(\\\|\/)tests(\\\|\/)test_app(\\\|\/)plugins(\\\|\/)test_plugin(\\\|\/)vendors(\\\|\/)shells:";
$expected .= "\n\t example"; $expected .= "\n\t example";
$expected .= "\n/"; $expected .= "\n/";
$this->assertPattern($expected, $Dispatcher->stdout); $this->assertPattern($expected, $Dispatcher->stdout);
// Shells need to be returned ordered $expected = "/ CORE(\\\|\/)tests(\\\|\/)test_app(\\\|\/)plugins(\\\|\/)test_plugin_two(\\\|\/)vendors(\\\|\/)shells:";
// See Configure::__list/Folder::read
$expected = "/ ROOT(\\\|\/)cake(\\\|\/)tests(\\\|\/)test_app(\\\|\/)plugins(\\\|\/)test_plugin_two(\\\|\/)vendors(\\\|\/)shells:";
$expected .= "\n\t example"; $expected .= "\n\t example";
$expected .= "\n\t welcome"; $expected .= "\n\t welcome";
$expected .= "\n/"; $expected .= "\n/";
$this->assertPattern($expected, $Dispatcher->stdout); $this->assertPattern($expected, $Dispatcher->stdout);
$expected = "/ ROOT(\\\|\/)app(\\\|\/)vendors(\\\|\/)shells:"; $expected = "/ APP(\\\|\/)vendors(\\\|\/)shells:";
$expected .= "\n\t - none";
$expected .= "\n/"; $expected .= "\n/";
$this->assertPattern($expected, $Dispatcher->stdout); $this->assertPattern($expected, $Dispatcher->stdout);
$expected = "/ ROOT(\\\|\/)vendors(\\\|\/)shells:"; $expected = "/ ROOT(\\\|\/)vendors(\\\|\/)shells:";
$expected .= "\n\t - none";
$expected .= "\n/"; $expected .= "\n/";
$this->assertPattern($expected, $Dispatcher->stdout); $this->assertPattern($expected, $Dispatcher->stdout);
// Shells need to be returned ordered $expected = "/ CORE(\\\|\/)console(\\\|\/)libs:";
// See Configure::__list/Folder::read
$expected = "/ ROOT(\\\|\/)cake(\\\|\/)console(\\\|\/)libs:";
$expected .= "\n\t acl"; $expected .= "\n\t acl";
$expected .= "\n\t api"; $expected .= "\n\t api";
$expected .= "\n\t bake"; $expected .= "\n\t bake";
@ -476,7 +474,7 @@ class ShellDispatcherTest extends UnitTestCase {
$expected .= "\n/"; $expected .= "\n/";
$this->assertPattern($expected, $Dispatcher->stdout); $this->assertPattern($expected, $Dispatcher->stdout);
$expected = "/ ROOT(\\\|\/)cake(\\\|\/)tests(\\\|\/)test_app(\\\|\/)vendors(\\\|\/)shells:"; $expected = "/ CORE(\\\|\/)tests(\\\|\/)test_app(\\\|\/)vendors(\\\|\/)shells:";
$expected .= "\n\t sample"; $expected .= "\n\t sample";
$expected .= "\n/"; $expected .= "\n/";
$this->assertPattern($expected, $Dispatcher->stdout); $this->assertPattern($expected, $Dispatcher->stdout);

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Test Case for Shell * ShellTest file
* *
* Long description for file * Test Case for Shell
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2006-2008, Cake Software Foundation, Inc. * @copyright Copyright 2006-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs * @subpackage cake.tests.cases.console.libs
* @since CakePHP v 1.2.0.7726 * @since CakePHP v 1.2.0.7726
* @version $Revision$ * @version $Revision$
@ -44,7 +44,7 @@ Mock::generatePartial(
/** /**
* TestShell class * TestShell class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs * @subpackage cake.tests.cases.console.libs
*/ */
class TestShell extends Shell { class TestShell extends Shell {
@ -52,7 +52,7 @@ class TestShell extends Shell {
/** /**
* TestAppleTask class * TestAppleTask class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs * @subpackage cake.tests.cases.console.libs
*/ */
class TestAppleTask extends Shell { class TestAppleTask extends Shell {
@ -60,7 +60,7 @@ class TestAppleTask extends Shell {
/** /**
* TestBananaTask class * TestBananaTask class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs * @subpackage cake.tests.cases.console.libs
*/ */
class TestBananaTask extends Shell { class TestBananaTask extends Shell {
@ -68,7 +68,7 @@ class TestBananaTask extends Shell {
/** /**
* ShellTest class * ShellTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs * @subpackage cake.tests.cases.console.libs
*/ */
class ShellTest extends CakeTestCase { class ShellTest extends CakeTestCase {

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id: extract.test.php 7838 2008-11-07 10:41:52Z nate $ */ /* SVN FILE: $Id$ */
/** /**
* Test Case for i18n extraction shell task * ExtractTaskTest file
* *
* Long description for file * Test Case for i18n extraction shell task
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -16,12 +16,12 @@
* @filesource * @filesource
* @copyright Copyright 2006-2008, Cake Software Foundation, Inc. * @copyright Copyright 2006-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs.tasks * @subpackage cake.tests.cases.console.libs.tasks
* @since CakePHP v 1.2.0.7726 * @since CakePHP v 1.2.0.7726
* @version $Revision: 7838 $ * @version $Revision$
* @modifiedby $LastChangedBy: DarkAngelBGE $ * @modifiedby $LastChangedBy$
* @lastmodified $Date: 2008-11-07 05:41:52 -0500 (Fri, 07 Nov 2008) $ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
App::import('Core', array('Shell', 'Folder')); App::import('Core', array('Shell', 'Folder'));
@ -45,11 +45,10 @@ Mock::generatePartial(
'ShellDispatcher', 'TestExtractTaskMockShellDispatcher', 'ShellDispatcher', 'TestExtractTaskMockShellDispatcher',
array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment')
); );
/** /**
* ExtractTaskTest class * ExtractTaskTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs.tasks * @subpackage cake.tests.cases.console.libs.tasks
*/ */
class ExtractTaskTest extends CakeTestCase { class ExtractTaskTest extends CakeTestCase {

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Test Case for test generation shell task * TestTaskTest file
* *
* Long description for file * Test Case for test generation shell task
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2006-2008, Cake Software Foundation, Inc. * @copyright Copyright 2006-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs.tasks * @subpackage cake.tests.cases.console.libs.tasks
* @since CakePHP v 1.2.0.7726 * @since CakePHP v 1.2.0.7726
* @version $Revision$ * @version $Revision$
@ -52,7 +52,7 @@ Mock::generatePartial(
/** /**
* TestTaskTest class * TestTaskTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.console.libs.tasks * @subpackage cake.tests.cases.console.libs.tasks
*/ */
class TestTaskTest extends CakeTestCase { class TestTaskTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * DispatcherTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases * @subpackage cake.tests.cases
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -72,7 +72,6 @@ class TestDispatcher extends Dispatcher {
function _stop() { function _stop() {
return true; return true;
} }
} }
/** /**
* MyPluginAppController class * MyPluginAppController class
@ -81,7 +80,6 @@ class TestDispatcher extends Dispatcher {
* @subpackage cake.tests.cases * @subpackage cake.tests.cases
*/ */
class MyPluginAppController extends AppController { class MyPluginAppController extends AppController {
} }
/** /**
* MyPluginController class * MyPluginController class
@ -182,7 +180,6 @@ class SomePagesController extends AppController {
function _protected() { function _protected() {
return true; return true;
} }
/** /**
* redirect method overriding * redirect method overriding
* *
@ -264,7 +261,6 @@ class TestDispatchPagesController extends AppController {
function admin_index() { function admin_index() {
return true; return true;
} }
/** /**
* camelCased method * camelCased method
* *
@ -282,7 +278,6 @@ class TestDispatchPagesController extends AppController {
* @subpackage cake.tests.cases * @subpackage cake.tests.cases
*/ */
class ArticlesTestAppController extends AppController { class ArticlesTestAppController extends AppController {
} }
/** /**
* ArticlesTestController class * ArticlesTestController class
@ -481,9 +476,9 @@ class TimesheetsController extends AppController {
} }
} }
/** /**
* Short description for class. * DispatcherTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases * @subpackage cake.tests.cases
*/ */
class DispatcherTest extends CakeTestCase { class DispatcherTest extends CakeTestCase {
@ -502,6 +497,15 @@ class DispatcherTest extends CakeTestCase {
Configure::write('App.webroot', 'webroot'); Configure::write('App.webroot', 'webroot');
Configure::write('Cache.disable', true); Configure::write('Cache.disable', true);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
$_GET = $this->_get;
}
/** /**
* testParseParamsWithoutZerosAndEmptyPost method * testParseParamsWithoutZerosAndEmptyPost method
* *
@ -2088,14 +2092,5 @@ class DispatcherTest extends CakeTestCase {
} }
return $filename; return $filename;
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
$_GET = $this->_get;
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * CacheTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -28,9 +28,9 @@ if (!class_exists('Cache')) {
require LIBS . 'cache.php'; require LIBS . 'cache.php';
} }
/** /**
* Short description for class. * CacheTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class CacheTest extends CakeTestCase { class CacheTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ApcEngineTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.cache * @subpackage cake.tests.cases.libs.cache
* @since CakePHP(tm) v 1.2.0.5434 * @since CakePHP(tm) v 1.2.0.5434
* @version $Revision$ * @version $Revision$
@ -28,9 +28,9 @@ if (!class_exists('Cache')) {
require LIBS . 'cache.php'; require LIBS . 'cache.php';
} }
/** /**
* Short description for class. * ApcEngineTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.cache * @subpackage cake.tests.cases.libs.cache
*/ */
class ApcEngineTest extends UnitTestCase { class ApcEngineTest extends UnitTestCase {
@ -56,6 +56,15 @@ class ApcEngineTest extends UnitTestCase {
function setUp() { function setUp() {
Cache::config('apc', array('engine'=>'Apc', 'prefix' => 'cake_')); Cache::config('apc', array('engine'=>'Apc', 'prefix' => 'cake_'));
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
Cache::config('default');
}
/** /**
* testReadAndWriteCache method * testReadAndWriteCache method
* *
@ -127,14 +136,5 @@ class ApcEngineTest extends UnitTestCase {
$result = Cache::delete('delete_test'); $result = Cache::delete('delete_test');
$this->assertTrue($result); $this->assertTrue($result);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
Cache::config('default');
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * FileEngineTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.cache * @subpackage cake.tests.cases.libs.cache
* @since CakePHP(tm) v 1.2.0.5434 * @since CakePHP(tm) v 1.2.0.5434
* @version $Revision$ * @version $Revision$
@ -31,9 +31,9 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
} }
/** /**
* Short description for class. * FileEngineTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.cache * @subpackage cake.tests.cases.libs.cache
*/ */
class FileEngineTest extends CakeTestCase { class FileEngineTest extends CakeTestCase {
@ -331,7 +331,12 @@ class FileEngineTest extends CakeTestCase {
Cache::delete('test_dir_map'); Cache::delete('test_dir_map');
$this->assertEqual($expected, $data); $this->assertEqual($expected, $data);
} }
/**
* testWriteQuotedString method
*
* @access public
* @return void
*/
function testWriteQuotedString() { function testWriteQuotedString() {
Cache::engine('File', array('path' => TMP . 'tests')); Cache::engine('File', array('path' => TMP . 'tests'));
Cache::write('App.doubleQuoteTest', '"this is a quoted string"'); Cache::write('App.doubleQuoteTest', '"this is a quoted string"');

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * MemcacheEngineTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.cache * @subpackage cake.tests.cases.libs.cache
* @since CakePHP(tm) v 1.2.0.5434 * @since CakePHP(tm) v 1.2.0.5434
* @version $Revision$ * @version $Revision$
@ -27,9 +27,9 @@
if (!class_exists('Cache')) { if (!class_exists('Cache')) {
require LIBS . 'cache.php'; require LIBS . 'cache.php';
}/** }/**
* Short description for class. * MemcacheEngineTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.cache * @subpackage cake.tests.cases.libs.cache
*/ */
/** /**
@ -129,7 +129,6 @@ class MemcacheEngineTest extends CakeTestCase {
$result = $Cache->_Engine['Memcache']->connect('127.0.0.1'); $result = $Cache->_Engine['Memcache']->connect('127.0.0.1');
$this->assertTrue($result); $this->assertTrue($result);
} }
/** /**
* testReadAndWriteCache method * testReadAndWriteCache method
* *

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * XcacheEngineTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.cache * @subpackage cake.tests.cases.libs.cache
* @since CakePHP(tm) v 1.2.0.5434 * @since CakePHP(tm) v 1.2.0.5434
* @version $Revision$ * @version $Revision$
@ -28,9 +28,9 @@ if (!class_exists('Cache')) {
require LIBS . 'cache.php'; require LIBS . 'cache.php';
} }
/** /**
* Short description for class. * XcacheEngineTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.cache * @subpackage cake.tests.cases.libs.cache
*/ */
class XcacheEngineTest extends UnitTestCase { class XcacheEngineTest extends UnitTestCase {
@ -56,6 +56,15 @@ class XcacheEngineTest extends UnitTestCase {
function setUp() { function setUp() {
Cache::config('xcache', array('engine'=>'Xcache', 'prefix' => 'cake_')); Cache::config('xcache', array('engine'=>'Xcache', 'prefix' => 'cake_'));
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
Cache::config('default');
}
/** /**
* testSettings method * testSettings method
* *
@ -156,14 +165,5 @@ class XcacheEngineTest extends UnitTestCase {
$result = Cache::clear(); $result = Cache::clear();
$this->assertTrue($result); $this->assertTrue($result);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
Cache::config('default');
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * CakeLogTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'Log'); App::import('Core', 'Log');
/** /**
* Short description for class. * CakeLogTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class CakeLogTest extends CakeTestCase { class CakeLogTest extends CakeTestCase {
@ -52,5 +52,4 @@ class CakeLogTest extends CakeTestCase {
unlink(LOGS . 'error.log'); unlink(LOGS . 'error.log');
} }
} }
?> ?>

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* CakeTestCase TestCase * CakeTestCaseTest file
* *
* Test Case for CakeTestCase Class * Test Case for CakeTestCase class
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -32,13 +32,12 @@ Mock::generate('CakeTestCase', 'CakeDispatcherMockTestCase');
SimpleTest::ignore('SubjectCakeTestCase'); SimpleTest::ignore('SubjectCakeTestCase');
SimpleTest::ignore('CakeDispatcherMockTestCase'); SimpleTest::ignore('CakeDispatcherMockTestCase');
/** /**
* SubjectCakeTestCase * SubjectCakeTestCase
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class SubjectCakeTestCase extends CakeTestCase { class SubjectCakeTestCase extends CakeTestCase {
/** /**
* Feed a Mocked Reporter to the subject case * Feed a Mocked Reporter to the subject case
@ -51,18 +50,21 @@ class SubjectCakeTestCase extends CakeTestCase {
function setReporter(&$reporter) { function setReporter(&$reporter) {
$this->_reporter = &$reporter; $this->_reporter = &$reporter;
} }
/**
* testDummy method
*
* @return void
* @access public
*/
function testDummy() { function testDummy() {
} }
} }
/** /**
* CakeTestCaseTest * CakeTestCaseTest
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
**/ */
class CakeTestCaseTest extends CakeTestCase { class CakeTestCaseTest extends CakeTestCase {
/** /**
* setUp * setUp
@ -76,6 +78,16 @@ class CakeTestCaseTest extends CakeTestCase {
$this->Case->setReporter($reporter); $this->Case->setReporter($reporter);
$this->Reporter = $reporter; $this->Reporter = $reporter;
} }
/**
* tearDown
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Case);
unset($this->Reporter);
}
/** /**
* testAssertGoodTags * testAssertGoodTags
* *
@ -214,7 +226,6 @@ class CakeTestCaseTest extends CakeTestCase {
$this->assertEqual(array_slice($result, 0, 2), array('start', 'startCase')); $this->assertEqual(array_slice($result, 0, 2), array('start', 'startCase'));
$this->assertEqual(array_slice($result, -2), array('endCase', 'end')); $this->assertEqual(array_slice($result, -2), array('endCase', 'end'));
} }
/** /**
* TestTestAction * TestTestAction
* *
@ -396,15 +407,5 @@ class CakeTestCaseTest extends CakeTestCase {
Configure::write('viewPaths', $_back['view']); Configure::write('viewPaths', $_back['view']);
Configure::write('pluginPaths', $_back['plugin']); Configure::write('pluginPaths', $_back['plugin']);
} }
/**
* tearDown
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Case);
unset($this->Reporter);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * CakeTestFixture file
* *
* Long description for file * Long description for file
* *
@ -25,9 +25,8 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', 'DboSource'); App::import('Core', 'DboSource');
/** /**
* CakeFixture Test Fixture * CakeTestFixtureTestFixture class
* *
* @package cake * @package cake
* @subpackage cake.cake.tests.cases.libs * @subpackage cake.cake.tests.cases.libs
@ -66,10 +65,8 @@ class CakeTestFixtureTestFixture extends CakeTestFixture {
array('name' => 'Chewbacca') array('name' => 'Chewbacca')
); );
} }
/** /**
* Import Fixture Test Fixture * CakeTestFixtureImportFixture class
* *
* @package cake * @package cake
* @subpackage cake.cake.tests.cases.libs * @subpackage cake.cake.tests.cases.libs
@ -88,9 +85,8 @@ class CakeTestFixtureImportFixture extends CakeTestFixture {
*/ */
var $import = array('table' => 'fixture_tests', 'connection' => 'test_suite'); var $import = array('table' => 'fixture_tests', 'connection' => 'test_suite');
} }
/** /**
* Import Fixture Test Fixture * CakeTestFixtureDefaultImportFixture class
* *
* @package cake * @package cake
* @subpackage cake.cake.tests.cases.libs * @subpackage cake.cake.tests.cases.libs
@ -103,9 +99,8 @@ class CakeTestFixtureDefaultImportFixture extends CakeTestFixture {
*/ */
var $name = 'ImportFixture'; var $name = 'ImportFixture';
} }
/** /**
* Fixture Test Case Model * FixtureImportTestModel class
* *
* @package default * @package default
* @subpackage cake.cake.tests.cases.libs. * @subpackage cake.cake.tests.cases.libs.
@ -115,9 +110,7 @@ class FixtureImportTestModel extends Model {
var $useTable = 'fixture_tests'; var $useTable = 'fixture_tests';
var $useDbConfig = 'test_suite'; var $useDbConfig = 'test_suite';
} }
Mock::generate('DboSource', 'FixtureMockDboSource'); Mock::generate('DboSource', 'FixtureMockDboSource');
/** /**
* Test case for CakeTestFixture * Test case for CakeTestFixture
* *
@ -125,10 +118,25 @@ Mock::generate('DboSource', 'FixtureMockDboSource');
* @subpackage cake.cake.tests.cases.libs * @subpackage cake.cake.tests.cases.libs
*/ */
class CakeTestFixtureTest extends CakeTestCase { class CakeTestFixtureTest extends CakeTestCase {
/**
* setUp method
*
* @access public
* @return void
*/
function setUp() { function setUp() {
$this->criticDb =& new FixtureMockDboSource(); $this->criticDb =& new FixtureMockDboSource();
$this->criticDb->fullDebug = true; $this->criticDb->fullDebug = true;
} }
/**
* tearDown
*
* @access public
* @return void
*/
function tearDown() {
unset($this->criticDb);
}
/** /**
* testInit * testInit
* *
@ -215,8 +223,9 @@ class CakeTestFixtureTest extends CakeTestCase {
/** /**
* test create method * test create method
* *
* @access public
* @return void * @return void
**/ */
function testCreate() { function testCreate() {
$Fixture =& new CakeTestFixtureTestFixture(); $Fixture =& new CakeTestFixtureTestFixture();
$this->criticDb->expectAtLeastOnce('execute'); $this->criticDb->expectAtLeastOnce('execute');
@ -229,12 +238,12 @@ class CakeTestFixtureTest extends CakeTestCase {
$return = $Fixture->create($this->criticDb); $return = $Fixture->create($this->criticDb);
$this->assertFalse($return); $this->assertFalse($return);
} }
/** /**
* test the insert method * test the insert method
* *
* @access public
* @return void * @return void
**/ */
function testInsert() { function testInsert() {
$Fixture =& new CakeTestFixtureTestFixture(); $Fixture =& new CakeTestFixtureTestFixture();
$this->criticDb->setReturnValue('insertMulti', true); $this->criticDb->setReturnValue('insertMulti', true);
@ -244,12 +253,12 @@ class CakeTestFixtureTest extends CakeTestCase {
$this->assertTrue($this->criticDb->fullDebug); $this->assertTrue($this->criticDb->fullDebug);
$this->assertTrue($return); $this->assertTrue($return);
} }
/** /**
* Test the drop method * Test the drop method
* *
* @access public
* @return void * @return void
**/ */
function testDrop() { function testDrop() {
$Fixture =& new CakeTestFixtureTestFixture(); $Fixture =& new CakeTestFixtureTestFixture();
$this->criticDb->setReturnValueAt(0, 'execute', true); $this->criticDb->setReturnValueAt(0, 'execute', true);
@ -267,22 +276,14 @@ class CakeTestFixtureTest extends CakeTestCase {
/** /**
* Test the truncate method. * Test the truncate method.
* *
* @access public
* @return void * @return void
**/ */
function testTruncate() { function testTruncate() {
$Fixture =& new CakeTestFixtureTestFixture(); $Fixture =& new CakeTestFixtureTestFixture();
$this->criticDb->expectAtLeastOnce('truncate'); $this->criticDb->expectAtLeastOnce('truncate');
$Fixture->truncate($this->criticDb); $Fixture->truncate($this->criticDb);
$this->assertTrue($this->criticDb->fullDebug); $this->assertTrue($this->criticDb->fullDebug);
} }
/**
* tearDown
*
* @access public
* @return void
*/
function tearDown() {
unset($this->criticDb);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ClassRegistryTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -28,7 +28,7 @@ App::import('Core', 'ClassRegistry');
/** /**
* ClassRegisterModel class * ClassRegisterModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class ClassRegisterModel extends CakeTestModel { class ClassRegisterModel extends CakeTestModel {
@ -43,7 +43,7 @@ class ClassRegisterModel extends CakeTestModel {
/** /**
* RegisterArticle class * RegisterArticle class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class RegisterArticle extends ClassRegisterModel { class RegisterArticle extends ClassRegisterModel {
@ -58,7 +58,7 @@ class RegisterArticle extends ClassRegisterModel {
/** /**
* RegisterArticleFeatured class * RegisterArticleFeatured class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class RegisterArticleFeatured extends ClassRegisterModel { class RegisterArticleFeatured extends ClassRegisterModel {
@ -73,7 +73,7 @@ class RegisterArticleFeatured extends ClassRegisterModel {
/** /**
* RegisterArticleTag class * RegisterArticleTag class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class RegisterArticleTag extends ClassRegisterModel { class RegisterArticleTag extends ClassRegisterModel {
@ -88,7 +88,7 @@ class RegisterArticleTag extends ClassRegisterModel {
/** /**
* RegistryPluginAppModel class * RegistryPluginAppModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class RegistryPluginAppModel extends ClassRegisterModel { class RegistryPluginAppModel extends ClassRegisterModel {
@ -103,7 +103,7 @@ class RegistryPluginAppModel extends ClassRegisterModel {
/** /**
* TestRegistryPluginModel class * TestRegistryPluginModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class TestRegistryPluginModel extends RegistryPluginAppModel { class TestRegistryPluginModel extends RegistryPluginAppModel {
@ -118,7 +118,7 @@ class TestRegistryPluginModel extends RegistryPluginAppModel {
/** /**
* RegisterCategory class * RegisterCategory class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class RegisterCategory extends ClassRegisterModel { class RegisterCategory extends ClassRegisterModel {
@ -133,7 +133,7 @@ class RegisterCategory extends ClassRegisterModel {
/** /**
* ClassRegistryTest class * ClassRegistryTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class ClassRegistryTest extends CakeTestCase { class ClassRegistryTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * CodeCoverageManagerTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -28,13 +28,20 @@ App::import('Core', 'CodeCoverageManager');
require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php'; require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php';
require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_reporter.php'; require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_reporter.php';
/** /**
* Short description for class. * CodeCoverageManagerTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class CodeCoverageManagerTest extends CakeTestCase { class CodeCoverageManagerTest extends CakeTestCase {
/**
* Skip if XDebug not installed
*
* @access public
*/
function skip() {
$this->skipif (!extension_loaded('xdebug'), 'XDebug not installed');
}
/** /**
* startTest Method * startTest Method
* Store reference of $_GET to restore later. * Store reference of $_GET to restore later.
@ -44,7 +51,6 @@ class CodeCoverageManagerTest extends CakeTestCase {
function startCase() { function startCase() {
$this->_get = $_GET; $this->_get = $_GET;
} }
/** /**
* End Case - restore GET vars. * End Case - restore GET vars.
* *
@ -53,14 +59,6 @@ class CodeCoverageManagerTest extends CakeTestCase {
function endCase() { function endCase() {
$_GET = $this->_get; $_GET = $this->_get;
} }
/**
* Skip if XDebug not installed
*
* @access public
*/
function skip() {
$this->skipif (!extension_loaded('xdebug'), 'XDebug not installed');
}
/** /**
* testNoTestCaseSupplied method * testNoTestCaseSupplied method
* *

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ConfigureTest file
* *
* Long description for file * Holds several tests
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -24,12 +24,11 @@
* @lastmodified $Date$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', 'Configure'); App::import('Core', 'Configure');
/** /**
* Short description for class. * ConfigureTest
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class ConfigureTest extends CakeTestCase { class ConfigureTest extends CakeTestCase {
@ -149,7 +148,6 @@ class ConfigureTest extends CakeTestCase {
$result = Configure::read('SomeName.someKey'); $result = Configure::read('SomeName.someKey');
$this->assertEqual($result, null); $this->assertEqual($result, null);
} }
/** /**
* testSetErrorReporting Level * testSetErrorReporting Level
* *
@ -537,5 +535,4 @@ class AppImportTest extends UnitTestCase {
$this->assertEqual($text, 'This is the welcome.php file in test_plugin/vendors directory'); $this->assertEqual($text, 'This is the welcome.php file in test_plugin/vendors directory');
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ComponentTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
* @since CakePHP(tm) v 1.2.0.5436 * @since CakePHP(tm) v 1.2.0.5436
* @version $Revision$ * @version $Revision$
@ -70,7 +70,8 @@ if (!class_exists('AppController')) {
/** /**
* ParamTestComponent * ParamTestComponent
* *
* @package cake.tests.cases.libs.controller * @package cake
* @subpackage cake.tests.cases.libs.controller
*/ */
class ParamTestComponent extends Object { class ParamTestComponent extends Object {
/** /**
@ -106,9 +107,9 @@ class ParamTestComponent extends Object {
} }
} }
/** /**
* Short description for class. * ComponentTestController class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class ComponentTestController extends AppController { class ComponentTestController extends AppController {
@ -185,7 +186,13 @@ class OrangeComponent extends Object {
$this->Banana->testField = 'OrangeField'; $this->Banana->testField = 'OrangeField';
$this->settings = $settings; $this->settings = $settings;
} }
/**
* startup method
*
* @param Controller $controller
* @return string
* @access public
*/
function startup(&$controller) { function startup(&$controller) {
$controller->foo = 'pass'; $controller->foo = 'pass';
} }
@ -204,7 +211,13 @@ class BananaComponent extends Object {
* @access public * @access public
*/ */
var $testField = 'BananaField'; var $testField = 'BananaField';
/**
* startup method
*
* @param Controller $controller
* @return string
* @access public
*/
function startup(&$controller) { function startup(&$controller) {
$controller->bar = 'fail'; $controller->bar = 'fail';
} }
@ -216,6 +229,12 @@ class BananaComponent extends Object {
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class MutuallyReferencingOneComponent extends Object { class MutuallyReferencingOneComponent extends Object {
/**
* components property
*
* @var array
* @access public
*/
var $components = array('MutuallyReferencingTwo'); var $components = array('MutuallyReferencingTwo');
} }
/** /**
@ -225,9 +244,14 @@ class MutuallyReferencingOneComponent extends Object {
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class MutuallyReferencingTwoComponent extends Object { class MutuallyReferencingTwoComponent extends Object {
/**
* components property
*
* @var array
* @access public
*/
var $components = array('MutuallyReferencingOne'); var $components = array('MutuallyReferencingOne');
} }
/** /**
* SomethingWithEmailComponent class * SomethingWithEmailComponent class
* *
@ -235,6 +259,12 @@ class MutuallyReferencingTwoComponent extends Object {
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class SomethingWithEmailComponent extends Object { class SomethingWithEmailComponent extends Object {
/**
* components property
*
* @var array
* @access public
*/
var $components = array('Email'); var $components = array('Email');
} }
/** /**
@ -458,5 +488,4 @@ class ComponentTest extends CakeTestCase {
$this->assertEqual($Controller->components, array('Session' => '', 'Orange' => array('colour' => 'blood orange'))); $this->assertEqual($Controller->components, array('Session' => '', 'Orange' => array('colour' => 'blood orange')));
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * AclComponentTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
* @since CakePHP(tm) v 1.2.0.5435 * @since CakePHP(tm) v 1.2.0.5435
* @version $Revision$ * @version $Revision$
@ -28,7 +28,6 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); 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 * AclNodeTwoTestBase class
* *
@ -179,13 +178,11 @@ class DbAclTwoTest extends DbAcl {
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class IniAclTest extends IniAcl { class IniAclTest extends IniAcl {
} }
/** /**
* Short description for class. * Short description for class.
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class AclComponentTest extends CakeTestCase { class AclComponentTest extends CakeTestCase {
@ -217,6 +214,15 @@ class AclComponentTest extends CakeTestCase {
Configure::write('Acl.database', 'test_suite'); Configure::write('Acl.database', 'test_suite');
parent::before($method); parent::before($method);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Acl);
}
/** /**
* testAclCreate method * testAclCreate method
* *
@ -543,15 +549,6 @@ class AclComponentTest extends CakeTestCase {
$this->assertFalse($this->Acl->check('nobody', 'comments')); $this->assertFalse($this->Acl->check('nobody', 'comments'));
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Acl);
}
/** /**
* debug function - to help editing/creating test cases for the ACL component * debug function - to help editing/creating test cases for the ACL component
* *

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * AutComponentTest file
* *
* Long description for file * Long description for file
* *
@ -30,9 +30,9 @@ App::import('Core', 'Xml');
Configure::write('Security.salt', 'JfIxfs2guVoUubWDYhG93b0qyJfIxfs2guwvniR2G0FgaC9mi'); Configure::write('Security.salt', 'JfIxfs2guVoUubWDYhG93b0qyJfIxfs2guwvniR2G0FgaC9mi');
/** /**
* Short description for class. * TestAuthComponent class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class TestAuthComponent extends AuthComponent { class TestAuthComponent extends AuthComponent {
@ -61,9 +61,9 @@ class TestAuthComponent extends AuthComponent {
} }
} }
/** /**
* Short description for class. * AuthUser class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class AuthUser extends CakeTestModel { class AuthUser extends CakeTestModel {
@ -117,12 +117,12 @@ class AuthUser extends CakeTestModel {
} }
} }
/** /**
* Short description for class. * AuthUserCustomField class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class AuthUserCustomField extends AuthUser{ class AuthUserCustomField extends AuthUser {
/** /**
* name property * name property
* *
@ -132,9 +132,9 @@ class AuthUserCustomField extends AuthUser{
var $name = 'AuthUserCustomField'; var $name = 'AuthUserCustomField';
} }
/** /**
* Short description for class. * UuidUser class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class UuidUser extends CakeTestModel { class UuidUser extends CakeTestModel {
@ -195,9 +195,9 @@ class UuidUser extends CakeTestModel {
} }
} }
/** /**
* Short description for class. * AuthTestController class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class AuthTestController extends Controller { class AuthTestController extends Controller {
@ -271,7 +271,7 @@ class AuthTestController extends Controller {
* @return void * @return void
*/ */
function logout() { function logout() {
//$this->redirect($this->Auth->logout()); // $this->redirect($this->Auth->logout());
} }
/** /**
* add method * add method
@ -403,9 +403,9 @@ class AjaxAuthController extends Controller {
} }
} }
/** /**
* Short description for class. * AuthTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class AuthTest extends CakeTestCase { class AuthTest extends CakeTestCase {
@ -448,6 +448,15 @@ class AuthTest extends CakeTestCase {
$this->Controller->Session->del('Message.auth'); $this->Controller->Session->del('Message.auth');
$this->initialized = true; $this->initialized = true;
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Controller, $this->AuthUser);
}
/** /**
* testNoAuth method * testNoAuth method
* *
@ -622,7 +631,6 @@ class AuthTest extends CakeTestCase {
$result = $this->Controller->Auth->isAuthorized(); $result = $this->Controller->Auth->isAuthorized();
$this->assertFalse($result); $this->assertFalse($result);
} }
/** /**
* testAuthorizeCrud method * testAuthorizeCrud method
* *
@ -815,6 +823,18 @@ class AuthTest extends CakeTestCase {
$expected = Router::normalize('posts/view/1'); $expected = Router::normalize('posts/view/1');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect')); $this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
// QueryString parameters
$this->Controller->Session->del('Auth');
$url = '/posts/index/29?print=true&refer=menu';
$this->Controller->params = Router::parse($url);
$this->Controller->params['url']['url'] = Router::normalize($url);
$this->Controller->Auth->initialize($this->Controller);
$this->Controller->Auth->loginAction = array('controller' => 'AuthTest', 'action' => 'login');
$this->Controller->Auth->userModel = 'AuthUser';
$this->Controller->Auth->startup($this->Controller);
$expected = Router::normalize('posts/index/29?print=true&refer=menu');
$this->assertEqual($expected, $this->Controller->Session->read('Auth.redirect'));
//external authed action //external authed action
$_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message'; $_SERVER['HTTP_REFERER'] = 'http://webmail.example.com/view/message';
$this->Controller->Session->del('Auth'); $this->Controller->Session->del('Auth');
@ -1035,7 +1055,6 @@ class AuthTest extends CakeTestCase {
$user = $this->Controller->Auth->user(); $user = $this->Controller->Auth->user();
$this->assertTrue(!!$user); $this->assertTrue(!!$user);
} }
/** /**
* testCustomField method * testCustomField method
* *
@ -1070,7 +1089,6 @@ class AuthTest extends CakeTestCase {
$user = $this->Controller->Auth->user(); $user = $this->Controller->Auth->user();
$this->assertTrue(!!$user); $this->assertTrue(!!$user);
} }
/** /**
* testAdminRoute method * testAdminRoute method
* *
@ -1177,14 +1195,5 @@ class AuthTest extends CakeTestCase {
$this->Controller->Auth->shutdown($this->Controller); $this->Controller->Auth->shutdown($this->Controller);
$this->assertFalse($this->Controller->Session->read('Auth.redirect')); $this->assertFalse($this->Controller->Session->read('Auth.redirect'));
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Controller, $this->AuthUser);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * CookieComponentTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
* @since CakePHP(tm) v 1.2.0.5435 * @since CakePHP(tm) v 1.2.0.5435
* @version $Revision$ * @version $Revision$
@ -25,9 +25,26 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', array('Component', 'Controller', 'Cookie')); App::import('Core', array('Component', 'Controller', 'Cookie'));
/**
* CookieComponentTestController class
*
* @package cake
* @subpackage cake.tests.cases.libs.controller.components
*/
class CookieComponentTestController extends Controller { class CookieComponentTestController extends Controller {
/**
* components property
*
* @var array
* @access public
*/
var $components = array('Cookie'); var $components = array('Cookie');
/**
* beforeFilter method
*
* @access public
* @return void
*/
function beforeFilter() { function beforeFilter() {
$this->Cookie->name = 'CakeTestCookie'; $this->Cookie->name = 'CakeTestCookie';
$this->Cookie->time = 10; $this->Cookie->time = 10;
@ -38,29 +55,19 @@ class CookieComponentTestController extends Controller {
} }
} }
/** /**
* Short description for class. * CookieComponentTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class CookieComponentTest extends CakeTestCase { class CookieComponentTest extends CakeTestCase {
/**
* Controller property
*
* @var CookieComponentTestController
* @access public
*/
var $Controller; var $Controller;
function __encrypt($value) {
if (is_array($value)) {
$value = $this->__implode($value);
}
return "Q2FrZQ==." .base64_encode(Security::cipher($value, $this->Controller->Cookie->key));
}
function __implode($array) {
$string = '';
foreach ($array as $key => $value) {
$string .= ',' . $key . '|' . $value;
}
return substr($string, 1);
}
/** /**
* start * start
* *
@ -75,6 +82,15 @@ class CookieComponentTest extends CakeTestCase {
$this->Controller->Component->startup($this->Controller); $this->Controller->Component->startup($this->Controller);
$this->Controller->Cookie->destroy(); $this->Controller->Cookie->destroy();
} }
/**
* end
*
* @access public
* @return void
*/
function end() {
$this->Controller->Cookie->destroy();
}
/** /**
* testCookieName * testCookieName
* *
@ -393,13 +409,31 @@ class CookieComponentTest extends CakeTestCase {
unset($_COOKIE['CakeTestCookie']); unset($_COOKIE['CakeTestCookie']);
} }
/** /**
* end * encrypt method
* *
* @access public * @param mixed $value
* @return void * @return string
* @access private
*/ */
function end() { function __encrypt($value) {
$this->Controller->Cookie->destroy(); if (is_array($value)) {
$value = $this->__implode($value);
}
return "Q2FrZQ==." . base64_encode(Security::cipher($value, $this->Controller->Cookie->key));
}
/**
* implode method
*
* @param array $value
* @return string
* @access private
*/
function __implode($array) {
$string = '';
foreach ($array as $key => $value) {
$string .= ',' . $key . '|' . $value;
}
return substr($string, 1);
} }
} }
?> ?>

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Series of tests for email component. * EmailComponentTest file
* *
* Long description for file * Series of tests for email component.
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -54,7 +54,12 @@ class EmailTestController extends Controller {
* @access public * @access public
*/ */
var $components = array('Email'); var $components = array('Email');
/**
* pageTitle property
*
* @var string
* @access public
*/
var $pageTitle = 'EmailTest'; var $pageTitle = 'EmailTest';
} }
/** /**
@ -63,7 +68,14 @@ class EmailTestController extends Controller {
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class EmailTest extends CakeTestCase { class EmailComponentTest extends CakeTestCase {
/**
* Controller property
*
* @var EmailTestController
* @access public
*/
var $Controller;
/** /**
* name property * name property
* *
@ -369,7 +381,12 @@ TEXTBLOC;
$expected = "Previous content\n--alt-\n text/html; utf-8\n 7bit\n\n<p>My own html content</p>"; $expected = "Previous content\n--alt-\n text/html; utf-8\n 7bit\n\n<p>My own html content</p>";
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/**
* testMultibyte method
*
* @access public
* @return void
*/
function testMultibyte() { function testMultibyte() {
$this->Controller->Email->reset(); $this->Controller->Email->reset();
$this->Controller->Email->to = 'postmaster@localhost'; $this->Controller->Email->to = 'postmaster@localhost';
@ -396,10 +413,15 @@ TEXTBLOC;
preg_match('/Subject: (.*)Header:/s', $this->Controller->Session->read('Message.email.message'), $matches); preg_match('/Subject: (.*)Header:/s', $this->Controller->Session->read('Message.email.message'), $matches);
$this->assertEqual(trim($matches[1]), $subject); $this->assertEqual(trim($matches[1]), $subject);
} }
/**
* osFix method
*
* @param string $string
* @access private
* @return string
*/
function __osFix($string) { function __osFix($string) {
return str_replace(array("\r\n", "\r"), "\n", $string); return str_replace(array("\r\n", "\r"), "\n", $string);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * RequestHandlerComponentTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
* @since CakePHP(tm) v 1.2.0.5435 * @since CakePHP(tm) v 1.2.0.5435
* @version $Revision$ * @version $Revision$
@ -92,18 +92,37 @@ class RequestHandlerTestDisabledController extends Controller {
} }
parent::__construct(); parent::__construct();
} }
/**
* beforeFilter method
*
* @return void
* @access public
*/
function beforeFilter() { function beforeFilter() {
$this->RequestHandler->enabled = false; $this->RequestHandler->enabled = false;
} }
} }
/** /**
* Short description for class. * RequestHandlerComponentTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class RequestHandlerComponentTest extends CakeTestCase { class RequestHandlerComponentTest extends CakeTestCase {
/**
* Controller property
*
* @var RequestHandlerTestController
* @access public
*/
var $Controller;
/**
* RequestHandler property
*
* @var RequestHandlerComponent
* @access public
*/
var $RequestHandler;
/** /**
* setUp method * setUp method
* *
@ -114,15 +133,17 @@ class RequestHandlerComponentTest extends CakeTestCase {
$this->_init(); $this->_init();
} }
/** /**
* init method * tearDown method
* *
* @access protected * @access public
* @return void * @return void
*/ */
function _init() { function tearDown() {
$this->Controller = new RequestHandlerTestController(array('components' => array('RequestHandler'))); unset($this->RequestHandler);
$this->Controller->constructClasses(); unset($this->Controller);
$this->RequestHandler =& $this->Controller->RequestHandler; if (!headers_sent()) {
header('Content-type: text/html'); //reset content type.
}
} }
/** /**
* testInitializeCallback method * testInitializeCallback method
@ -481,17 +502,15 @@ class RequestHandlerComponentTest extends CakeTestCase {
unset($_SERVER['HTTP_X_REQUESTED_WITH']); unset($_SERVER['HTTP_X_REQUESTED_WITH']);
} }
/** /**
* tearDown method * init method
* *
* @access public * @access protected
* @return void * @return void
*/ */
function tearDown() { function _init() {
unset($this->RequestHandler); $this->Controller = new RequestHandlerTestController(array('components' => array('RequestHandler')));
unset($this->Controller); $this->Controller->constructClasses();
if (!headers_sent()) { $this->RequestHandler =& $this->Controller->RequestHandler;
header('Content-type: text/html'); //reset content type.
}
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * SecurityComponentTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
* @since CakePHP(tm) v 1.2.0.5435 * @since CakePHP(tm) v 1.2.0.5435
* @version $Revision$ * @version $Revision$
@ -25,22 +25,27 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Component', 'Security'); App::import('Component', 'Security');
/** /**
* Short description for class. * TestSecurityComponent
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class TestSecurityComponent extends SecurityComponent { class TestSecurityComponent extends SecurityComponent {
/**
* validatePost method
*
* @param Controller $controller
* @return unknown
*/
function validatePost(&$controller) { function validatePost(&$controller) {
return $this->_validatePost($controller); return $this->_validatePost($controller);
} }
} }
/** /**
* Short description for class. * SecurityTestController
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class SecurityTestController extends Controller { class SecurityTestController extends Controller {
@ -104,14 +109,27 @@ class SecurityTestController extends Controller {
$this->testHeaders[] = $status; $this->testHeaders[] = $status;
} }
} }
/** /**
* Short description for class. * SecurityComponentTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class SecurityComponentTest extends CakeTestCase { class SecurityComponentTest extends CakeTestCase {
/**
* Controller property
*
* @var SecurityTestController
* @access public
*/
var $Controller;
/**
* oldSalt property
*
* @var string
* @access public
*/
var $oldSalt;
/** /**
* setUp method * setUp method
* *
@ -128,7 +146,7 @@ class SecurityComponentTest extends CakeTestCase {
Configure::write('Security.salt', 'foo!'); Configure::write('Security.salt', 'foo!');
} }
/** /**
* Tear-down method. Resets environment state. * Tear-down method. Resets environment state.
* *
* @access public * @access public
* @return void * @return void
@ -139,7 +157,6 @@ class SecurityComponentTest extends CakeTestCase {
unset($this->Controller); unset($this->Controller);
Configure::write('Security.salt', $this->oldSalt); Configure::write('Security.salt', $this->oldSalt);
} }
/** /**
* testStartup method * testStartup method
* *
@ -584,7 +601,6 @@ DIGEST;
$result = $this->Controller->Security->validatePost($this->Controller); $result = $this->Controller->Security->validatePost($this->Controller);
$this->assertTrue($result); $this->assertTrue($result);
} }
/** /**
* test ValidatePost with multiple select elements. * test ValidatePost with multiple select elements.
* *
@ -776,7 +792,6 @@ DIGEST;
$result = $this->Controller->Security->validatePost($this->Controller); $result = $this->Controller->Security->validatePost($this->Controller);
$this->assertTrue($result); $this->assertTrue($result);
} }
/** /**
* testValidateHasManyRecordsPass method * testValidateHasManyRecordsPass method
* *
@ -1079,5 +1094,4 @@ DIGEST;
$this->assertEqual(current($this->Controller->testHeaders), $expected); $this->assertEqual(current($this->Controller->testHeaders), $expected);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * SessionComponentTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
* @since CakePHP(tm) v 1.2.0.5436 * @since CakePHP(tm) v 1.2.0.5436
* @version $Revision$ * @version $Revision$
@ -29,12 +29,23 @@ App::import('Component', 'Session');
/** /**
* SessionTestController class * SessionTestController class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class SessionTestController extends Controller { class SessionTestController extends Controller {
/**
* uses property
*
* @var array
* @access public
*/
var $uses = array(); var $uses = array();
/**
* session_id method
*
* @return string
* @access public
*/
function session_id() { function session_id() {
return $this->Session->id(); return $this->Session->id();
} }
@ -42,20 +53,31 @@ class SessionTestController extends Controller {
/** /**
* OrangeSessionTestController class * OrangeSessionTestController class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class OrangeSessionTestController extends Controller { class OrangeSessionTestController extends Controller {
/**
* uses property
*
* @var array
* @access public
*/
var $uses = array(); var $uses = array();
/**
* session_id method
*
* @return string
* @access public
*/
function session_id() { function session_id() {
return $this->Session->id(); return $this->Session->id();
} }
} }
/** /**
* Short description for class. * SessionComponentTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class SessionComponentTest extends CakeTestCase { class SessionComponentTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ControllerTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
* @since CakePHP(tm) v 1.2.0.5436 * @since CakePHP(tm) v 1.2.0.5436
* @version $Revision$ * @version $Revision$
@ -69,7 +69,7 @@ if (!class_exists('AppController')) {
/** /**
* ControllerPost class * ControllerPost class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class ControllerPost extends CakeTestModel { class ControllerPost extends CakeTestModel {
@ -146,7 +146,7 @@ class ControllerCommentsController extends AppController {
/** /**
* ControllerComment class * ControllerComment class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class ControllerComment extends CakeTestModel { class ControllerComment extends CakeTestModel {
@ -182,7 +182,7 @@ class ControllerComment extends CakeTestModel {
/** /**
* ControllerAlias class * ControllerAlias class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class ControllerAlias extends CakeTestModel { class ControllerAlias extends CakeTestModel {
@ -211,7 +211,7 @@ class ControllerAlias extends CakeTestModel {
/** /**
* ControllerPaginateModel class * ControllerPaginateModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class ControllerPaginateModel extends CakeTestModel { class ControllerPaginateModel extends CakeTestModel {
@ -336,7 +336,6 @@ class TestComponent extends Object {
* @return void * @return void
*/ */
function beforeRedirect() { function beforeRedirect() {
return true;
} }
} }
/** /**
@ -352,7 +351,6 @@ class AnotherTestController extends AppController {
* @access public * @access public
*/ */
var $name = 'AnotherTest'; var $name = 'AnotherTest';
/** /**
* uses property * uses property
* *
@ -362,9 +360,9 @@ class AnotherTestController extends AppController {
var $uses = null; var $uses = null;
} }
/** /**
* Short description for class. * ControllerTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class ControllerTest extends CakeTestCase { class ControllerTest extends CakeTestCase {
@ -417,7 +415,12 @@ class ControllerTest extends CakeTestCase {
Configure::write('pluginPaths', $_back['pluginPaths']); Configure::write('pluginPaths', $_back['pluginPaths']);
unset($Controller); unset($Controller);
} }
/**
* testAliasName method
*
* @access public
* @return void
*/
function testAliasName() { function testAliasName() {
$Controller =& new Controller(); $Controller =& new Controller();
$Controller->uses = array('NameTest'); $Controller->uses = array('NameTest');
@ -428,7 +431,6 @@ class ControllerTest extends CakeTestCase {
unset($Controller); unset($Controller);
} }
/** /**
* testPersistent method * testPersistent method
* *
@ -735,7 +737,6 @@ class ControllerTest extends CakeTestCase {
* @return void * @return void
*/ */
function testRedirect() { function testRedirect() {
$url = 'cakephp.org';
$codes = array( $codes = array(
100 => "Continue", 100 => "Continue",
101 => "Switching Protocols", 101 => "Switching Protocols",
@ -779,26 +780,85 @@ class ControllerTest extends CakeTestCase {
); );
Mock::generatePartial('Controller', 'MockController', array('header')); Mock::generatePartial('Controller', 'MockController', array('header'));
Mock::generate('TestComponent', 'MockTestComponent');
Mock::generate('TestComponent', 'MockTestBComponent');
App::import('Helper', 'Cache'); App::import('Helper', 'Cache');
// $codes = array_merge($codes, array_flip($codes));
foreach ($codes as $code => $msg) { foreach ($codes as $code => $msg) {
$MockController =& new MockController(); $MockController =& new MockController();
$MockController->components = array('Test');
$MockController->Component =& new Component(); $MockController->Component =& new Component();
$MockController->Component->init($MockController); $MockController->Component->init($MockController);
$MockController->expectAt(0, 'header', array("HTTP/1.1 {$code} {$msg}"));
$MockController->expectAt(1, 'header', array('Location: http://cakephp.org'));
$MockController->expectCallCount('header', 2); $MockController->expectCallCount('header', 2);
$MockController->redirect($url, (int) $code, false); $MockController->redirect('http://cakephp.org', (int)$code, false);
$this->assertFalse($MockController->autoRender);
} }
$codes = array_flip($codes);
foreach ($codes as $code => $msg) { foreach ($codes as $code => $msg) {
$MockController =& new MockController(); $MockController =& new MockController();
$MockController->components = array('Test');
$MockController->Component =& new Component(); $MockController->Component =& new Component();
$MockController->Component->init($MockController); $MockController->Component->init($MockController);
$MockController->expectAt(0, 'header', array("HTTP/1.1 {$code} {$msg}"));
$MockController->expectAt(1, 'header', array('Location: http://cakephp.org'));
$MockController->expectCallCount('header', 2); $MockController->expectCallCount('header', 2);
$MockController->redirect($url, $code, false); $MockController->redirect('http://cakephp.org', $msg, false);
$this->assertFalse($MockController->autoRender);
} }
$MockController =& new MockController();
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->expectAt(0, 'header', array('Location: http://www.example.org/users/login'));
$MockController->expectCallCount('header', 1);
$MockController->redirect('http://www.example.org/users/login', null, false);
$MockController =& new MockController();
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->expectAt(0, 'header', array('HTTP/1.1 301 Moved Permanently'));
$MockController->expectAt(1, 'header', array('Location: http://www.example.org/users/login'));
$MockController->expectCallCount('header', 2);
$MockController->redirect('http://www.example.org/users/login', 301, false);
$MockController =& new MockController();
$MockController->components = array('MockTest');
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', null);
$MockController->expectAt(0, 'header', array('HTTP/1.1 301 Moved Permanently'));
$MockController->expectAt(1, 'header', array('Location: http://cakephp.org'));
$MockController->expectCallCount('header', 2);
$MockController->redirect('http://cakephp.org', 301, false);
$MockController =& new MockController();
$MockController->components = array('MockTest');
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', 'http://book.cakephp.org');
$MockController->expectAt(0, 'header', array('HTTP/1.1 301 Moved Permanently'));
$MockController->expectAt(1, 'header', array('Location: http://book.cakephp.org'));
$MockController->expectCallCount('header', 2);
$MockController->redirect('http://cakephp.org', 301, false);
$MockController =& new MockController();
$MockController->components = array('MockTest');
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', false);
$MockController->expectNever('header');
$MockController->redirect('http://cakephp.org', 301, false);
$MockController =& new MockController();
$MockController->components = array('MockTest', 'MockTestB');
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', 'http://book.cakephp.org');
$MockController->MockTestB->setReturnValue('beforeRedirect', 'http://bakery.cakephp.org');
$MockController->expectAt(0, 'header', array('HTTP/1.1 301 Moved Permanently'));
$MockController->expectAt(1, 'header', array('Location: http://bakery.cakephp.org'));
$MockController->expectCallCount('header', 2);
$MockController->redirect('http://cakephp.org', 301, false);
} }
/** /**
* testMergeVars method * testMergeVars method

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * PagesControllerTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
* @since CakePHP(tm) v 1.2.0.5436 * @since CakePHP(tm) v 1.2.0.5436
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', array('Controller', 'AppController', 'PagesController')); App::import('Core', array('Controller', 'AppController', 'PagesController'));
/** /**
* Short description for class. * PagesControllerTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class PagesControllerTest extends CakeTestCase { class PagesControllerTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ScaffoldTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
* @since CakePHP(tm) v 1.2.0.5436 * @since CakePHP(tm) v 1.2.0.5436
* @version $Revision$ * @version $Revision$
@ -47,9 +47,8 @@ class ScaffoldMockController extends Controller {
*/ */
var $scaffold; var $scaffold;
} }
/** /**
* TestScaffoldMock * TestScaffoldMock class
* *
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
@ -72,7 +71,6 @@ class TestScaffoldMock extends Scaffold {
return $this->_params; return $this->_params;
} }
} }
/** /**
* ScaffoldMock class * ScaffoldMock class
* *
@ -112,9 +110,8 @@ class ScaffoldMock extends CakeTestModel {
) )
); );
} }
/** /**
* ScaffoldAuthor class * ScaffoldUser class
* *
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
@ -140,7 +137,6 @@ class ScaffoldUser extends CakeTestModel {
) )
); );
} }
/** /**
* ScaffoldComment class * ScaffoldComment class
* *
@ -168,7 +164,6 @@ class ScaffoldComment extends CakeTestModel {
) )
); );
} }
/** /**
* TestScaffoldView class * TestScaffoldView class
* *
@ -188,9 +183,9 @@ class TestScaffoldView extends ScaffoldView {
} }
} }
/** /**
* ScaffoldViewTest Case. * ScaffoldViewTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class ScaffoldViewTest extends CakeTestCase { class ScaffoldViewTest extends CakeTestCase {
@ -210,6 +205,15 @@ class ScaffoldViewTest extends CakeTestCase {
function setUp() { function setUp() {
$this->Controller =& new ScaffoldMockController(); $this->Controller =& new ScaffoldMockController();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Controller);
}
/** /**
* testGetViewFilename method * testGetViewFilename method
* *
@ -298,7 +302,6 @@ class ScaffoldViewTest extends CakeTestCase {
Configure::write('pluginPaths', $_back['pluginPaths']); Configure::write('pluginPaths', $_back['pluginPaths']);
Configure::write('Routing.admin', $_admin); Configure::write('Routing.admin', $_admin);
} }
/** /**
* test default index scaffold generation * test default index scaffold generation
* *
@ -505,26 +508,21 @@ class ScaffoldViewTest extends CakeTestCase {
Configure::write('Routing.admin', $_backAdmin); Configure::write('Routing.admin', $_backAdmin);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Controller);
}
} }
/** /**
* Scaffold Test Case * Scaffold Test class
* *
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.controller * @subpackage cake.tests.cases.libs.controller
*/ */
class ScaffoldTestCase extends CakeTestCase { class ScaffoldTest extends CakeTestCase {
/**
* Controller property
*
* @var SecurityTestController
* @access public
*/
var $Controller;
/** /**
* fixtures property * fixtures property
* *
@ -541,6 +539,15 @@ class ScaffoldTestCase extends CakeTestCase {
function setUp() { function setUp() {
$this->Controller =& new ScaffoldMockController(); $this->Controller =& new ScaffoldMockController();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Controller);
}
/** /**
* Test the correct Generation of Scaffold Params. * Test the correct Generation of Scaffold Params.
* This ensures that the correct action and view will be generated * This ensures that the correct action and view will be generated
@ -573,15 +580,5 @@ class ScaffoldTestCase extends CakeTestCase {
$result = $Scaffold->getParams(); $result = $Scaffold->getParams();
$this->assertEqual($result['action'], 'admin_edit'); $this->assertEqual($result['action'], 'admin_edit');
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Controller);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * DebuggerTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -26,23 +26,24 @@
*/ */
App::import('Core', 'Debugger'); App::import('Core', 'Debugger');
/** /**
* DebugggerTestCaseDebuggger * DebugggerTestCaseDebuggger class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class DebuggerTestCaseDebugger extends Debugger { class DebuggerTestCaseDebugger extends Debugger {
} }
/** /**
* Debugger Test Case. * DebuggerTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class DebuggerTest extends CakeTestCase { class DebuggerTest extends CakeTestCase {
// !!!
//do not move code below or it change line numbers which are used in the tests // !!! Be careful with changing code below as it may
// !!! change line numbers which are used in the tests
// !!!
/** /**
* setUp method * setUp method
* *
@ -59,6 +60,15 @@ class DebuggerTest extends CakeTestCase {
} }
} }
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
Configure::write('log', true);
}
/** /**
* testDocRef method * testDocRef method
* *
@ -71,12 +81,12 @@ class DebuggerTest extends CakeTestCase {
$debugger = new Debugger(); $debugger = new Debugger();
$this->assertEqual(ini_get('docref_root'), 'http://php.net/'); $this->assertEqual(ini_get('docref_root'), 'http://php.net/');
} }
/** /**
* test Excerpt writing * test Excerpt writing
* *
* @access public
* @return void * @return void
**/ */
function testExcerpt() { function testExcerpt() {
$return = Debugger::excerpt(__FILE__, 2, 2); $return = Debugger::excerpt(__FILE__, 2, 2);
$this->assertTrue(is_array($return)); $this->assertTrue(is_array($return));
@ -247,12 +257,12 @@ class DebuggerTest extends CakeTestCase {
$expected = "<pre>array(\n\t\"People\" => array()\n)</pre>"; $expected = "<pre>array(\n\t\"People\" => array()\n)</pre>";
$this->assertEqual($expected, $result); $this->assertEqual($expected, $result);
} }
/** /**
* test getInstance. * test getInstance.
* *
* @access public
* @return void * @return void
**/ */
function testGetInstance() { function testGetInstance() {
$result = Debugger::getInstance(); $result = Debugger::getInstance();
$this->assertIsA($result, 'Debugger'); $this->assertIsA($result, 'Debugger');
@ -266,15 +276,5 @@ class DebuggerTest extends CakeTestCase {
$result = Debugger::getInstance('Debugger'); $result = Debugger::getInstance('Debugger');
$this->assertIsA($result, 'Debugger'); $this->assertIsA($result, 'Debugger');
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
Configure::write('log', true);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ErrorHandlerTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -27,15 +27,13 @@
if (class_exists('TestErrorHandler')) { if (class_exists('TestErrorHandler')) {
return; return;
} }
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
} }
/** /**
* BlueberryComponent class * BlueberryComponent class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class BlueberryComponent extends Object { class BlueberryComponent extends Object {
@ -59,7 +57,7 @@ class BlueberryComponent extends Object {
/** /**
* BlueberryDispatcher class * BlueberryDispatcher class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class BlueberryDispatcher extends Dispatcher { class BlueberryDispatcher extends Dispatcher {
@ -77,7 +75,7 @@ class BlueberryDispatcher extends Dispatcher {
/** /**
* Short description for class. * Short description for class.
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class AuthBlueberryUser extends CakeTestModel { class AuthBlueberryUser extends CakeTestModel {
@ -100,7 +98,7 @@ if (!class_exists('AppController')) {
/** /**
* AppController class * AppController class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class AppController extends Controller { class AppController extends Controller {
@ -144,7 +142,7 @@ App::import('Core', array('Error', 'Controller'));
/** /**
* TestErrorController class * TestErrorController class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class TestErrorController extends AppController { class TestErrorController extends AppController {
@ -169,7 +167,7 @@ class TestErrorController extends AppController {
/** /**
* BlueberryController class * BlueberryController class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class BlueberryController extends AppController { class BlueberryController extends AppController {
@ -198,7 +196,7 @@ class BlueberryController extends AppController {
/** /**
* TestErrorHandler class * TestErrorHandler class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class TestErrorHandler extends ErrorHandler { class TestErrorHandler extends ErrorHandler {
@ -213,12 +211,12 @@ class TestErrorHandler extends ErrorHandler {
} }
} }
/** /**
* Short description for class. * ErrorHandlerTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class TestErrorHandlerTest extends CakeTestCase { class ErrorHandlerTest extends CakeTestCase {
/** /**
* skip method * skip method
* *

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * FileTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -25,11 +25,10 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', 'File'); App::import('Core', 'File');
/** /**
* Short description for class. * FileTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class FileTest extends CakeTestCase { class FileTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * FolderTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'File'); App::import('Core', 'File');
/** /**
* Short description for class. * FolderTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class FolderTest extends CakeTestCase { class FolderTest extends CakeTestCase {
@ -271,13 +271,16 @@ class FolderTest extends CakeTestCase {
); );
$result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false); $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false);
$this->assertEqual($result, $expected); $this->assertIdentical(array_diff($expected[0], $result[0]), array());
$this->assertIdentical(array_diff($result[0], $expected[0]), array());
$result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'dir'); $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'dir');
$this->assertEqual($result, $expected[0]); $this->assertIdentical(array_diff($expected[0], $result), array());
$this->assertIdentical(array_diff($result, $expected[0]), array());
$result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'files'); $result = $Folder->tree(TEST_CAKE_CORE_INCLUDE_PATH . 'config', false, 'files');
$this->assertEqual($result, $expected[1]); $this->assertIdentical(array_diff($expected[1], $result), array());
$this->assertIdentical(array_diff($result, $expected[1]), array());
} }
/** /**
* testWindowsPath method * testWindowsPath method
@ -405,10 +408,20 @@ class FolderTest extends CakeTestCase {
$Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config'); $Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config');
$result = $Folder->find(); $result = $Folder->find();
$expected = array('config.php', 'paths.php'); $expected = array('config.php', 'paths.php');
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($result, $expected), array());
$result = $Folder->find('.*', true);
$expected = array('config.php', 'paths.php');
$this->assertIdentical($result, $expected); $this->assertIdentical($result, $expected);
$result = $Folder->find('.*\.php'); $result = $Folder->find('.*\.php');
$expected = array('config.php', 'paths.php'); $expected = array('config.php', 'paths.php');
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($result, $expected), array());
$result = $Folder->find('.*\.php', true);
$expected = array('config.php', 'paths.php');
$this->assertIdentical($result, $expected); $this->assertIdentical($result, $expected);
$result = $Folder->find('.*ig\.php'); $result = $Folder->find('.*ig\.php');
@ -450,6 +463,14 @@ class FolderTest extends CakeTestCase {
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php', TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php' TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php'
); );
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($result, $expected), array());
$result = $Folder->findRecursive('(config|paths)\.php', true);
$expected = array(
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'config.php',
TEST_CAKE_CORE_INCLUDE_PATH . 'config' . DS . 'paths.php'
);
$this->assertIdentical($result, $expected); $this->assertIdentical($result, $expected);
$Folder->cd(TMP); $Folder->cd(TMP);
@ -472,6 +493,14 @@ class FolderTest extends CakeTestCase {
TMP . 'testme' . DS . 'my.php', TMP . 'testme' . DS . 'my.php',
TMP . 'testme' . DS . 'paths.php' TMP . 'testme' . DS . 'paths.php'
); );
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($result, $expected), array());
$result = $Folder->findRecursive('(paths|my)\.php', true);
$expected = array(
TMP . 'testme' . DS . 'my.php',
TMP . 'testme' . DS . 'paths.php'
);
$this->assertIdentical($result, $expected); $this->assertIdentical($result, $expected);
$Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config'); $Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config');

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * HttpSocketTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'HttpSocket'); App::import('Core', 'HttpSocket');
/** /**
* Short description for class. * HttpSocketTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class HttpSocketTest extends CakeTestCase { class HttpSocketTest extends CakeTestCase {
@ -49,6 +49,8 @@ class HttpSocketTest extends CakeTestCase {
/** /**
* This function sets up a TestHttpSocket instance we are going to use for testing * This function sets up a TestHttpSocket instance we are going to use for testing
* *
* @access public
* @return void
*/ */
function setUp() { function setUp() {
if (!class_exists('TestHttpSocket')) { if (!class_exists('TestHttpSocket')) {
@ -62,6 +64,8 @@ class HttpSocketTest extends CakeTestCase {
/** /**
* We use this function to clean up after the test case was executed * We use this function to clean up after the test case was executed
* *
* @access public
* @return void
*/ */
function tearDown() { function tearDown() {
unset($this->Socket, $this->RequestSocket); unset($this->Socket, $this->RequestSocket);
@ -69,6 +73,8 @@ class HttpSocketTest extends CakeTestCase {
/** /**
* Test that HttpSocket::__construct does what one would expect it to do * Test that HttpSocket::__construct does what one would expect it to do
* *
* @access public
* @return void
*/ */
function testConstruct() { function testConstruct() {
$this->Socket->reset(); $this->Socket->reset();
@ -92,10 +98,11 @@ class HttpSocketTest extends CakeTestCase {
$this->Socket->__construct(array('request' => array('uri' => 'http://www.cakephp.org:23/'))); $this->Socket->__construct(array('request' => array('uri' => 'http://www.cakephp.org:23/')));
$this->assertIdentical($this->Socket->config, $baseConfig); $this->assertIdentical($this->Socket->config, $baseConfig);
} }
/** /**
* Test that HttpSocket::configUri works properly with different types of arguments * Test that HttpSocket::configUri works properly with different types of arguments
* *
* @access public
* @return void
*/ */
function testConfigUri() { function testConfigUri() {
$this->Socket->reset(); $this->Socket->reset();
@ -158,10 +165,11 @@ class HttpSocketTest extends CakeTestCase {
$this->assertIdentical($this->Socket->config, $expected); $this->assertIdentical($this->Socket->config, $expected);
$this->assertIdentical($r, false); $this->assertIdentical($r, false);
} }
/** /**
* Tests that HttpSocket::request (the heart of the HttpSocket) is working properly. * Tests that HttpSocket::request (the heart of the HttpSocket) is working properly.
* *
* @access public
* @return void
*/ */
function testRequest() { function testRequest() {
$this->Socket->reset(); $this->Socket->reset();
@ -515,10 +523,11 @@ class HttpSocketTest extends CakeTestCase {
$this->RequestSocket->{low($method)}('http://www.google.com/', null, array('line' => 'Hey Server')); $this->RequestSocket->{low($method)}('http://www.google.com/', null, array('line' => 'Hey Server'));
} }
} }
/** /**
* Enter description here... * testParseResponse method
* *
* @access public
* @return void
*/ */
function testParseResponse() { function testParseResponse() {
$this->Socket->reset(); $this->Socket->reset();
@ -605,10 +614,11 @@ class HttpSocketTest extends CakeTestCase {
} }
} }
} }
/** /**
* Enter description here... * testDecodeBody method
* *
* @access public
* @return void
*/ */
function testDecodeBody() { function testDecodeBody() {
$this->Socket->reset(); $this->Socket->reset();
@ -647,10 +657,11 @@ class HttpSocketTest extends CakeTestCase {
} }
} }
} }
/** /**
* Enter description here... * testDecodeChunkedBody method
* *
* @access public
* @return void
*/ */
function testDecodeChunkedBody() { function testDecodeChunkedBody() {
$this->Socket->reset(); $this->Socket->reset();
@ -763,10 +774,11 @@ class HttpSocketTest extends CakeTestCase {
$r = $this->Socket->buildRequestLine("GET * HTTP/1.1\r\n"); $r = $this->Socket->buildRequestLine("GET * HTTP/1.1\r\n");
$this->assertIdentical($r, "GET * HTTP/1.1\r\n"); $this->assertIdentical($r, "GET * HTTP/1.1\r\n");
} }
/** /**
* Asserts that HttpSocket::parseUri is working properly * Asserts that HttpSocket::parseUri is working properly
* *
* @access public
* @return void
*/ */
function testParseUri() { function testParseUri() {
$this->Socket->reset(); $this->Socket->reset();
@ -867,10 +879,11 @@ class HttpSocketTest extends CakeTestCase {
'port' => 8080, 'port' => 8080,
)); ));
} }
/** /**
* Tests that HttpSocket::buildUri can turn all kinds of uri arrays (and strings) into fully or partially qualified URI's * Tests that HttpSocket::buildUri can turn all kinds of uri arrays (and strings) into fully or partially qualified URI's
* *
* @access public
* @return void
*/ */
function testBuildUri() { function testBuildUri() {
$this->Socket->reset(); $this->Socket->reset();
@ -929,10 +942,11 @@ class HttpSocketTest extends CakeTestCase {
$r = $this->Socket->buildUri(array('scheme' => 'foo', 'host' => 'www.cakephp.org')); $r = $this->Socket->buildUri(array('scheme' => 'foo', 'host' => 'www.cakephp.org'));
$this->assertIdentical($r, 'foo://www.cakephp.org:80/'); $this->assertIdentical($r, 'foo://www.cakephp.org:80/');
} }
/** /**
* Asserts that HttpSocket::parseQuery is working properly * Asserts that HttpSocket::parseQuery is working properly
* *
* @access public
* @return void
*/ */
function testParseQuery() { function testParseQuery() {
$this->Socket->reset(); $this->Socket->reset();
@ -1033,11 +1047,12 @@ class HttpSocketTest extends CakeTestCase {
); );
$this->assertIdentical($query, $expectedQuery); $this->assertIdentical($query, $expectedQuery);
} }
/** /**
* Tests that HttpSocket::buildHeader can turn a given $header array into a proper header string according to * Tests that HttpSocket::buildHeader can turn a given $header array into a proper header string according to
* HTTP 1.1 specs. * HTTP 1.1 specs.
* *
* @access public
* @return void
*/ */
function testBuildHeader() { function testBuildHeader() {
$this->Socket->reset(); $this->Socket->reset();
@ -1070,10 +1085,11 @@ class HttpSocketTest extends CakeTestCase {
$this->assertIdentical($r, "Test\"@\"Field: My value\r\n"); $this->assertIdentical($r, "Test\"@\"Field: My value\r\n");
} }
/** /**
* Test that HttpSocket::parseHeader can take apart a given (and valid) $header string and turn it into an array. * Test that HttpSocket::parseHeader can take apart a given (and valid) $header string and turn it into an array.
* *
* @access public
* @return void
*/ */
function testParseHeader() { function testParseHeader() {
$this->Socket->reset(); $this->Socket->reset();
@ -1131,10 +1147,10 @@ class HttpSocketTest extends CakeTestCase {
$this->assertIdentical($r, $expected); $this->assertIdentical($r, $expected);
} }
/** /**
* undocumented function * testParseCookies method
* *
* @return void
* @access public * @access public
* @return void
*/ */
function testParseCookies() { function testParseCookies() {
$header = array( $header = array(
@ -1168,7 +1184,7 @@ class HttpSocketTest extends CakeTestCase {
$this->assertEqual($cookies, $expected); $this->assertEqual($cookies, $expected);
} }
/** /**
* undocumented function * testBuildCookies method
* *
* @return void * @return void
* @access public * @access public
@ -1191,6 +1207,8 @@ class HttpSocketTest extends CakeTestCase {
/** /**
* Tests that HttpSocket::__tokenEscapeChars() returns the right characters. * Tests that HttpSocket::__tokenEscapeChars() returns the right characters.
* *
* @access public
* @return void
*/ */
function testTokenEscapeChars() { function testTokenEscapeChars() {
$this->Socket->reset(); $this->Socket->reset();
@ -1211,10 +1229,11 @@ class HttpSocketTest extends CakeTestCase {
$r = $this->Socket->__tokenEscapeChars(false); $r = $this->Socket->__tokenEscapeChars(false);
$this->assertEqual($r, $expected); $this->assertEqual($r, $expected);
} }
/** /**
* Test that HttpSocket::escapeToken is escaping all characters as descriped in RFC 2616 (HTTP 1.1 specs) * Test that HttpSocket::escapeToken is escaping all characters as descriped in RFC 2616 (HTTP 1.1 specs)
* *
* @access public
* @return void
*/ */
function testEscapeToken() { function testEscapeToken() {
$this->Socket->reset(); $this->Socket->reset();
@ -1235,10 +1254,11 @@ class HttpSocketTest extends CakeTestCase {
$expectedToken = 'Extreme-":"Token-" "-""""@"-test'; $expectedToken = 'Extreme-":"Token-" "-""""@"-test';
$this->assertIdentical($expectedToken, $escapedToken); $this->assertIdentical($expectedToken, $escapedToken);
} }
/** /**
* Test that escaped token strings are properly unescaped by HttpSocket::unescapeToken * Test that escaped token strings are properly unescaped by HttpSocket::unescapeToken
* *
* @access public
* @return void
*/ */
function testUnescapeToken() { function testUnescapeToken() {
$this->Socket->reset(); $this->Socket->reset();
@ -1259,11 +1279,12 @@ class HttpSocketTest extends CakeTestCase {
$expectedToken = 'Extreme-:Token- -"@-test'; $expectedToken = 'Extreme-:Token- -"@-test';
$this->assertIdentical($expectedToken, $escapedToken); $this->assertIdentical($expectedToken, $escapedToken);
} }
/** /**
* This tests asserts HttpSocket::reset() resets a HttpSocket instance to it's initial state (before Object::__construct * This tests asserts HttpSocket::reset() resets a HttpSocket instance to it's initial state (before Object::__construct
* got executed) * got executed)
* *
* @access public
* @return void
*/ */
function testReset() { function testReset() {
$this->Socket->reset(); $this->Socket->reset();
@ -1281,11 +1302,12 @@ class HttpSocketTest extends CakeTestCase {
$this->assertIdentical($return, true); $this->assertIdentical($return, true);
} }
/** /**
* This tests asserts HttpSocket::reset(false) resets certain HttpSocket properties to their initial state (before * This tests asserts HttpSocket::reset(false) resets certain HttpSocket properties to their initial state (before
* Object::__construct got executed). * Object::__construct got executed).
* *
* @access public
* @return void
*/ */
function testPartialReset() { function testPartialReset() {
$this->Socket->reset(); $this->Socket->reset();
@ -1308,6 +1330,5 @@ class HttpSocketTest extends CakeTestCase {
} }
$this->assertIdentical($return, true); $this->assertIdentical($return, true);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * I18nTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'i18n'); App::import('Core', 'i18n');
/** /**
* Short description for class. * I18nTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class I18nTest extends CakeTestCase { class I18nTest extends CakeTestCase {
@ -2336,7 +2336,12 @@ class I18nTest extends CakeTestCase {
$this->assertFalse(in_array('24 everything else (from core translated)', $corePlurals)); $this->assertFalse(in_array('24 everything else (from core translated)', $corePlurals));
$this->assertFalse(in_array('25 everything else (from core translated)', $corePlurals)); $this->assertFalse(in_array('25 everything else (from core translated)', $corePlurals));
} }
/**
* testPluginTranslation method
*
* @access public
* @return void
*/
function testPluginTranslation() { function testPluginTranslation() {
$pluginPaths = Configure::read('pluginPaths'); $pluginPaths = Configure::read('pluginPaths');
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins')); Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'));

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * InflectorTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'Inflector'); App::import('Core', 'Inflector');
/** /**
* Short description for class. * InflectorTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class InflectorTest extends CakeTestCase { class InflectorTest extends CakeTestCase {
@ -48,6 +48,15 @@ class InflectorTest extends CakeTestCase {
function setUp() { function setUp() {
$this->Inflector = Inflector::getInstance(); $this->Inflector = Inflector::getInstance();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Inflector);
}
/** /**
* testInstantiation method * testInstantiation method
* *
@ -246,14 +255,5 @@ class InflectorTest extends CakeTestCase {
$this->assertEqual(Inflector::humanize('posts_tags'), 'Posts Tags'); $this->assertEqual(Inflector::humanize('posts_tags'), 'Posts Tags');
$this->assertEqual(Inflector::humanize('file_systems'), 'File Systems'); $this->assertEqual(Inflector::humanize('file_systems'), 'File Systems');
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Inflector);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * L10nTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -28,7 +28,7 @@ App::import('Core', 'l10n');
/** /**
* L10nTest class * L10nTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class L10nTest extends CakeTestCase { class L10nTest extends CakeTestCase {

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for behavior.test.php * BehaviorTest file
* *
* Long description for behavior.test.php * Long description for behavior.test.php
* *
@ -24,12 +24,11 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
App::import('Model', 'AppModel'); App::import('Model', 'AppModel');
require_once dirname(__FILE__) . DS . 'models.php'; require_once dirname(__FILE__) . DS . 'models.php';
/** /**
* Short description for class. * TestBehavior class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TestBehavior extends ModelBehavior { class TestBehavior extends ModelBehavior {
@ -329,7 +328,6 @@ class TestBehavior extends ModelBehavior {
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Test2Behavior extends TestBehavior{ class Test2Behavior extends TestBehavior{
} }
/** /**
* Test3Behavior class * Test3Behavior class
@ -338,7 +336,6 @@ class Test2Behavior extends TestBehavior{
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Test3Behavior extends TestBehavior{ class Test3Behavior extends TestBehavior{
} }
/** /**
* BehaviorTest class * BehaviorTest class
@ -354,6 +351,15 @@ class BehaviorTest extends CakeTestCase {
* @access public * @access public
*/ */
var $fixtures = array('core.apple', 'core.sample'); var $fixtures = array('core.apple', 'core.sample');
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
ClassRegistry::flush();
}
/** /**
* testBehaviorBinding method * testBehaviorBinding method
* *
@ -942,10 +948,10 @@ class BehaviorTest extends CakeTestCase {
$expected = array('TestBehavior', 'Test2Behavior'); $expected = array('TestBehavior', 'Test2Behavior');
$this->assertIdentical($Apple->beforeTestResult, $expected); $this->assertIdentical($Apple->beforeTestResult, $expected);
} }
/** /**
* Test attach and detaching * Test attach and detaching
* *
* @access public
* @return void * @return void
**/ **/
function testBehaviorAttachAndDetach() { function testBehaviorAttachAndDetach() {
@ -957,16 +963,5 @@ class BehaviorTest extends CakeTestCase {
$Sample->Behaviors->trigger($Sample, 'beforeTest'); $Sample->Behaviors->trigger($Sample, 'beforeTest');
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
ClassRegistry::flush();
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Acl behavior test * AclBehaviorTest file
* *
* Test the Acl Behavior * Test the Acl Behavior
* *
@ -26,11 +26,10 @@
*/ */
App::import('Behavior', 'Acl'); App::import('Behavior', 'Acl');
App::import('Core', 'db_acl'); App::import('Core', 'db_acl');
/** /**
* Test Person Class - self joined model * Test Person class - self joined model
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class AclPerson extends CakeTestModel { class AclPerson extends CakeTestModel {
@ -79,12 +78,12 @@ class AclPerson extends CakeTestModel {
'foreignKey' => 'mother_id' 'foreignKey' => 'mother_id'
) )
); );
/** /**
* ParentNode * parentNode method
* *
* @return void * @return void
**/ * @access public
*/
function parentNode() { function parentNode() {
if (!$this->id && empty($this->data)) { if (!$this->id && empty($this->data)) {
return null; return null;
@ -99,13 +98,11 @@ class AclPerson extends CakeTestModel {
return array('AclPerson' => array('id' => $data['AclPerson']['mother_id'])); return array('AclPerson' => array('id' => $data['AclPerson']['mother_id']));
} }
} }
} }
/** /**
* Acl Test User * AclUser class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class AclUser extends CakeTestModel { class AclUser extends CakeTestModel {
@ -139,11 +136,10 @@ class AclUser extends CakeTestModel {
return null; return null;
} }
} }
/** /**
* Acl Test User * AclPost class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class AclPost extends CakeTestModel { class AclPost extends CakeTestModel {
@ -177,33 +173,62 @@ class AclPost extends CakeTestModel {
return null; return null;
} }
} }
/** /**
* ACL behavior test class * AclBehaviorTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class AclBehaviorTestCase extends CakeTestCase { class AclBehaviorTestCase extends CakeTestCase {
/**
* Aco property
*
* @var Aco
* @access public
*/
var $Aco;
/**
* Aro property
*
* @var Aro
* @access public
*/
var $Aro;
/**
* fixtures property
*
* @var array
* @access public
*/
var $fixtures = array('core.person', 'core.user', 'core.post', 'core.aco', 'core.aro', 'core.aros_aco'); var $fixtures = array('core.person', 'core.user', 'core.post', 'core.aco', 'core.aro', 'core.aros_aco');
/** /**
* Set up the test * Set up the test
* *
* @return void * @return void
**/ * @access public
*/
function startTest() { function startTest() {
Configure::write('Acl.database', 'test_suite'); Configure::write('Acl.database', 'test_suite');
$this->Aco =& new Aco(); $this->Aco =& new Aco();
$this->Aro =& new Aro(); $this->Aro =& new Aro();
} }
/**
* tearDown method
*
* @return void
* @access public
*/
function tearDown() {
ClassRegistry::flush();
unset($this->Aro, $this->Aco);
}
/** /**
* Test Setup of AclBehavior * Test Setup of AclBehavior
* *
* @return void * @return void
**/ * @access public
*/
function testSetup() { function testSetup() {
$User =& new AclUser(); $User =& new AclUser();
$this->assertTrue(isset($User->Behaviors->Acl->settings['User'])); $this->assertTrue(isset($User->Behaviors->Acl->settings['User']));
@ -215,12 +240,12 @@ class AclBehaviorTestCase extends CakeTestCase {
$this->assertEqual($Post->Behaviors->Acl->settings['Post']['type'], 'controlled'); $this->assertEqual($Post->Behaviors->Acl->settings['Post']['type'], 'controlled');
$this->assertTrue(is_object($Post->Aco)); $this->assertTrue(is_object($Post->Aco));
} }
/** /**
* test After Save * test After Save
* *
* @return void * @return void
**/ * @access public
*/
function testAfterSave() { function testAfterSave() {
$Post =& new AclPost(); $Post =& new AclPost();
$data = array( $data = array(
@ -264,12 +289,12 @@ class AclBehaviorTestCase extends CakeTestCase {
$this->assertEqual($node[0]['Aro']['parent_id'], 5); $this->assertEqual($node[0]['Aro']['parent_id'], 5);
$this->assertEqual($node[1]['Aro']['parent_id'], null); $this->assertEqual($node[1]['Aro']['parent_id'], null);
} }
/** /**
* Test After Delete * Test After Delete
* *
* @return void * @return void
**/ * @access public
*/
function testAfterDelete() { function testAfterDelete() {
$aroData = array( $aroData = array(
'Aro' => array( 'Aro' => array(
@ -317,12 +342,12 @@ class AclBehaviorTestCase extends CakeTestCase {
$this->assertTrue(empty($result)); $this->assertTrue(empty($result));
} }
/** /**
* Test Node() * Test Node()
* *
* @return void * @return void
**/ * @access public
*/
function testNode() { function testNode() {
$Person =& new AclPerson(); $Person =& new AclPerson();
$aroData = array( $aroData = array(
@ -339,16 +364,5 @@ class AclBehaviorTestCase extends CakeTestCase {
$this->assertTrue(is_array($result)); $this->assertTrue(is_array($result));
$this->assertEqual(sizeof($result), 1); $this->assertEqual(sizeof($result), 1);
} }
/**
* tear down test
*
* @return void
**/
function tearDown() {
ClassRegistry::flush();
unset($this->Aro, $this->Aco);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ContainableBehaviorTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
* @since CakePHP(tm) v 1.2.0.5669 * @since CakePHP(tm) v 1.2.0.5669
* @version $Revision$ * @version $Revision$
@ -24,7 +24,6 @@
* @lastmodified $Date$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', array('AppModel', 'Model')); App::import('Core', array('AppModel', 'Model'));
require_once(dirname(dirname(__FILE__)) . DS . 'models.php'); require_once(dirname(dirname(__FILE__)) . DS . 'models.php');
/** /**
@ -33,7 +32,7 @@ require_once(dirname(dirname(__FILE__)) . DS . 'models.php');
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class ContainableTest extends CakeTestCase { class ContainableBehaviorTest extends CakeTestCase {
/** /**
* Fixtures associated with this test case * Fixtures associated with this test case
* *
@ -2868,25 +2867,32 @@ class ContainableTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $this->Article->find('all', array('contain' => array('Comment(comment, published)' => 'Attachment(attachment)', 'User(user)'), 'fields' => array('title'))); $result = $this->Article->find('all', array('contain' => array('Comment(comment, published)' => 'Attachment(attachment)', 'User(user)'), 'fields' => array('title')));
if (!empty($result)) {
foreach($result as $i=>$article) {
foreach($article['Comment'] as $j=>$comment) {
$result[$i]['Comment'][$j] = array_diff_key($comment, array('id'=>true));
}
}
}
$expected = array( $expected = array(
array( array(
'Article' => array('title' => 'First Article', 'id' => 1), 'Article' => array('title' => 'First Article', 'id' => 1),
'User' => array('user' => 'mariano', 'id' => 1), 'User' => array('user' => 'mariano', 'id' => 1),
'Comment' => array( 'Comment' => array(
array('comment' => 'First Comment for First Article', 'published' => 'Y', 'id' => 1, 'article_id' => 1, 'Attachment' => array()), array('comment' => 'First Comment for First Article', 'published' => 'Y', 'article_id' => 1, 'Attachment' => array()),
array('comment' => 'Second Comment for First Article', 'published' => 'Y', 'id' => 2, 'article_id' => 1, 'Attachment' => array()), array('comment' => 'Second Comment for First Article', 'published' => 'Y', 'article_id' => 1, 'Attachment' => array()),
array('comment' => 'Third Comment for First Article', 'published' => 'Y', 'id' => 3, 'article_id' => 1, 'Attachment' => array()), array('comment' => 'Third Comment for First Article', 'published' => 'Y', 'article_id' => 1, 'Attachment' => array()),
array('comment' => 'Fourth Comment for First Article', 'published' => 'N', 'id' => 4, 'article_id' => 1, 'Attachment' => array()), array('comment' => 'Fourth Comment for First Article', 'published' => 'N', 'article_id' => 1, 'Attachment' => array()),
) )
), ),
array( array(
'Article' => array('title' => 'Second Article', 'id' => 2), 'Article' => array('title' => 'Second Article', 'id' => 2),
'User' => array('user' => 'larry', 'id' => 3), 'User' => array('user' => 'larry', 'id' => 3),
'Comment' => array( 'Comment' => array(
array('comment' => 'First Comment for Second Article', 'published' => 'Y', 'id' => 5, 'article_id' => 2, 'Attachment' => array( array('comment' => 'First Comment for Second Article', 'published' => 'Y', 'article_id' => 2, 'Attachment' => array(
'attachment' => 'attachment.zip', 'id' => 1 'attachment' => 'attachment.zip', 'id' => 1
)), )),
array('comment' => 'Second Comment for Second Article', 'published' => 'Y', 'id' => 6, 'article_id' => 2, 'Attachment' => array()) array('comment' => 'Second Comment for Second Article', 'published' => 'Y', 'article_id' => 2, 'Attachment' => array())
) )
), ),
array( array(
@ -3534,5 +3540,4 @@ class ContainableTest extends CakeTestCase {
return $debug; return $debug;
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * TranslateBehaviorTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
* @since CakePHP(tm) v 1.2.0.5669 * @since CakePHP(tm) v 1.2.0.5669
* @version $Revision$ * @version $Revision$
@ -30,14 +30,13 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
App::import('Core', array('AppModel', 'Model')); App::import('Core', array('AppModel', 'Model'));
require_once(dirname(dirname(__FILE__)) . DS . 'models.php'); require_once(dirname(dirname(__FILE__)) . DS . 'models.php');
/** /**
* TranslateTest class. * TranslateBehaviorTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class TranslateTest extends CakeTestCase { class TranslateBehaviorTest extends CakeTestCase {
/** /**
* autoFixtures property * autoFixtures property
* *

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * TreeBehaviorTest file
* *
* Long description for file * Holds several Test Cases
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
* @since CakePHP(tm) v 1.2.0.5330 * @since CakePHP(tm) v 1.2.0.5330
* @version $Revision$ * @version $Revision$
@ -27,12 +27,12 @@
App::import('Core', array('AppModel', 'Model')); App::import('Core', array('AppModel', 'Model'));
require_once(dirname(dirname(__FILE__)) . DS . 'models.php'); require_once(dirname(dirname(__FILE__)) . DS . 'models.php');
/** /**
* NumberTreeCase class * NumberTreeTest class
* *
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class NumberTreeCase extends CakeTestCase { class NumberTreeTest extends CakeTestCase {
/** /**
* settings property * settings property
* *
@ -1205,12 +1205,12 @@ class NumberTreeCase extends CakeTestCase {
} }
} }
/** /**
* ScopedTreeCase class * ScopedTreeTest class
* *
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class ScopedTreeCase extends NumberTreeCase { class ScopedTreeTest extends NumberTreeTest {
/** /**
* settings property * settings property
* *
@ -1435,12 +1435,12 @@ class ScopedTreeCase extends NumberTreeCase {
} }
} }
/** /**
* AfterTreeCase class * AfterTreeTest class
* *
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class AfterTreeCase extends NumberTreeCase { class AfterTreeTest extends NumberTreeTest {
/** /**
* settings property * settings property
* *
@ -1479,12 +1479,12 @@ class AfterTreeCase extends NumberTreeCase {
} }
} }
/** /**
* UnconventionalTreeCase class * UnconventionalTreeTest class
* *
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class UnconventionalTreeCase extends NumberTreeCase { class UnconventionalTreeTest extends NumberTreeTest {
/** /**
* settings property * settings property
* *
@ -1506,12 +1506,12 @@ class UnconventionalTreeCase extends NumberTreeCase {
var $fixtures = array('core.unconventional_tree'); var $fixtures = array('core.unconventional_tree');
} }
/** /**
* UuidTreeCase class * UuidTreeTest class
* *
* @package cake * @package cake
* @subpackage cake.tests.cases.libs.model.behaviors * @subpackage cake.tests.cases.libs.model.behaviors
*/ */
class UuidTreeCase extends NumberTreeCase { class UuidTreeTest extends NumberTreeTest {
/** /**
* settings property * settings property
* *

View file

@ -1,9 +1,9 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* AdoDB layer for DBO. * DboAdodbTest file
* *
* Long description for file * AdoDB layer for DBO
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -24,16 +24,14 @@
* @lastmodified $Date$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
require_once LIBS.'model'.DS.'model.php'; require_once LIBS.'model'.DS.'model.php';
require_once LIBS.'model'.DS.'datasources'.DS.'datasource.php'; require_once LIBS.'model'.DS.'datasources'.DS.'datasource.php';
require_once LIBS.'model'.DS.'datasources'.DS.'dbo_source.php'; require_once LIBS.'model'.DS.'datasources'.DS.'dbo_source.php';
require_once LIBS.'model'.DS.'datasources'.DS.'dbo'.DS.'dbo_adodb.php'; require_once LIBS.'model'.DS.'datasources'.DS.'dbo'.DS.'dbo_adodb.php';
/** /**
* Short description for class. * DboAdoTestDb
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class DboAdoTestDb extends DboAdodb { class DboAdoTestDb extends DboAdodb {
@ -75,11 +73,10 @@ class DboAdoTestDb extends DboAdodb {
return $this->simulated[count($this->simulated) - 1]; return $this->simulated[count($this->simulated) - 1];
} }
} }
/** /**
* Short description for class. * AdodbTestModel
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class AdodbTestModel extends CakeTestModel { class AdodbTestModel extends CakeTestModel {
@ -152,7 +149,6 @@ class AdodbTestModel extends CakeTestModel {
); );
} }
} }
if (!class_exists('Article')) { if (!class_exists('Article')) {
/** /**
* Article class * Article class
@ -171,29 +167,27 @@ if (!class_exists('Article')) {
} }
} }
/** /**
* The test class for the DboAdobd * DboAdodbTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources.dbo * @subpackage cake.tests.cases.libs.model.datasources.dbo
*/ */
class DboAdodbTest extends CakeTestCase { class DboAdodbTest extends CakeTestCase {
/** /**
* The Dbo instance to be tested * The Dbo instance to be tested
* *
* @var object * @var DboSource
* @access public * @access public
*/ */
var $db = null; var $db = null;
/** /**
* undocumented class variable * fixtures property
* *
* @var string * @var string
* @access public
**/ **/
var $fixtures = array('core.article'); var $fixtures = array('core.article');
/** /**
* Skip if cannot connect to AdoDb * Skip if cannot connect to AdoDb
* *
@ -280,6 +274,5 @@ class DboAdodbTest extends CakeTestCase {
function testColumns() { function testColumns() {
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* DboMssql test * DboMssqlTest file
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -29,7 +29,6 @@ require_once LIBS.'model'.DS.'model.php';
require_once LIBS.'model'.DS.'datasources'.DS.'datasource.php'; require_once LIBS.'model'.DS.'datasources'.DS.'datasource.php';
require_once LIBS.'model'.DS.'datasources'.DS.'dbo_source.php'; require_once LIBS.'model'.DS.'datasources'.DS.'dbo_source.php';
require_once LIBS.'model'.DS.'datasources'.DS.'dbo'.DS.'dbo_mssql.php'; require_once LIBS.'model'.DS.'datasources'.DS.'dbo'.DS.'dbo_mssql.php';
/** /**
* DboMssqlTestDb class * DboMssqlTestDb class
* *
@ -37,14 +36,32 @@ require_once LIBS.'model'.DS.'datasources'.DS.'dbo'.DS.'dbo_mssql.php';
* @subpackage cake.tests.cases.libs.model.datasources.dbo * @subpackage cake.tests.cases.libs.model.datasources.dbo
*/ */
class DboMssqlTestDb extends DboMssql { class DboMssqlTestDb extends DboMssql {
/**
function __construct() {} * Contructor
*
* @return void
* @access public
*/
function __construct() {
}
/**
* connect method
*
* @return boolean
* @access public
*/
function connect() { function connect() {
$this->connected = true; $this->connected = true;
return true; return true;
} }
function lastError() {} /**
* lastError method
*
* @return void
* @access public
*/
function lastError() {
}
/** /**
* simulated property * simulated property
* *
@ -104,11 +121,10 @@ class DboMssqlTestDb extends DboMssql {
return $this->simulated[count($this->simulated) - 1]; return $this->simulated[count($this->simulated) - 1];
} }
} }
/** /**
* Short description for class. * MssqlTestModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class MssqlTestModel extends Model { class MssqlTestModel extends Model {
@ -183,16 +199,16 @@ class MssqlTestModel extends Model {
} }
} }
/** /**
* The test class for the DboMssql * DboMssqlTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources.dbo * @subpackage cake.tests.cases.libs.model.datasources.dbo
*/ */
class DboMssqlTest extends CakeTestCase { class DboMssqlTest extends CakeTestCase {
/** /**
* The Dbo instance to be tested * The Dbo instance to be tested
* *
* @var object * @var DboSource
* @access public * @access public
*/ */
var $db = null; var $db = null;
@ -215,6 +231,16 @@ class DboMssqlTest extends CakeTestCase {
$this->db = new DboMssqlTestDb($db->config); $this->db = new DboMssqlTestDb($db->config);
$this->model = new MssqlTestModel(); $this->model = new MssqlTestModel();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->model);
}
/** /**
* testQuoting method * testQuoting method
* *
@ -314,7 +340,12 @@ class DboMssqlTest extends CakeTestCase {
); );
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/**
* testUpdateAllSyntax method
*
* @return void
* @access public
*/
function testUpdateAllSyntax() { function testUpdateAllSyntax() {
$model = ClassRegistry::init('MssqlTestModel'); $model = ClassRegistry::init('MssqlTestModel');
$fields = array('MssqlTestModel.client_id' => '[MssqlTestModel].[client_id] + 1'); $fields = array('MssqlTestModel.client_id' => '[MssqlTestModel].[client_id] + 1');
@ -326,15 +357,5 @@ class DboMssqlTest extends CakeTestCase {
$this->assertPattern('/^UPDATE \[mssql_test_models\]/', $result); $this->assertPattern('/^UPDATE \[mssql_test_models\]/', $result);
$this->assertPattern('/SET \[client_id\] = \[client_id\] \+ 1/', $result); $this->assertPattern('/SET \[client_id\] = \[client_id\] \+ 1/', $result);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->model);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* DboMysql test * DboMysqlTest file
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -26,9 +26,9 @@ App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboMysql'));
Mock::generatePartial('DboMysql', 'QueryMockDboMysql', array('query')); Mock::generatePartial('DboMysql', 'QueryMockDboMysql', array('query'));
/** /**
* Short description for class. * DboMysqlTestDb class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class DboMysqlTestDb extends DboMysql { class DboMysqlTestDb extends DboMysql {
@ -71,9 +71,9 @@ class DboMysqlTestDb extends DboMysql {
} }
} }
/** /**
* Short description for class. * MysqlTestModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class MysqlTestModel extends Model { class MysqlTestModel extends Model {
@ -147,16 +147,16 @@ class MysqlTestModel extends Model {
} }
} }
/** /**
* The test class for the DboMysql * DboMysqlTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources.dbo * @subpackage cake.tests.cases.libs.model.datasources.dbo
*/ */
class DboMysqlTest extends CakeTestCase { class DboMysqlTest extends CakeTestCase {
/** /**
* The Dbo instance to be tested * The Dbo instance to be tested
* *
* @var object * @var DboSource
* @access public * @access public
*/ */
var $Db = null; var $Db = null;
@ -575,5 +575,4 @@ class DboMysqlTest extends CakeTestCase {
$this->db->query($this->db->dropSchema($schema1)); $this->db->query($this->db->dropSchema($schema1));
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* DboMysqli test * DboMysqliTest file
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -22,16 +22,14 @@
* @lastmodified $Date$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
} }
App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboMysqli')); App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboMysqli'));
/** /**
* Short description for class. * DboMysqliTestDb class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class DboMysqliTestDb extends DboMysqli { class DboMysqliTestDb extends DboMysqli {
@ -74,9 +72,9 @@ class DboMysqliTestDb extends DboMysqli {
} }
} }
/** /**
* Short description for class. * MysqliTestModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class MysqliTestModel extends Model { class MysqliTestModel extends Model {
@ -150,16 +148,16 @@ class MysqliTestModel extends Model {
} }
} }
/** /**
* The test class for the DboMysqli * DboMysqliTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources.dbo * @subpackage cake.tests.cases.libs.model.datasources.dbo
*/ */
class DboMysqliTest extends CakeTestCase { class DboMysqliTest extends CakeTestCase {
/** /**
* The Dbo instance to be tested * The Dbo instance to be tested
* *
* @var object * @var DboSource
* @access public * @access public
*/ */
var $Db = null; var $Db = null;
@ -300,5 +298,4 @@ class DboMysqliTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* DboOracle test * DboOracleTest file
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -22,13 +22,11 @@
* @lastmodified $Date$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
} }
require_once LIBS . 'model' . DS . 'datasources' . DS . 'dbo_source.php'; require_once LIBS . 'model' . DS . 'datasources' . DS . 'dbo_source.php';
require_once LIBS . 'model' . DS . 'datasources' . DS . 'dbo' . DS . 'dbo_oracle.php'; require_once LIBS . 'model' . DS . 'datasources' . DS . 'dbo' . DS . 'dbo_oracle.php';
/** /**
* DboOracleTest class * DboOracleTest class
* *
@ -99,7 +97,6 @@ class DboOracleTest extends CakeTestCase {
$this->db->config['password'] = $old_pw; $this->db->config['password'] = $old_pw;
$this->db->connect(); $this->db->connect();
} }
/** /**
* testName method * testName method
* *
@ -131,10 +128,5 @@ class DboOracleTest extends CakeTestCase {
$this->assertEqual($e, $r); $this->assertEqual($e, $r);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* DboPostgres test * DboPostgresTest file
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -24,13 +24,11 @@
*/ */
App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboPostgres')); App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboPostgres'));
App::import('Model', 'App'); App::import('Model', 'App');
require_once dirname(dirname(dirname(__FILE__))) . DS . 'models.php'; require_once dirname(dirname(dirname(__FILE__))) . DS . 'models.php';
/** /**
* Short description for class. * DboPostgresTestDb class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class DboPostgresTestDb extends DboPostgres { class DboPostgresTestDb extends DboPostgres {
@ -63,9 +61,9 @@ class DboPostgresTestDb extends DboPostgres {
} }
} }
/** /**
* Short description for class. * PostgresTestModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class PostgresTestModel extends Model { class PostgresTestModel extends Model {
@ -139,9 +137,9 @@ class PostgresTestModel extends Model {
} }
} }
/** /**
* The test class for the DboPostgres * DboPostgresTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources.dbo * @subpackage cake.tests.cases.libs.model.datasources.dbo
*/ */
class DboPostgresTest extends CakeTestCase { class DboPostgresTest extends CakeTestCase {
@ -164,14 +162,14 @@ class DboPostgresTest extends CakeTestCase {
/** /**
* Actual DB connection used in testing * Actual DB connection used in testing
* *
* @var object * @var DboSource
* @access public * @access public
*/ */
var $db = null; var $db = null;
/** /**
* Simulated DB connection used in testing * Simulated DB connection used in testing
* *
* @var object * @var DboSource
* @access public * @access public
*/ */
var $db2 = null; var $db2 = null;
@ -376,7 +374,6 @@ class DboPostgresTest extends CakeTestCase {
$expected = '"foo" text DEFAULT \'FOO\''; $expected = '"foo" text DEFAULT \'FOO\'';
$this->assertEqual($this->db->buildColumn($result), $expected); $this->assertEqual($this->db->buildColumn($result), $expected);
} }
/** /**
* Tests that binary data is escaped/unescaped properly on reads and writes * Tests that binary data is escaped/unescaped properly on reads and writes
* *
@ -409,7 +406,6 @@ class DboPostgresTest extends CakeTestCase {
$result = $model->find('first'); $result = $model->find('first');
$this->assertEqual($result['BinaryTest']['data'], $data); $this->assertEqual($result['BinaryTest']['data'], $data);
} }
/** /**
* Tests the syntax of generated schema indexes * Tests the syntax of generated schema indexes
* *
@ -479,7 +475,6 @@ class DboPostgresTest extends CakeTestCase {
$db1->query('DROP TABLE ' . $db1->fullTableName('datatypes')); $db1->query('DROP TABLE ' . $db1->fullTableName('datatypes'));
} }
/** /**
* Test index generation from table info. * Test index generation from table info.
* *

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* DboSqlite test * DboSqliteTest file
* *
* PHP versions 4 and 5 * PHP versions 4 and 5
* *
@ -23,11 +23,10 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License * @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/ */
App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboSqlite')); App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboSqlite'));
/** /**
* Short description for class. * DboSqliteTestDb class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class DboSqliteTestDb extends DboSqlite { class DboSqliteTestDb extends DboSqlite {
@ -60,9 +59,9 @@ class DboSqliteTestDb extends DboSqlite {
} }
} }
/** /**
* The test class for the DboPostgres * DboSqliteTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources.dbo * @subpackage cake.tests.cases.libs.model.datasources.dbo
*/ */
class DboSqliteTest extends CakeTestCase { class DboSqliteTest extends CakeTestCase {
@ -83,14 +82,14 @@ class DboSqliteTest extends CakeTestCase {
/** /**
* Actual DB connection used in testing * Actual DB connection used in testing
* *
* @var object * @var DboSource
* @access public * @access public
*/ */
var $db = null; var $db = null;
/** /**
* Simulated DB connection used in testing * Simulated DB connection used in testing
* *
* @var object * @var DboSource
* @access public * @access public
*/ */
var $db2 = null; var $db2 = null;
@ -176,7 +175,6 @@ class DboSqliteTest extends CakeTestCase {
$this->assertEqual($expected, $result); $this->assertEqual($expected, $result);
$this->db->query('DROP TABLE ' . $name); $this->db->query('DROP TABLE ' . $name);
} }
/** /**
* Tests that cached table descriptions are saved under the sanitized key name * Tests that cached table descriptions are saved under the sanitized key name
* *
@ -207,5 +205,4 @@ class DboSqliteTest extends CakeTestCase {
Configure::write('Cache.disable', true); Configure::write('Cache.disable', true);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * DboSourceTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -30,11 +30,10 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboMysql')); App::import('Core', array('Model', 'DataSource', 'DboSource', 'DboMysql'));
App::import('Model', 'App'); App::import('Model', 'App');
require_once dirname(dirname(__FILE__)) . DS . 'models.php'; require_once dirname(dirname(__FILE__)) . DS . 'models.php';
/** /**
* Short description for class. * TestModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel extends CakeTestModel { class TestModel extends CakeTestModel {
@ -106,9 +105,9 @@ class TestModel extends CakeTestModel {
} }
} }
/** /**
* Short description for class. * TestModel2 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel2 extends CakeTestModel { class TestModel2 extends CakeTestModel {
@ -128,9 +127,9 @@ class TestModel2 extends CakeTestModel {
var $useTable = false; var $useTable = false;
} }
/** /**
* Short description for class. * TestModel4 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel3 extends CakeTestModel { class TestModel3 extends CakeTestModel {
@ -150,9 +149,9 @@ class TestModel3 extends CakeTestModel {
var $useTable = false; var $useTable = false;
} }
/** /**
* Short description for class. * TestModel4 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel4 extends CakeTestModel { class TestModel4 extends CakeTestModel {
@ -232,6 +231,12 @@ class TestModel4 extends CakeTestModel {
return $this->_schema; return $this->_schema;
} }
} }
/**
* TestModel4TestModel7 class
*
* @package cake
* @subpackage cake.tests.cases.libs.model.datasources
*/
class TestModel4TestModel7 extends CakeTestModel { class TestModel4TestModel7 extends CakeTestModel {
/** /**
* name property * name property
@ -271,9 +276,9 @@ class TestModel4TestModel7 extends CakeTestModel {
} }
} }
/** /**
* Short description for class. * TestModel5 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel5 extends CakeTestModel { class TestModel5 extends CakeTestModel {
@ -338,9 +343,9 @@ class TestModel5 extends CakeTestModel {
} }
} }
/** /**
* Short description for class. * TestModel6 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel6 extends CakeTestModel { class TestModel6 extends CakeTestModel {
@ -395,9 +400,9 @@ class TestModel6 extends CakeTestModel {
} }
} }
/** /**
* Short description for class. * TestModel7 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel7 extends CakeTestModel { class TestModel7 extends CakeTestModel {
@ -441,9 +446,9 @@ class TestModel7 extends CakeTestModel {
} }
} }
/** /**
* Short description for class. * TestModel8 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel8 extends CakeTestModel { class TestModel8 extends CakeTestModel {
@ -501,9 +506,9 @@ class TestModel8 extends CakeTestModel {
} }
} }
/** /**
* Short description for class. * TestModel9 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class TestModel9 extends CakeTestModel { class TestModel9 extends CakeTestModel {
@ -1136,11 +1141,10 @@ class ArticleFeatured2 extends CakeTestModel {
return $this->_schema; return $this->_schema;
} }
} }
/** /**
* Short description for class. * DboSourceTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model.datasources * @subpackage cake.tests.cases.libs.model.datasources
*/ */
class DboSourceTest extends CakeTestCase { class DboSourceTest extends CakeTestCase {
@ -3806,5 +3810,4 @@ class DboSourceTest extends CakeTestCase {
$this->assertNoPattern('/Took:/s', $contents); $this->assertNoPattern('/Took:/s', $contents);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * DbAclTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models * @subpackage cake.tests.cases.libs.controller.components.dbacl.models
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -27,16 +27,14 @@
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
} }
App::import('Component', 'Acl'); App::import('Component', 'Acl');
App::import('Core', 'db_acl'); App::import('Core', 'db_acl');
/** /**
* DB ACL wrapper test class * DB ACL wrapper test class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class DbAclNodeTestBase extends AclNode { class DbAclNodeTestBase extends AclNode {
/** /**
* useDbConfig property * useDbConfig property
@ -53,13 +51,12 @@ class DbAclNodeTestBase extends AclNode {
*/ */
var $cacheSources = false; var $cacheSources = false;
} }
/** /**
* Aro Test Wrapper * Aro Test Wrapper
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class DbAroTest extends DbAclNodeTestBase { class DbAroTest extends DbAclNodeTestBase {
/** /**
* name property * name property
@ -83,13 +80,12 @@ class DbAroTest extends DbAclNodeTestBase {
*/ */
var $hasAndBelongsToMany = array('DbAcoTest' => array('with' => 'DbPermissionTest')); var $hasAndBelongsToMany = array('DbAcoTest' => array('with' => 'DbPermissionTest'));
} }
/** /**
* Aco Test Wrapper * Aco Test Wrapper
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class DbAcoTest extends DbAclNodeTestBase { class DbAcoTest extends DbAclNodeTestBase {
/** /**
* name property * name property
@ -113,13 +109,12 @@ class DbAcoTest extends DbAclNodeTestBase {
*/ */
var $hasAndBelongsToMany = array('DbAroTest' => array('with' => 'DbPermissionTest')); var $hasAndBelongsToMany = array('DbAroTest' => array('with' => 'DbPermissionTest'));
} }
/** /**
* Permission Test Wrapper * Permission Test Wrapper
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class DbPermissionTest extends CakeTestModel { class DbPermissionTest extends CakeTestModel {
/** /**
* name property * name property
@ -151,11 +146,11 @@ class DbPermissionTest extends CakeTestModel {
var $belongsTo = array('DbAroTest' => array('foreignKey' => 'aro_id'), 'DbAcoTest' => array('foreignKey' => 'aco_id')); var $belongsTo = array('DbAroTest' => array('foreignKey' => 'aro_id'), 'DbAcoTest' => array('foreignKey' => 'aco_id'));
} }
/** /**
* Short description for class. * DboActionTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class DbAcoActionTest extends CakeTestModel { class DbAcoActionTest extends CakeTestModel {
/** /**
* name property * name property
@ -180,11 +175,11 @@ class DbAcoActionTest extends CakeTestModel {
var $belongsTo = array('DbAcoTest' => array('foreignKey' => 'aco_id')); var $belongsTo = array('DbAcoTest' => array('foreignKey' => 'aco_id'));
} }
/** /**
* Short description for class. * DbAroUserTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class DbAroUserTest extends CakeTestModel { class DbAroUserTest extends CakeTestModel {
/** /**
* name property * name property
@ -215,13 +210,12 @@ class DbAroUserTest extends CakeTestModel {
} }
} }
} }
/** /**
* Short description for class. * DbAclTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components * @subpackage cake.tests.cases.libs.controller.components
*/ */
class DbAclTest extends DbAcl { class DbAclTest extends DbAcl {
/** /**
* construct method * construct method
@ -237,9 +231,9 @@ class DbAclTest extends DbAcl {
} }
} }
/** /**
* Short description for class. * AclNodeTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.controller.components.dbacl.models * @subpackage cake.tests.cases.libs.controller.components.dbacl.models
*/ */
class AclNodeTest extends CakeTestCase { class AclNodeTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ModelTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -24,14 +24,12 @@
* @lastmodified $Date$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', array('AppModel', 'Model')); App::import('Core', array('AppModel', 'Model'));
require_once dirname(__FILE__) . DS . 'models.php'; require_once dirname(__FILE__) . DS . 'models.php';
/** /**
* Short description for class. * ModelTest
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ModelTest extends CakeTestCase { class ModelTest extends CakeTestCase {
@ -90,6 +88,15 @@ class ModelTest extends CakeTestCase {
parent::end(); parent::end();
Configure::write('debug', $this->debug); Configure::write('debug', $this->debug);
} }
/**
* endTest method
*
* @access public
* @return void
*/
function endTest() {
ClassRegistry::flush();
}
/** /**
* testAutoConstructAssociations method * testAutoConstructAssociations method
* *
@ -956,7 +963,6 @@ class ModelTest extends CakeTestCase {
$result = $Article->read(null, 2); $result = $Article->read(null, 2);
$this->assertEqual($result['Article']['title'], 'Staying alive'); $this->assertEqual($result['Article']['title'], 'Staying alive');
} }
/** /**
* testCreationOfEmptyRecord method * testCreationOfEmptyRecord method
* *
@ -3182,7 +3188,6 @@ class ModelTest extends CakeTestCase {
Configure::write('Cache.check', $_back['check']); Configure::write('Cache.check', $_back['check']);
Configure::write('Cache.disable', $_back['disable']); Configure::write('Cache.disable', $_back['disable']);
} }
/** /**
* testSaveAll method * testSaveAll method
* *
@ -3248,12 +3253,12 @@ class ModelTest extends CakeTestCase {
$expected = array('id' => '2', 'comment_id' => '7', 'attachment' => 'some_file.tgz', 'created' => $ts, 'updated' => $ts); $expected = array('id' => '2', 'comment_id' => '7', 'attachment' => 'some_file.tgz', 'created' => $ts, 'updated' => $ts);
$this->assertEqual($result[6]['Attachment'], $expected); $this->assertEqual($result[6]['Attachment'], $expected);
} }
/** /**
* Test SaveAll with Habtm relations * Test SaveAll with Habtm relations
* *
* @access public
* @return void * @return void
**/ */
function testSaveAllHabtm() { function testSaveAllHabtm() {
$this->loadFixtures('Article', 'Tag', 'Comment', 'User'); $this->loadFixtures('Article', 'Tag', 'Comment', 'User');
$data = array( $data = array(
@ -3279,7 +3284,12 @@ class ModelTest extends CakeTestCase {
$this->assertEqual(count($result['Comment']), 1); $this->assertEqual(count($result['Comment']), 1);
$this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1); $this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1);
} }
/**
* Test SaveAll with Habtm relations and extra join table fields
*
* @access public
* @return void
*/
function testSaveAllHabtmWithExtraJoinTableFields() { function testSaveAllHabtmWithExtraJoinTableFields() {
$this->loadFixtures('Something', 'SomethingElse', 'JoinThing'); $this->loadFixtures('Something', 'SomethingElse', 'JoinThing');
@ -3753,7 +3763,6 @@ class ModelTest extends CakeTestCase {
); );
$this->assertEqual($TestModel->validationErrors, $expected); $this->assertEqual($TestModel->validationErrors, $expected);
} }
/** /**
* testSaveAllValidateFirst method * testSaveAllValidateFirst method
* *
@ -3929,7 +3938,6 @@ class ModelTest extends CakeTestCase {
$expected = array_fill(0, 1, 1); $expected = array_fill(0, 1, 1);
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/** /**
* testSaveWithCounterCacheScope method * testSaveWithCounterCacheScope method
* *
@ -4786,7 +4794,6 @@ class ModelTest extends CakeTestCase {
$expected = $TestModel->save($data); $expected = $TestModel->save($data);
$this->assertFalse($expected); $this->assertFalse($expected);
} }
// function testBasicValidation() { // function testBasicValidation() {
// $TestModel =& new ValidationTest(); // $TestModel =& new ValidationTest();
// $TestModel->testing = true; // $TestModel->testing = true;
@ -4983,6 +4990,13 @@ class ModelTest extends CakeTestCase {
$TestModel->invalidFields(array('fieldList' => array('name', 'title'))); $TestModel->invalidFields(array('fieldList' => array('name', 'title')));
$expected = array('name' => 'This field cannot be left blank', 'title' => 'This field cannot be left blank'); $expected = array('name' => 'This field cannot be left blank', 'title' => 'This field cannot be left blank');
$this->assertEqual($TestModel->validationErrors, $expected); $this->assertEqual($TestModel->validationErrors, $expected);
$TestModel->validationErrors = array();
$TestModel->whitelist = array('name');
$TestModel->invalidFields();
$expected = array('name' => 'This field cannot be left blank');
$this->assertEqual($TestModel->validationErrors, $expected);
$TestModel->validationErrors = array();
$this->assertEqual($TestModel->validate, $validate); $this->assertEqual($TestModel->validate, $validate);
} }
@ -5530,7 +5544,6 @@ class ModelTest extends CakeTestCase {
$this->assertIdentical($result['DataTest']['count'], '0'); $this->assertIdentical($result['DataTest']['count'], '0');
$this->assertIdentical($result['DataTest']['float'], '0'); $this->assertIdentical($result['DataTest']['float'], '0');
} }
/** /**
* testNonNumericHabtmJoinKey method * testNonNumericHabtmJoinKey method
* *
@ -5820,7 +5833,6 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($db2->fullTableName($TestModel, false), 'apples'); $this->assertEqual($db2->fullTableName($TestModel, false), 'apples');
$this->assertEqual($db1->fullTableName($TestModel, false), 'apples'); $this->assertEqual($db1->fullTableName($TestModel, false), 'apples');
} }
/** /**
* testDynamicBehaviorAttachment method * testDynamicBehaviorAttachment method
* *
@ -5851,7 +5863,6 @@ class ModelTest extends CakeTestCase {
$this->assertEqual($TestModel->Behaviors->attached(), array()); $this->assertEqual($TestModel->Behaviors->attached(), array());
$this->assertFalse(isset($TestModel->Behaviors->Tree)); $this->assertFalse(isset($TestModel->Behaviors->Tree));
} }
/** /**
* Tests cross database joins. Requires $test and $test2 to both be set in DATABASE_CONFIG * Tests cross database joins. Requires $test and $test2 to both be set in DATABASE_CONFIG
* NOTE: When testing on MySQL, you must set 'persistent' => false on *both* database connections, * NOTE: When testing on MySQL, you must set 'persistent' => false on *both* database connections,
@ -6470,7 +6481,12 @@ class ModelTest extends CakeTestCase {
$result = $Portfolio->ItemsPortfolio->find('all', array('conditions' => array('ItemsPortfolio.portfolio_id' => 1))); $result = $Portfolio->ItemsPortfolio->find('all', array('conditions' => array('ItemsPortfolio.portfolio_id' => 1)));
$this->assertFalse($result); $this->assertFalse($result);
} }
/**
* testDeleteArticleBLinks method
*
* @access public
* @return void
*/
function testDeleteArticleBLinks() { function testDeleteArticleBLinks() {
$this->loadFixtures('Article', 'ArticlesTag', 'Tag'); $this->loadFixtures('Article', 'ArticlesTag', 'Tag');
$TestModel =& new ArticleB(); $TestModel =& new ArticleB();
@ -6493,21 +6509,16 @@ class ModelTest extends CakeTestCase {
); );
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/**
* testPkInHAbtmLinkModelArticleB
*
* @access public
* @return void
*/
function testPkInHabtmLinkModelArticleB() { function testPkInHabtmLinkModelArticleB() {
$this->loadFixtures('Article', 'Tag'); $this->loadFixtures('Article', 'Tag');
$TestModel2 =& new ArticleB(); $TestModel2 =& new ArticleB();
$this->assertEqual($TestModel2->ArticlesTag->primaryKey, 'article_id'); $this->assertEqual($TestModel2->ArticlesTag->primaryKey, 'article_id');
} }
/**
* endTest method
*
* @access public
* @return void
*/
function endTest() {
ClassRegistry::flush();
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Mock models * Mock models file
* *
* Mock classes for use in Model and related test cases * Mock classes for use in Model and related test cases
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
* @since CakePHP(tm) v 1.2.0.6464 * @since CakePHP(tm) v 1.2.0.6464
* @version $Revision$ * @version $Revision$
@ -27,11 +27,10 @@
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
} }
/** /**
* Test class * Test class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Test extends CakeTestModel { class Test extends CakeTestModel {
@ -67,7 +66,7 @@ class Test extends CakeTestModel {
/** /**
* TestAlias class * TestAlias class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TestAlias extends CakeTestModel { class TestAlias extends CakeTestModel {
@ -110,7 +109,7 @@ class TestAlias extends CakeTestModel {
/** /**
* TestValidate class * TestValidate class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TestValidate extends CakeTestModel { class TestValidate extends CakeTestModel {
@ -169,7 +168,7 @@ class TestValidate extends CakeTestModel {
/** /**
* User class * User class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class User extends CakeTestModel { class User extends CakeTestModel {
@ -191,7 +190,7 @@ class User extends CakeTestModel {
/** /**
* Article class * Article class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Article extends CakeTestModel { class Article extends CakeTestModel {
@ -263,7 +262,7 @@ class Article extends CakeTestModel {
/** /**
* NumericArticle class * NumericArticle class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class NumericArticle extends CakeTestModel { class NumericArticle extends CakeTestModel {
@ -285,7 +284,7 @@ class NumericArticle extends CakeTestModel {
/** /**
* Article10 class * Article10 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Article10 extends CakeTestModel { class Article10 extends CakeTestModel {
@ -314,7 +313,7 @@ class Article10 extends CakeTestModel {
/** /**
* ArticleFeatured class * ArticleFeatured class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ArticleFeatured extends CakeTestModel { class ArticleFeatured extends CakeTestModel {
@ -364,7 +363,7 @@ class ArticleFeatured extends CakeTestModel {
/** /**
* Featured class * Featured class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Featured extends CakeTestModel { class Featured extends CakeTestModel {
@ -386,7 +385,7 @@ class Featured extends CakeTestModel {
/** /**
* Tag class * Tag class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Tag extends CakeTestModel { class Tag extends CakeTestModel {
@ -401,7 +400,7 @@ class Tag extends CakeTestModel {
/** /**
* ArticlesTag class * ArticlesTag class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ArticlesTag extends CakeTestModel { class ArticlesTag extends CakeTestModel {
@ -416,7 +415,7 @@ class ArticlesTag extends CakeTestModel {
/** /**
* ArticleFeaturedsTag class * ArticleFeaturedsTag class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ArticleFeaturedsTag extends CakeTestModel { class ArticleFeaturedsTag extends CakeTestModel {
@ -431,7 +430,7 @@ class ArticleFeaturedsTag extends CakeTestModel {
/** /**
* Comment class * Comment class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Comment extends CakeTestModel { class Comment extends CakeTestModel {
@ -460,7 +459,7 @@ class Comment extends CakeTestModel {
/** /**
* Modified Comment Class has afterFind Callback * Modified Comment Class has afterFind Callback
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ModifiedComment extends CakeTestModel { class ModifiedComment extends CakeTestModel {
@ -501,7 +500,7 @@ class ModifiedComment extends CakeTestModel {
/** /**
* MergeVarPluginAppModel class * MergeVarPluginAppModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class MergeVarPluginAppModel extends AppModel { class MergeVarPluginAppModel extends AppModel {
@ -517,7 +516,7 @@ class MergeVarPluginAppModel extends AppModel {
/** /**
* MergeVarPluginPost class * MergeVarPluginPost class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class MergeVarPluginPost extends MergeVarPluginAppModel { class MergeVarPluginPost extends MergeVarPluginAppModel {
@ -539,7 +538,7 @@ class MergeVarPluginPost extends MergeVarPluginAppModel {
/** /**
* MergeVarPluginComment class * MergeVarPluginComment class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class MergeVarPluginComment extends MergeVarPluginAppModel { class MergeVarPluginComment extends MergeVarPluginAppModel {
@ -563,7 +562,7 @@ class MergeVarPluginComment extends MergeVarPluginAppModel {
/** /**
* Attachment class * Attachment class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Attachment extends CakeTestModel { class Attachment extends CakeTestModel {
@ -578,7 +577,7 @@ class Attachment extends CakeTestModel {
/** /**
* Category class * Category class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Category extends CakeTestModel { class Category extends CakeTestModel {
@ -593,7 +592,7 @@ class Category extends CakeTestModel {
/** /**
* CategoryThread class * CategoryThread class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class CategoryThread extends CakeTestModel { class CategoryThread extends CakeTestModel {
@ -615,7 +614,7 @@ class CategoryThread extends CakeTestModel {
/** /**
* Apple class * Apple class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Apple extends CakeTestModel { class Apple extends CakeTestModel {
@ -658,7 +657,7 @@ class Apple extends CakeTestModel {
/** /**
* Sample class * Sample class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Sample extends CakeTestModel { class Sample extends CakeTestModel {
@ -680,7 +679,7 @@ class Sample extends CakeTestModel {
/** /**
* AnotherArticle class * AnotherArticle class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class AnotherArticle extends CakeTestModel { class AnotherArticle extends CakeTestModel {
@ -702,7 +701,7 @@ class AnotherArticle extends CakeTestModel {
/** /**
* Advertisement class * Advertisement class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Advertisement extends CakeTestModel { class Advertisement extends CakeTestModel {
@ -724,7 +723,7 @@ class Advertisement extends CakeTestModel {
/** /**
* Home class * Home class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Home extends CakeTestModel { class Home extends CakeTestModel {
@ -746,7 +745,7 @@ class Home extends CakeTestModel {
/** /**
* Post class * Post class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Post extends CakeTestModel { class Post extends CakeTestModel {
@ -768,7 +767,7 @@ class Post extends CakeTestModel {
/** /**
* Author class * Author class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Author extends CakeTestModel { class Author extends CakeTestModel {
@ -801,7 +800,7 @@ class Author extends CakeTestModel {
/** /**
* ModifiedAuthor class * ModifiedAuthor class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ModifiedAuthor extends Author { class ModifiedAuthor extends Author {
@ -829,7 +828,7 @@ class ModifiedAuthor extends Author {
/** /**
* Project class * Project class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Project extends CakeTestModel { class Project extends CakeTestModel {
@ -851,7 +850,7 @@ class Project extends CakeTestModel {
/** /**
* Thread class * Thread class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Thread extends CakeTestModel { class Thread extends CakeTestModel {
@ -880,7 +879,7 @@ class Thread extends CakeTestModel {
/** /**
* Message class * Message class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Message extends CakeTestModel { class Message extends CakeTestModel {
@ -902,7 +901,7 @@ class Message extends CakeTestModel {
/** /**
* Bid class * Bid class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Bid extends CakeTestModel { class Bid extends CakeTestModel {
@ -924,7 +923,7 @@ class Bid extends CakeTestModel {
/** /**
* NodeAfterFind class * NodeAfterFind class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class NodeAfterFind extends CakeTestModel { class NodeAfterFind extends CakeTestModel {
@ -984,7 +983,7 @@ class NodeAfterFind extends CakeTestModel {
/** /**
* NodeAfterFindSample class * NodeAfterFindSample class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class NodeAfterFindSample extends CakeTestModel { class NodeAfterFindSample extends CakeTestModel {
@ -1013,7 +1012,7 @@ class NodeAfterFindSample extends CakeTestModel {
/** /**
* NodeNoAfterFind class * NodeNoAfterFind class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class NodeNoAfterFind extends CakeTestModel { class NodeNoAfterFind extends CakeTestModel {
@ -1063,7 +1062,7 @@ class NodeNoAfterFind extends CakeTestModel {
/** /**
* Node class * Node class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Node extends CakeTestModel{ class Node extends CakeTestModel{
@ -1093,7 +1092,7 @@ class Node extends CakeTestModel{
/** /**
* Dependency class * Dependency class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Dependency extends CakeTestModel { class Dependency extends CakeTestModel {
@ -1108,7 +1107,7 @@ class Dependency extends CakeTestModel {
/** /**
* ModelA class * ModelA class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ModelA extends CakeTestModel { class ModelA extends CakeTestModel {
@ -1137,7 +1136,7 @@ class ModelA extends CakeTestModel {
/** /**
* ModelB class * ModelB class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ModelB extends CakeTestModel { class ModelB extends CakeTestModel {
@ -1166,7 +1165,7 @@ class ModelB extends CakeTestModel {
/** /**
* ModelC class * ModelC class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ModelC extends CakeTestModel { class ModelC extends CakeTestModel {
@ -1195,7 +1194,7 @@ class ModelC extends CakeTestModel {
/** /**
* ModelD class * ModelD class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ModelD extends CakeTestModel { class ModelD extends CakeTestModel {
@ -1217,7 +1216,7 @@ class ModelD extends CakeTestModel {
/** /**
* Something class * Something class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Something extends CakeTestModel { class Something extends CakeTestModel {
@ -1239,7 +1238,7 @@ class Something extends CakeTestModel {
/** /**
* SomethingElse class * SomethingElse class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class SomethingElse extends CakeTestModel { class SomethingElse extends CakeTestModel {
@ -1261,7 +1260,7 @@ class SomethingElse extends CakeTestModel {
/** /**
* JoinThing class * JoinThing class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class JoinThing extends CakeTestModel { class JoinThing extends CakeTestModel {
@ -1283,7 +1282,7 @@ class JoinThing extends CakeTestModel {
/** /**
* Portfolio class * Portfolio class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Portfolio extends CakeTestModel { class Portfolio extends CakeTestModel {
@ -1305,7 +1304,7 @@ class Portfolio extends CakeTestModel {
/** /**
* Item class * Item class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Item extends CakeTestModel { class Item extends CakeTestModel {
@ -1334,7 +1333,7 @@ class Item extends CakeTestModel {
/** /**
* ItemsPortfolio class * ItemsPortfolio class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ItemsPortfolio extends CakeTestModel { class ItemsPortfolio extends CakeTestModel {
@ -1349,7 +1348,7 @@ class ItemsPortfolio extends CakeTestModel {
/** /**
* Syfile class * Syfile class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Syfile extends CakeTestModel { class Syfile extends CakeTestModel {
@ -1371,7 +1370,7 @@ class Syfile extends CakeTestModel {
/** /**
* Image class * Image class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Image extends CakeTestModel { class Image extends CakeTestModel {
@ -1386,7 +1385,7 @@ class Image extends CakeTestModel {
/** /**
* DeviceType class * DeviceType class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class DeviceType extends CakeTestModel { class DeviceType extends CakeTestModel {
@ -1426,7 +1425,7 @@ class DeviceType extends CakeTestModel {
/** /**
* DeviceTypeCategory class * DeviceTypeCategory class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class DeviceTypeCategory extends CakeTestModel { class DeviceTypeCategory extends CakeTestModel {
@ -1441,7 +1440,7 @@ class DeviceTypeCategory extends CakeTestModel {
/** /**
* FeatureSet class * FeatureSet class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class FeatureSet extends CakeTestModel { class FeatureSet extends CakeTestModel {
@ -1456,7 +1455,7 @@ class FeatureSet extends CakeTestModel {
/** /**
* ExteriorTypeCategory class * ExteriorTypeCategory class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ExteriorTypeCategory extends CakeTestModel { class ExteriorTypeCategory extends CakeTestModel {
@ -1478,7 +1477,7 @@ class ExteriorTypeCategory extends CakeTestModel {
/** /**
* Document class * Document class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Document extends CakeTestModel { class Document extends CakeTestModel {
@ -1500,7 +1499,7 @@ class Document extends CakeTestModel {
/** /**
* Device class * Device class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Device extends CakeTestModel { class Device extends CakeTestModel {
@ -1515,7 +1514,7 @@ class Device extends CakeTestModel {
/** /**
* DocumentDirectory class * DocumentDirectory class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class DocumentDirectory extends CakeTestModel { class DocumentDirectory extends CakeTestModel {
@ -1530,7 +1529,7 @@ class DocumentDirectory extends CakeTestModel {
/** /**
* PrimaryModel class * PrimaryModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class PrimaryModel extends CakeTestModel { class PrimaryModel extends CakeTestModel {
@ -1545,7 +1544,7 @@ class PrimaryModel extends CakeTestModel {
/** /**
* SecondaryModel class * SecondaryModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class SecondaryModel extends CakeTestModel { class SecondaryModel extends CakeTestModel {
@ -1560,7 +1559,7 @@ class SecondaryModel extends CakeTestModel {
/** /**
* JoinA class * JoinA class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class JoinA extends CakeTestModel { class JoinA extends CakeTestModel {
@ -1582,7 +1581,7 @@ class JoinA extends CakeTestModel {
/** /**
* JoinB class * JoinB class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class JoinB extends CakeTestModel { class JoinB extends CakeTestModel {
@ -1604,7 +1603,7 @@ class JoinB extends CakeTestModel {
/** /**
* JoinC class * JoinC class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class JoinC extends CakeTestModel { class JoinC extends CakeTestModel {
@ -1626,7 +1625,7 @@ class JoinC extends CakeTestModel {
/** /**
* ThePaper class * ThePaper class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ThePaper extends CakeTestModel { class ThePaper extends CakeTestModel {
@ -1662,7 +1661,7 @@ class ThePaper extends CakeTestModel {
/** /**
* Monkey class * Monkey class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Monkey extends CakeTestModel { class Monkey extends CakeTestModel {
@ -1684,7 +1683,7 @@ class Monkey extends CakeTestModel {
/** /**
* AssociationTest1 class * AssociationTest1 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class AssociationTest1 extends CakeTestModel { class AssociationTest1 extends CakeTestModel {
@ -1715,7 +1714,7 @@ class AssociationTest1 extends CakeTestModel {
/** /**
* AssociationTest2 class * AssociationTest2 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class AssociationTest2 extends CakeTestModel { class AssociationTest2 extends CakeTestModel {
@ -1746,7 +1745,7 @@ class AssociationTest2 extends CakeTestModel {
/** /**
* Callback class * Callback class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Callback extends CakeTestModel { class Callback extends CakeTestModel {
@ -1755,7 +1754,7 @@ class Callback extends CakeTestModel {
/** /**
* Uuid class * Uuid class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Uuid extends CakeTestModel { class Uuid extends CakeTestModel {
@ -1770,7 +1769,7 @@ class Uuid extends CakeTestModel {
/** /**
* DataTest class * DataTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class DataTest extends CakeTestModel { class DataTest extends CakeTestModel {
@ -1785,7 +1784,7 @@ class DataTest extends CakeTestModel {
/** /**
* TheVoid class * TheVoid class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TheVoid extends CakeTestModel { class TheVoid extends CakeTestModel {
@ -1807,7 +1806,7 @@ class TheVoid extends CakeTestModel {
/** /**
* ValidationTest class * ValidationTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ValidationTest extends CakeTestModel { class ValidationTest extends CakeTestModel {
@ -1880,7 +1879,7 @@ class ValidationTest extends CakeTestModel {
/** /**
* ValidationTest2 class * ValidationTest2 class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ValidationTest2 extends CakeTestModel { class ValidationTest2 extends CakeTestModel {
@ -1936,7 +1935,7 @@ class ValidationTest2 extends CakeTestModel {
/** /**
* Person class * Person class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Person extends CakeTestModel { class Person extends CakeTestModel {
@ -1964,7 +1963,7 @@ class Person extends CakeTestModel {
/** /**
* UnderscoreField class * UnderscoreField class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class UnderscoreField extends CakeTestModel { class UnderscoreField extends CakeTestModel {
@ -1979,7 +1978,7 @@ class UnderscoreField extends CakeTestModel {
/** /**
* Product class * Product class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Product extends CakeTestModel { class Product extends CakeTestModel {
@ -1994,7 +1993,7 @@ class Product extends CakeTestModel {
/** /**
* Story class * Story class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Story extends CakeTestModel { class Story extends CakeTestModel {
@ -2030,7 +2029,7 @@ class Story extends CakeTestModel {
/** /**
* Cd class * Cd class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Cd extends CakeTestModel { class Cd extends CakeTestModel {
@ -2052,7 +2051,7 @@ class Cd extends CakeTestModel {
/** /**
* Book class * Book class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Book extends CakeTestModel { class Book extends CakeTestModel {
@ -2074,7 +2073,7 @@ class Book extends CakeTestModel {
/** /**
* OverallFavorite class * OverallFavorite class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class OverallFavorite extends CakeTestModel { class OverallFavorite extends CakeTestModel {
@ -2089,7 +2088,7 @@ class OverallFavorite extends CakeTestModel {
/** /**
* MyUser class * MyUser class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class MyUser extends CakeTestModel { class MyUser extends CakeTestModel {
@ -2111,7 +2110,7 @@ class MyUser extends CakeTestModel {
/** /**
* MyCategory class * MyCategory class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class MyCategory extends CakeTestModel { class MyCategory extends CakeTestModel {
@ -2133,7 +2132,7 @@ class MyCategory extends CakeTestModel {
/** /**
* MyProduct class * MyProduct class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class MyProduct extends CakeTestModel { class MyProduct extends CakeTestModel {
@ -2155,7 +2154,7 @@ class MyProduct extends CakeTestModel {
/** /**
* MyCategoriesMyUser class * MyCategoriesMyUser class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class MyCategoriesMyUser extends CakeTestModel { class MyCategoriesMyUser extends CakeTestModel {
@ -2170,7 +2169,7 @@ class MyCategoriesMyUser extends CakeTestModel {
/** /**
* MyCategoriesMyProduct class * MyCategoriesMyProduct class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class MyCategoriesMyProduct extends CakeTestModel { class MyCategoriesMyProduct extends CakeTestModel {
@ -2185,7 +2184,7 @@ class MyCategoriesMyProduct extends CakeTestModel {
/** /**
* I18nModel class * I18nModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class I18nModel extends CakeTestModel { class I18nModel extends CakeTestModel {
@ -2214,7 +2213,7 @@ class I18nModel extends CakeTestModel {
/** /**
* NumberTree class * NumberTree class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class NumberTree extends CakeTestModel { class NumberTree extends CakeTestModel {
@ -2277,7 +2276,7 @@ class NumberTree extends CakeTestModel {
/** /**
* FlagTree class * FlagTree class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class FlagTree extends NumberTree { class FlagTree extends NumberTree {
@ -2292,7 +2291,7 @@ class FlagTree extends NumberTree {
/** /**
* UnconventionalTree class * UnconventionalTree class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class UnconventionalTree extends NumberTree { class UnconventionalTree extends NumberTree {
@ -2314,7 +2313,7 @@ class UnconventionalTree extends NumberTree {
/** /**
* UuidTree class * UuidTree class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class UuidTree extends NumberTree { class UuidTree extends NumberTree {
@ -2330,7 +2329,7 @@ class UuidTree extends NumberTree {
/** /**
* Campaign class * Campaign class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Campaign extends CakeTestModel { class Campaign extends CakeTestModel {
@ -2352,7 +2351,7 @@ class Campaign extends CakeTestModel {
/** /**
* Ad class * Ad class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Ad extends CakeTestModel { class Ad extends CakeTestModel {
@ -2381,7 +2380,7 @@ class Ad extends CakeTestModel {
/** /**
* AfterTree class * AfterTree class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class AfterTree extends NumberTree { class AfterTree extends NumberTree {
@ -2409,7 +2408,7 @@ class AfterTree extends NumberTree {
/** /**
* Nonconformant Content class * Nonconformant Content class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Content extends CakeTestModel { class Content extends CakeTestModel {
@ -2445,7 +2444,7 @@ class Content extends CakeTestModel {
/** /**
* Nonconformant Account class * Nonconformant Account class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Account extends CakeTestModel { class Account extends CakeTestModel {
@ -2474,7 +2473,7 @@ class Account extends CakeTestModel {
/** /**
* Nonconformant ContentAccount class * Nonconformant ContentAccount class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class ContentAccount extends CakeTestModel { class ContentAccount extends CakeTestModel {
@ -2503,7 +2502,7 @@ class ContentAccount extends CakeTestModel {
/** /**
* FilmFile class * FilmFile class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class FilmFile extends CakeTestModel { class FilmFile extends CakeTestModel {
@ -2512,7 +2511,7 @@ class FilmFile extends CakeTestModel {
/** /**
* Basket test model * Basket test model
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Basket extends CakeTestModel { class Basket extends CakeTestModel {
@ -2531,7 +2530,7 @@ class Basket extends CakeTestModel {
/** /**
* TestPluginArticle class * TestPluginArticle class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TestPluginArticle extends CakeTestModel { class TestPluginArticle extends CakeTestModel {
@ -2566,7 +2565,7 @@ class TestPluginArticle extends CakeTestModel {
/** /**
* TestPluginComment class * TestPluginComment class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TestPluginComment extends CakeTestModel { class TestPluginComment extends CakeTestModel {
@ -2594,7 +2593,7 @@ class TestPluginComment extends CakeTestModel {
/** /**
* Uuidportfolio class * Uuidportfolio class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Uuidportfolio extends CakeTestModel { class Uuidportfolio extends CakeTestModel {
@ -2616,7 +2615,7 @@ class Uuidportfolio extends CakeTestModel {
/** /**
* Uuiditem class * Uuiditem class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class Uuiditem extends CakeTestModel { class Uuiditem extends CakeTestModel {
@ -2641,7 +2640,7 @@ class Uuiditem extends CakeTestModel {
/** /**
* UuiditemsPortfolio class * UuiditemsPortfolio class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class UuiditemsUuidportfolio extends CakeTestModel { class UuiditemsUuidportfolio extends CakeTestModel {
@ -2656,7 +2655,7 @@ class UuiditemsUuidportfolio extends CakeTestModel {
/** /**
* UuiditemsPortfolioNumericid class * UuiditemsPortfolioNumericid class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class UuiditemsUuidportfolioNumericid extends CakeTestModel { class UuiditemsUuidportfolioNumericid extends CakeTestModel {
@ -2671,7 +2670,7 @@ class UuiditemsUuidportfolioNumericid extends CakeTestModel {
/** /**
* TranslateTestModel class. * TranslateTestModel class.
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TranslateTestModel extends CakeTestModel { class TranslateTestModel extends CakeTestModel {
@ -2700,7 +2699,7 @@ class TranslateTestModel extends CakeTestModel {
/** /**
* TranslatedItem class. * TranslatedItem class.
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TranslatedItem extends CakeTestModel { class TranslatedItem extends CakeTestModel {
@ -2736,7 +2735,7 @@ class TranslatedItem extends CakeTestModel {
/** /**
* TranslatedItemWithTable class. * TranslatedItemWithTable class.
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TranslatedItemWithTable extends CakeTestModel { class TranslatedItemWithTable extends CakeTestModel {
@ -2786,7 +2785,7 @@ class TranslatedItemWithTable extends CakeTestModel {
/** /**
* TranslateArticleModel class. * TranslateArticleModel class.
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TranslateArticleModel extends CakeTestModel { class TranslateArticleModel extends CakeTestModel {
@ -2815,7 +2814,7 @@ class TranslateArticleModel extends CakeTestModel {
/** /**
* TranslatedArticle class. * TranslatedArticle class.
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TranslatedArticle extends CakeTestModel { class TranslatedArticle extends CakeTestModel {

View file

@ -15,7 +15,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5550 * @since CakePHP(tm) v 1.2.0.5550
* @version $Revision$ * @version $Revision$
@ -24,11 +24,10 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', 'Schema'); App::import('Core', 'Schema');
/** /**
* Test for Schema database management * Test for Schema database management
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class MyAppSchema extends CakeSchema { class MyAppSchema extends CakeSchema {
@ -102,7 +101,7 @@ class MyAppSchema extends CakeSchema {
/** /**
* TestAppSchema class * TestAppSchema class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class TestAppSchema extends CakeSchema { class TestAppSchema extends CakeSchema {
@ -200,9 +199,9 @@ class TestAppSchema extends CakeSchema {
} }
} }
/** /**
* Short description for class. * SchmeaPost class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class SchemaPost extends CakeTestModel { class SchemaPost extends CakeTestModel {
@ -234,12 +233,11 @@ class SchemaPost extends CakeTestModel {
* @access public * @access public
*/ */
var $hasAndBelongsToMany = array('SchemaTag'); var $hasAndBelongsToMany = array('SchemaTag');
} }
/** /**
* Short description for class. * SchemaComment class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class SchemaComment extends CakeTestModel { class SchemaComment extends CakeTestModel {
@ -266,9 +264,9 @@ class SchemaComment extends CakeTestModel {
var $belongsTo = array('SchemaPost'); var $belongsTo = array('SchemaPost');
} }
/** /**
* Short description for class. * SchemaTag class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class SchemaTag extends CakeTestModel { class SchemaTag extends CakeTestModel {
@ -295,9 +293,9 @@ class SchemaTag extends CakeTestModel {
var $hasAndBelongsToMany = array('SchemaPost'); var $hasAndBelongsToMany = array('SchemaPost');
} }
/** /**
* Short description for class. * SchemaDatatype class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.model * @subpackage cake.tests.cases.libs.model
*/ */
class SchemaDatatype extends CakeTestModel { class SchemaDatatype extends CakeTestModel {
@ -319,8 +317,9 @@ class SchemaDatatype extends CakeTestModel {
/** /**
* Testdescribe class * Testdescribe class
* *
* This class is defined purely to inherit the cacheSources variable otherwise testSchemaCreatTable will fail if * This class is defined purely to inherit the cacheSources variable otherwise
* listSources has already been called and its source cache populated - I.e. if the test is run within a group * testSchemaCreatTable will fail if listSources has already been called and
* its source cache populated - I.e. if the test is run within a group
* *
* @uses CakeTestModel * @uses CakeTestModel
* @package * @package
@ -336,9 +335,9 @@ class Testdescribe extends CakeTestModel {
var $name = 'Testdescribe'; var $name = 'Testdescribe';
} }
/** /**
* Short description for class. * CakeSchemaTest
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class CakeSchemaTest extends CakeTestCase { class CakeSchemaTest extends CakeTestCase {
@ -358,6 +357,15 @@ class CakeSchemaTest extends CakeTestCase {
function startTest() { function startTest() {
$this->Schema = new TestAppSchema(); $this->Schema = new TestAppSchema();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Schema);
}
/** /**
* testSchemaName method * testSchemaName method
* *
@ -492,14 +500,5 @@ class CakeSchemaTest extends CakeTestCase {
$column = $this->db->buildColumn($col); $column = $this->db->buildColumn($col);
$this->assertPattern('/' . preg_quote($column, '/') . '/', $sql); $this->assertPattern('/' . preg_quote($column, '/') . '/', $sql);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Schema);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * MultibyteTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.6833 * @since CakePHP(tm) v 1.2.0.6833
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'Multibyte'); App::import('Core', 'Multibyte');
/** /**
* Short description for class. * MultibyteTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class MultibyteTest extends CakeTestCase { class MultibyteTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * ObjectTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -117,6 +117,37 @@ class RequestActionController extends Controller {
return $this->params; return $this->params;
} }
} }
/**
* RequestActionPersistentController class
*
* @package cake
* @subpackage cake.tests.cases.libs
*/
class RequestActionPersistentController extends Controller {
/**
* uses property
*
* @var array
* @access public
*/
var $uses = array('PersisterOne');
/**
* persistModel property
*
* @var array
* @access public
*/
var $persistModel = true;
/**
* post pass, testing post passing
*
* @return array
**/
function index() {
return 'This is a test';
}
}
/** /**
* TestObject class * TestObject class
* *
@ -240,7 +271,6 @@ class TestObject extends Object {
function methodWithOptionalParam($param = null) { function methodWithOptionalParam($param = null) {
$this->methodCalls[] = array('methodWithOptionalParam' => array($param)); $this->methodCalls[] = array('methodWithOptionalParam' => array($param));
} }
/** /**
* testPersist * testPersist
* *
@ -250,24 +280,20 @@ class TestObject extends Object {
return $this->_persist($name, $return, $object, $type); return $this->_persist($name, $return, $object, $type);
} }
} }
/** /**
* ObjectTestModel * ObjectTestModel class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class ObjectTestModel extends CakeTestModel { class ObjectTestModel extends CakeTestModel {
var $useTable = false; var $useTable = false;
var $name = 'ObjectTestModel'; var $name = 'ObjectTestModel';
} }
/** /**
* Object Test Class * Object Test class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class ObjectTest extends CakeTestCase { class ObjectTest extends CakeTestCase {
@ -276,7 +302,7 @@ class ObjectTest extends CakeTestCase {
* *
* @var string * @var string
**/ **/
var $fixtures = array('core.post'); var $fixtures = array('core.post', 'core.comment');
/** /**
* setUp method * setUp method
* *
@ -286,6 +312,15 @@ class ObjectTest extends CakeTestCase {
function setUp() { function setUp() {
$this->object = new TestObject(); $this->object = new TestObject();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->object);
}
/** /**
* testLog method * testLog method
* *
@ -378,6 +413,104 @@ class ObjectTest extends CakeTestCase {
Configure::write('Cache.disable', $cacheDisable); Configure::write('Cache.disable', $cacheDisable);
} }
/** /**
* testPersistWithRequestAction method
*
* @access public
* @return void
*/
function testPersistWithBehavior() {
ClassRegistry::flush();
$cacheDisable = Configure::read('Cache.disable');
Configure::write('Cache.disable', false);
Configure::write('modelPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS));
Configure::write('behaviorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS));
$this->assertFalse(class_exists('PersisterOneBehaviorBehavior'));
$this->assertFalse(class_exists('PersisterTwoBehaviorBehavior'));
$Controller = new RequestActionPersistentController();
$Controller->persistModel = true;
$Controller->constructClasses();
$this->assertTrue(file_exists(CACHE . 'persistent' . DS . 'persisterone.php'));
$this->assertTrue(file_exists(CACHE . 'persistent' . DS . 'persisteroneregistry.php'));
$contents = str_replace('"PersisterOne"', '"PersisterTwo"', file_get_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php'));
$contents = str_replace('persister_one_', 'persister_two_', file_get_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php'));
$result = file_put_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php', $contents);
$this->assertTrue(class_exists('PersisterOneBehaviorBehavior'));
$this->assertFalse(class_exists('PersisterTwoBehaviorBehavior'));
$Controller = new RequestActionPersistentController();
$Controller->persistModel = true;
$Controller->constructClasses();
$this->assertTrue(class_exists('PersisterOneBehaviorBehavior'));
$this->assertTrue(class_exists('PersisterTwoBehaviorBehavior'));
@unlink(CACHE . 'persistent' . DS . 'persisterone.php');
@unlink(CACHE . 'persistent' . DS . 'persisteroneregistry.php');
}
/**
* testPersistWithBehaviorAndRequestAction method
*
* @see testPersistWithBehavior
* @access public
* @return void
*/
function testPersistWithBehaviorAndRequestAction() {
ClassRegistry::flush();
$cacheDisable = Configure::read('Cache.disable');
Configure::write('Cache.disable', false);
$this->assertFalse(class_exists('ContainableBehavior'));
Configure::write('modelPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS));
Configure::write('behaviorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS));
$this->assertFalse(class_exists('PersistOneBehaviorBehavior'));
$this->assertFalse(class_exists('PersistTwoBehaviorBehavior'));
$Controller = new RequestActionPersistentController();
$Controller->persistModel = true;
$Controller->constructClasses();
$this->assertTrue(file_exists(CACHE . 'persistent' . DS . 'persisterone.php'));
$this->assertTrue(file_exists(CACHE . 'persistent' . DS . 'persisteroneregistry.php'));
$keys = ClassRegistry::keys();
$this->assertEqual($keys, array('persister_one', 'comment', 'persister_one_behavior_behavior'));
ob_start();
$Controller->set('content_for_layout', 'cool');
$Controller->render('index', 'ajax', '/layouts/ajax');
$result = ob_get_clean();
$keys = ClassRegistry::keys();
$this->assertEqual($keys, array('persister_one', 'comment', 'persister_one_behavior_behavior', 'view'));
$result = $this->object->requestAction('/request_action_persistent/index');
$expected = 'This is a test';
$this->assertEqual($result, $expected);
@unlink(CACHE . 'persistent' . DS . 'persisterone.php');
@unlink(CACHE . 'persistent' . DS . 'persisteroneregistry.php');
$Controller = new RequestActionPersistentController();
$Controller->persistModel = true;
$Controller->constructClasses();
@unlink(CACHE . 'persistent' . DS . 'persisterone.php');
@unlink(CACHE . 'persistent' . DS . 'persisteroneregistry.php');
Configure::write('Cache.disable', $cacheDisable);
}
/**
* testToString method * testToString method
* *
* @access public * @access public
@ -593,7 +726,6 @@ class ObjectTest extends CakeTestCase {
$_POST = $_tmp; $_POST = $_tmp;
} }
/** /**
* testCakeError * testCakeError
* *
@ -602,14 +734,5 @@ class ObjectTest extends CakeTestCase {
function testCakeError() { function testCakeError() {
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->object);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * OverloadableTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'Overloadable'); App::import('Core', 'Overloadable');
/** /**
* Short description for class. * OverloadableTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class OverloadableTest extends CakeTestCase { class OverloadableTest extends CakeTestCase {
@ -39,7 +39,7 @@ class OverloadableTest extends CakeTestCase {
* @return void * @return void
*/ */
function skip() { function skip() {
$this->skipif (true, 'OverloadableTest not implemented'); $this->skipif(true, 'OverloadableTest not implemented');
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * RouterTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -29,11 +29,10 @@ App::import('Core', array('Router', 'Debugger'));
if (!defined('FULL_BASE_URL')) { if (!defined('FULL_BASE_URL')) {
define('FULL_BASE_URL', 'http://cakephp.org'); define('FULL_BASE_URL', 'http://cakephp.org');
} }
/** /**
* Short description for class. * RouterTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class RouterTest extends CakeTestCase { class RouterTest extends CakeTestCase {
@ -1494,7 +1493,6 @@ class RouterTest extends CakeTestCase {
$expected = array('pass' => array(), 'named' => array(), 'plugin' => null, 'controller' => 'posts', 'action' => 'index'); $expected = array('pass' => array(), 'named' => array(), 'plugin' => null, 'controller' => 'posts', 'action' => 'index');
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/** /**
* Tests URL generation with flags and prefixes in and out of context * Tests URL generation with flags and prefixes in and out of context
* *

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * SanitizeTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5428 * @since CakePHP(tm) v 1.2.0.5428
* @version $Revision$ * @version $Revision$
@ -70,9 +70,9 @@ class SanitizeArticle extends CakeTestModel {
var $useTable = 'articles'; var $useTable = 'articles';
} }
/** /**
* Short description for class. * SanitizeTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class SanitizeTest extends CakeTestCase { class SanitizeTest extends CakeTestCase {
@ -445,5 +445,4 @@ class SanitizeTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * SecurityTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'Security'); App::import('Core', 'Security');
/** /**
* Short description for class. * SecurityTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class SecurityTest extends CakeTestCase { class SecurityTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * SessionTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -28,9 +28,9 @@ if (!class_exists('CakeSession')) {
App::import('Core', 'Session'); App::import('Core', 'Session');
} }
/** /**
* Short description for class. * SessionTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class SessionTest extends CakeTestCase { class SessionTest extends CakeTestCase {
@ -369,6 +369,11 @@ class SessionTest extends CakeTestCase {
$this->Session->destroy(); $this->Session->destroy();
$this->assertFalse($this->Session->read('SessionTestCase')); $this->assertFalse($this->Session->read('SessionTestCase'));
session_write_close(); session_write_close();
unset($_SESSION);
ini_set('session.save_handler', 'files');
Configure::write('Session.save', 'php');
$this->setUp();
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * SetTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -25,11 +25,10 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', 'Set'); App::import('Core', 'Set');
/** /**
* UnitTestCase for the Set class * SetTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class SetTest extends CakeTestCase { class SetTest extends CakeTestCase {
@ -1052,15 +1051,17 @@ class SetTest extends CakeTestCase {
*/ */
function testSetExtractReturnsEmptyArray() { function testSetExtractReturnsEmptyArray() {
$this->assertEqual(Set::extract(array(), '/Post/id'), array()); $this->assertIdentical(Set::extract(array(), '/Post/id'), array());
$this->assertEqual(Set::extract('/Post/id', array()), array()); $this->assertIdentical(Set::extract('/Post/id', array()), array());
$this->assertEqual(Set::extract('/Post/id', array( $this->assertIdentical(Set::extract('/Post/id', array(
array('Post' => array('name' => 'bob')), array('Post' => array('name' => 'bob')),
array('Post' => array('name' => 'jim')) array('Post' => array('name' => 'jim'))
)), array()); )), array());
$this->assertIdentical(Set::extract(array(), 'Message.flash'), null);
} }
/** /**
* testClassicExtract method * testClassicExtract method
@ -2573,7 +2574,6 @@ class SetTest extends CakeTestCase {
$set = array('a' => 'hi'); $set = array('a' => 'hi');
$this->assertFalse(Set::check($set, 'a.b')); $this->assertFalse(Set::check($set, 'a.b'));
} }
/** /**
* Tests Set::flatten * Tests Set::flatten
* *
@ -2610,5 +2610,4 @@ class SetTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * SocketTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'Socket'); App::import('Core', 'Socket');
/** /**
* Short description for class. * SocketTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class SocketTest extends CakeTestCase { class SocketTest extends CakeTestCase {
@ -41,6 +41,15 @@ class SocketTest extends CakeTestCase {
function setUp() { function setUp() {
$this->Socket = new CakeSocket(); $this->Socket = new CakeSocket();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Socket);
}
/** /**
* testConstruct method * testConstruct method
* *
@ -165,14 +174,5 @@ class SocketTest extends CakeTestCase {
$anotherSocket->reset(); $anotherSocket->reset();
$this->assertEqual(array(), $anotherSocket->config); $this->assertEqual(array(), $anotherSocket->config);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Socket);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * StringTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.5432 * @since CakePHP(tm) v 1.2.0.5432
* @version $Revision$ * @version $Revision$
@ -26,9 +26,9 @@
*/ */
App::import('Core', 'String'); App::import('Core', 'String');
/** /**
* Short description for class. * StringTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class StringTest extends CakeTestCase { class StringTest extends CakeTestCase {

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * TestManagerTest file
* *
* Long description for file * Long description for file
* *
@ -16,20 +16,26 @@
* Redistributions of files must retain the above copyright notice. * Redistributions of files must retain the above copyright notice.
* *
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
* @modifiedby $LastChangedBy$ * @modifiedby $LastChangedBy$
* @lastmodified $Date$ * @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
App::import('Core', 'TestManager'); App::import('Core', 'TestManager');
/**
* TestManagerTest class
*
* @package cake
* @subpackage cake.tests.cases.libs
*/
class TestManagerTest extends CakeTestCase { class TestManagerTest extends CakeTestCase {
/** /**
* undocumented function * setUp method
* *
* @return void * @return void
* @access public * @access public
@ -39,7 +45,7 @@ class TestManagerTest extends CakeTestCase {
$this->Reporter =& new CakeHtmlReporter(); $this->Reporter =& new CakeHtmlReporter();
} }
/** /**
* undocumented function * testRunAllTests method
* *
* @return void * @return void
* @access public * @access public
@ -55,7 +61,7 @@ class TestManagerTest extends CakeTestCase {
$this->assertEqual(count($out), count($list)); $this->assertEqual(count($out), count($list));
} }
/** /**
* undocumented function * testRunTestCase method
* *
* @return void * @return void
* @access public * @access public
@ -71,49 +77,44 @@ class TestManagerTest extends CakeTestCase {
$this->assertTrue($result); $this->assertTrue($result);
} }
/** /**
* undocumented function * testRunGroupTest method
* *
* @return void * @return void
* @access public * @access public
*/ */
function testRunGroupTest() { function testRunGroupTest() {
} }
/** /**
* undocumented function * testAddTestCasesFromDirectory method
* *
* @return void * @return void
* @access public * @access public
*/ */
function testAddTestCasesFromDirectory() { function testAddTestCasesFromDirectory() {
} }
/** /**
* undocumented function * testAddTestFile method
* *
* @return void * @return void
* @access public * @access public
*/ */
function testAddTestFile() { function testAddTestFile() {
} }
/** /**
* undocumented function * testGetTestCaseList method
* *
* @return void * @return void
* @access public * @access public
*/ */
function testGetTestCaseList() { function testGetTestCaseList() {
} }
/** /**
* undocumented function * testGetGroupTestList method
* *
* @return void * @return void
* @access public * @access public
*/ */
function testGetGroupTestList() { function testGetGroupTestList() {
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Validation Class Test Case * ValidationTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -43,14 +43,13 @@ class CustomValidator {
return preg_match('/^[0-9]{3}$/', $check); return preg_match('/^[0-9]{3}$/', $check);
} }
} }
/** /**
* Test Case for Validation Class * Test Case for Validation Class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class ValidationTestCase extends CakeTestCase { class ValidationTest extends CakeTestCase {
/** /**
* Validation property * Validation property
* *
@ -64,7 +63,7 @@ class ValidationTestCase extends CakeTestCase {
* @access public * @access public
* @return void * @return void
*/ */
function setup() { function setUp() {
$this->Validation =& Validation::getInstance(); $this->Validation =& Validation::getInstance();
} }
/** /**
@ -1514,6 +1513,7 @@ class ValidationTestCase extends CakeTestCase {
$this->assertTrue(Validation::email('abc@g.cn')); $this->assertTrue(Validation::email('abc@g.cn'));
$this->assertTrue(Validation::email('abc@x.com')); $this->assertTrue(Validation::email('abc@x.com'));
$this->assertTrue(Validation::email('henrik@sbcglobal.net')); $this->assertTrue(Validation::email('henrik@sbcglobal.net'));
$this->assertTrue(Validation::email('sani@sbcglobal.net'));
// all ICANN TLDs // all ICANN TLDs
$this->assertTrue(Validation::email('abc@example.aero')); $this->assertTrue(Validation::email('abc@example.aero'));

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * HelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -65,7 +65,6 @@ class HelperTestPost extends Model {
*/ */
var $hasAndBelongsToMany = array('HelperTestTag'=> array('with' => 'HelperTestPostsTag')); var $hasAndBelongsToMany = array('HelperTestTag'=> array('with' => 'HelperTestPostsTag'));
} }
/** /**
* HelperTestComment class * HelperTestComment class
* *
@ -156,11 +155,10 @@ class HelperTestPostsTag extends Model {
return $this->_schema; return $this->_schema;
} }
} }
/** /**
* Short description for class. * HelperTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs * @subpackage cake.tests.cases.libs
*/ */
class HelperTest extends CakeTestCase { class HelperTest extends CakeTestCase {
@ -180,6 +178,16 @@ class HelperTest extends CakeTestCase {
ClassRegistry::addObject('HelperTestComment', new HelperTestComment()); ClassRegistry::addObject('HelperTestComment', new HelperTestComment());
ClassRegistry::addObject('HelperTestTag', new HelperTestTag()); ClassRegistry::addObject('HelperTestTag', new HelperTestTag());
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Helper, $this->View);
ClassRegistry::flush();
}
/** /**
* testFormFieldNameParsing method * testFormFieldNameParsing method
* *
@ -518,15 +526,5 @@ class HelperTest extends CakeTestCase {
$result = $this->Helper->clean('&lt;script&gt;alert(document.cookie)&lt;/script&gt;'); $result = $this->Helper->clean('&lt;script&gt;alert(document.cookie)&lt;/script&gt;');
$this->assertEqual($result, '&amp;lt;script&amp;gt;alert(document.cookie)&amp;lt;/script&amp;gt;'); $this->assertEqual($result, '&amp;lt;script&amp;gt;alert(document.cookie)&amp;lt;/script&amp;gt;');
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Helper, $this->View);
ClassRegistry::flush();
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * AjaxHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -27,8 +27,16 @@
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
} }
uses('view'.DS.'helpers'.DS.'app_helper', 'controller'.DS.'controller', 'model'.DS.'model', 'view'.DS.'helper', 'view'.DS.'helpers'.DS.'ajax', uses(
'view'.DS.'helpers'.DS.'html', 'view'.DS.'helpers'.DS.'form', 'view'.DS.'helpers'.DS.'javascript'); 'view' . DS . 'helpers' . DS . 'app_helper',
'controller' . DS . 'controller',
'model' . DS . 'model',
'view' . DS . 'helper',
'view' . DS . 'helpers'.DS.'ajax',
'view' . DS . 'helpers' . DS . 'html',
'view' . DS . 'helpers' . DS . 'form',
'view' . DS . 'helpers' . DS . 'javascript'
);
/** /**
* AjaxTestController class * AjaxTestController class
* *
@ -131,14 +139,13 @@ class TestJavascriptHelper extends JavascriptHelper {
$this->codeBlocks[] = $parameter; $this->codeBlocks[] = $parameter;
} }
} }
/** /**
* Short description for class. * AjaxTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class AjaxTest extends CakeTestCase { class AjaxHelperTest extends CakeTestCase {
/** /**
* Regexp for CDATA start block * Regexp for CDATA start block
* *
@ -168,6 +175,16 @@ class AjaxTest extends CakeTestCase {
ClassRegistry::addObject('view', $view); ClassRegistry::addObject('view', $view);
ClassRegistry::addObject('PostAjaxTest', new PostAjaxTest()); ClassRegistry::addObject('PostAjaxTest', new PostAjaxTest());
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Ajax);
ClassRegistry::flush();
}
/** /**
* testEvalScripts method * testEvalScripts method
* *
@ -624,7 +641,6 @@ class AjaxTest extends CakeTestCase {
$this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new Form.Element.EventObserver\(\'field\', function\(element, value\) {.+}\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new Form.Element.EventObserver\(\'field\', function\(element, value\) {.+}\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result);
$this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Updater(\'divId\',\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(\'otherField\'), requestHeaders:[\'X-Update\', \'divId\']})')) . '/', $result); $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Updater(\'divId\',\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(\'otherField\'), requestHeaders:[\'X-Update\', \'divId\']})')) . '/', $result);
} }
/** /**
* testObserveForm method * testObserveForm method
* *
@ -887,15 +903,5 @@ class AjaxTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Ajax);
ClassRegistry::flush();
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * CacheHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -29,26 +29,34 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
} }
App::import('Core', array('Controller', 'Model', 'View')); App::import('Core', array('Controller', 'Model', 'View'));
App::import('Helper', 'Cache'); App::import('Helper', 'Cache');
/** /**
* Test Cache Helper * TestCacheHelper class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class TestCacheHelper extends CacheHelper { class TestCacheHelper extends CacheHelper {
} }
/** /**
* Test Cache Helper * CacheTestController class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class CacheTestController extends Controller { class CacheTestController extends Controller {
/**
* helpers property
*
* @var array
* @access public
*/
var $helpers = array('Html', 'Cache'); var $helpers = array('Html', 'Cache');
/**
* cache_parsing method
*
* @access public
* @return void
*/
function cache_parsing() { function cache_parsing() {
$this->viewPath = 'posts'; $this->viewPath = 'posts';
$this->layout = 'cache_layout'; $this->layout = 'cache_layout';
@ -56,11 +64,10 @@ class CacheTestController extends Controller {
$this->set('superman', 'clark kent'); $this->set('superman', 'clark kent');
} }
} }
/** /**
* Cache Helper Test Case * CacheHelperTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class CacheHelperTest extends CakeTestCase { class CacheHelperTest extends CakeTestCase {
@ -76,7 +83,6 @@ class CacheHelperTest extends CakeTestCase {
Configure::write('Cache.check', true); Configure::write('Cache.check', true);
Configure::write('Cache.disable', false); Configure::write('Cache.disable', false);
} }
/** /**
* Start Case - switch view paths * Start Case - switch view paths
* *
@ -87,10 +93,29 @@ class CacheHelperTest extends CakeTestCase {
$this->_viewPaths = Configure::read('viewPaths'); $this->_viewPaths = Configure::read('viewPaths');
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS));
} }
/**
* End Case - restore view Paths
*
* @access public
* @return void
*/
function endCase() {
Configure::write('viewPaths', $this->_viewPaths);
}
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Cache);
}
/** /**
* test cache parsing with no cake:nocache tags in view file. * test cache parsing with no cake:nocache tags in view file.
* *
* @access public
* @return void
*/ */
function testLayoutCacheParsingNoTagsInView() { function testLayoutCacheParsingNoTagsInView() {
$this->Controller->cache_parsing(); $this->Controller->cache_parsing();
@ -113,10 +138,11 @@ class CacheHelperTest extends CakeTestCase {
@unlink($filename); @unlink($filename);
} }
/** /**
* Test cache parsing with cake:nocache tags in view file. * Test cache parsing with cake:nocache tags in view file.
* *
* @access public
* @return void
*/ */
function testLayoutCacheParsingWithTagsInView() { function testLayoutCacheParsingWithTagsInView() {
$this->Controller->cache_parsing(); $this->Controller->cache_parsing();
@ -238,23 +264,5 @@ class CacheHelperTest extends CakeTestCase {
@unlink($filename); @unlink($filename);
} }
*/ */
/**
* End Case - restore view Paths
*
* @access public
* @return void
*/
function endCase() {
Configure::write('viewPaths', $this->_viewPaths);
}
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Cache);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * FormHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2006-2008, Cake Software Foundation, Inc. * @copyright Copyright 2006-2008, Cake Software Foundation, Inc.
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -127,6 +127,12 @@ class Contact extends CakeTestModel {
*/ */
var $hasAndBelongsToMany = array('ContactTag' => array('with' => 'ContactTagsContact')); var $hasAndBelongsToMany = array('ContactTag' => array('with' => 'ContactTagsContact'));
} }
/**
* ContactTagsContact class
*
* @package cake
* @subpackage cake.tests.cases.libs.view.helpers
*/
class ContactTagsContact extends CakeTestModel { class ContactTagsContact extends CakeTestModel {
/** /**
* useTable property * useTable property
@ -164,8 +170,13 @@ class ContactTagsContact extends CakeTestModel {
$this->_schema = $schema; $this->_schema = $schema;
} }
} }
/**
Class ContactNonStandardPk extends Contact { * ContactNonStandardPk class
*
* @package cake
* @subpackage cake.tests.cases.libs.view.helpers
*/
class ContactNonStandardPk extends Contact {
/** /**
* primaryKey property * primaryKey property
* *
@ -567,9 +578,9 @@ class TestMail extends CakeTestModel {
var $name = 'TestMail'; var $name = 'TestMail';
} }
/** /**
* Short description for class. * FormHelperTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class FormHelperTest extends CakeTestCase { class FormHelperTest extends CakeTestCase {
@ -617,6 +628,25 @@ class FormHelperTest extends CakeTestCase {
Configure::write('Security.salt', 'foo!'); Configure::write('Security.salt', 'foo!');
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
ClassRegistry::removeObject('view');
ClassRegistry::removeObject('Contact');
ClassRegistry::removeObject('ContactNonStandardPk');
ClassRegistry::removeObject('ContactTag');
ClassRegistry::removeObject('OpenidUrl');
ClassRegistry::removeObject('UserForm');
ClassRegistry::removeObject('ValidateItem');
ClassRegistry::removeObject('ValidateUser');
ClassRegistry::removeObject('ValidateProfile');
unset($this->Form->Html, $this->Form, $this->Controller, $this->View);
Configure::write('Security.salt', $this->oldSalt);
}
/** /**
* testFormCreateWithSecurity method * testFormCreateWithSecurity method
* *
@ -723,7 +753,6 @@ class FormHelperTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/** /**
* Tests correct generation of text fields for double and float fields * Tests correct generation of text fields for double and float fields
* *
@ -786,14 +815,13 @@ class FormHelperTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/** /**
* testFormSecurityMultipleSubmitButtons * testFormSecurityMultipleSubmitButtons
* *
* test form submit generation and ensure that _Token is only created on end() * test form submit generation and ensure that _Token is only created on end()
* *
* @return void * @return void
**/ */
function testFormSecurityMultipleSubmitButtons() { function testFormSecurityMultipleSubmitButtons() {
$key = 'testKey'; $key = 'testKey';
$this->Form->params['_Token']['key'] = $key; $this->Form->params['_Token']['key'] = $key;
@ -828,7 +856,6 @@ class FormHelperTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/** /**
* testFormSecurityMultipleInputFields method * testFormSecurityMultipleInputFields method
* *
@ -962,7 +989,6 @@ class FormHelperTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/** /**
* testFormSecuredInput method * testFormSecuredInput method
* *
@ -2631,7 +2657,6 @@ class FormHelperTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/** /**
* testNestedSelect method * testNestedSelect method
* *
@ -2694,7 +2719,6 @@ class FormHelperTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/** /**
* testSelectMultiple method * testSelectMultiple method
* *
@ -5071,7 +5095,12 @@ class FormHelperTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/**
* testBrokenness method
*
* @access public
* @return void
*/
function testBrokenness() { function testBrokenness() {
/* /*
* #4 This test has two parents and four children. By default (as of r7117) both * #4 This test has two parents and four children. By default (as of r7117) both
@ -5154,25 +5183,5 @@ class FormHelperTest extends CakeTestCase {
); );
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
ClassRegistry::removeObject('view');
ClassRegistry::removeObject('Contact');
ClassRegistry::removeObject('ContactNonStandardPk');
ClassRegistry::removeObject('ContactTag');
ClassRegistry::removeObject('OpenidUrl');
ClassRegistry::removeObject('UserForm');
ClassRegistry::removeObject('ValidateItem');
ClassRegistry::removeObject('ValidateUser');
ClassRegistry::removeObject('ValidateProfile');
unset($this->Form->Html, $this->Form, $this->Controller, $this->View);
Configure::write('Security.salt', $this->oldSalt);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * HtmlHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2006-2008, Cake Software Foundation, Inc. * @copyright Copyright 2006-2008, Cake Software Foundation, Inc.
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -73,6 +73,15 @@ class HtmlHelperTest extends CakeTestCase {
$view =& new View(new TheHtmlTestController()); $view =& new View(new TheHtmlTestController());
ClassRegistry::addObject('view', $view); ClassRegistry::addObject('view', $view);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Html);
}
/** /**
* testDocType method * testDocType method
* *
@ -878,7 +887,6 @@ class HtmlHelperTest extends CakeTestCase {
$result = $this->Html->div('class-name', '<text>', array(), true); $result = $this->Html->div('class-name', '<text>', array(), true);
$this->assertTags($result, array('div' => array('class' => 'class-name'), '&lt;text&gt;', '/div')); $this->assertTags($result, array('div' => array('class' => 'class-name'), '&lt;text&gt;', '/div'));
} }
/** /**
* testPara method * testPara method
* *
@ -895,14 +903,5 @@ class HtmlHelperTest extends CakeTestCase {
$result = $this->Html->para('class-name', '<text>', array(), true); $result = $this->Html->para('class-name', '<text>', array(), true);
$this->assertTags($result, array('p' => array('class' => 'class-name'), '&lt;text&gt;', '/p')); $this->assertTags($result, array('p' => array('class' => 'class-name'), '&lt;text&gt;', '/p'));
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Html);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * JavascriptHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2006-2008, Cake Software Foundation, Inc. * @copyright Copyright 2006-2008, Cake Software Foundation, Inc.
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -88,7 +88,7 @@ class TestJavascriptObject {
var $property2 = 2; var $property2 = 2;
} }
/** /**
* Short description for class. * JavascriptTest class
* *
* @package test_suite * @package test_suite
* @subpackage test_suite.cases.libs * @subpackage test_suite.cases.libs
@ -700,5 +700,4 @@ class JavascriptTest extends CakeTestCase {
$this->Javascript->enabled = $old; $this->Javascript->enabled = $old;
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * JsHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -27,16 +27,20 @@
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
define('CAKEPHP_UNIT_TEST_EXECUTION', 1); define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
} }
uses(
uses('view'.DS.'helpers'.DS.'app_helper', 'controller'.DS.'controller', 'model'.DS.'model', 'view'.DS.'helper', 'view'.DS.'helpers'.DS.'js'); 'view' . DS . 'helpers' . DS . 'app_helper',
'controller' . DS . 'controller',
'model' . DS . 'model',
'view' . DS . 'helper',
'view' . DS . 'helpers' . DS . 'js'
);
/** /**
* Short description for class. * JsHelperTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class JsTest extends UnitTestCase { class JsHelperTest extends UnitTestCase {
/** /**
* skip method * skip method
* *
@ -65,5 +69,4 @@ class JsTest extends UnitTestCase {
unset($this->Js); unset($this->Js);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * NumberHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -26,12 +26,12 @@
*/ */
App::import('Helper', 'Number'); App::import('Helper', 'Number');
/** /**
* Short description for class. * NumberHelperTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class NumberTest extends CakeTestCase { class NumberHelperTest extends CakeTestCase {
/** /**
* helper property * helper property
* *
@ -39,7 +39,6 @@ class NumberTest extends CakeTestCase {
* @access public * @access public
*/ */
var $helper = null; var $helper = null;
/** /**
* setUp method * setUp method
* *
@ -49,6 +48,15 @@ class NumberTest extends CakeTestCase {
function setUp() { function setUp() {
$this->Number =& new NumberHelper(); $this->Number =& new NumberHelper();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Number);
}
/** /**
* testFormatAndCurrency method * testFormatAndCurrency method
* *
@ -136,7 +144,6 @@ class NumberTest extends CakeTestCase {
$expected = '&#163;100,100,100.00'; $expected = '&#163;100,100,100.00';
$this->assertEqual($expected, $result); $this->assertEqual($expected, $result);
} }
/** /**
* testCurrencyNegative method * testCurrencyNegative method
* *
@ -363,16 +370,6 @@ class NumberTest extends CakeTestCase {
}
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Number);
} }
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * PaginatorHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -26,12 +26,12 @@
*/ */
App::import('Helper', array('Html', 'Paginator', 'Form', 'Ajax', 'Javascript')); App::import('Helper', array('Html', 'Paginator', 'Form', 'Ajax', 'Javascript'));
/** /**
* Short description for class. * PaginatorHelperTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class PaginatorTest extends CakeTestCase { class PaginatorHelperTest extends CakeTestCase {
/** /**
* setUp method * setUp method
* *
@ -69,6 +69,15 @@ class PaginatorTest extends CakeTestCase {
Configure::write('Routing.admin', ''); Configure::write('Routing.admin', '');
Router::reload(); Router::reload();
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Paginator);
}
/** /**
* testHasPrevious method * testHasPrevious method
* *
@ -842,14 +851,5 @@ class PaginatorTest extends CakeTestCase {
$result = $this->Paginator->link('Page 3', array('page' => 3)); $result = $this->Paginator->link('Page 3', array('page' => 3));
$this->assertPattern('/["\']\/issues\/index\/page:3["\']/', $result); $this->assertPattern('/["\']\/issues\/index\/page:3["\']/', $result);
} }
/**
* tearDown method
*
* @access public
* @return void
*/
function tearDown() {
unset($this->Paginator);
}
} }
?> ?>

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * RssHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -26,12 +26,12 @@
*/ */
App::import('Helper', array('Rss', 'Time')); App::import('Helper', array('Rss', 'Time'));
/** /**
* Short description for class. * RssHelperTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class RssTest extends CakeTestCase { class RssHelperTest extends CakeTestCase {
/** /**
* setUp method * setUp method
* *
@ -301,7 +301,6 @@ class RssTest extends CakeTestCase {
$expected = ''; $expected = '';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
/** /**
* testItem method * testItem method
* *

View file

@ -1,7 +1,7 @@
<?php <?php
/* SVN FILE: $Id$ */ /* SVN FILE: $Id$ */
/** /**
* Short description for file. * SessionHelperTest file
* *
* Long description for file * Long description for file
* *
@ -16,7 +16,7 @@
* @filesource * @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
* @since CakePHP(tm) v 1.2.0.4206 * @since CakePHP(tm) v 1.2.0.4206
* @version $Revision$ * @version $Revision$
@ -30,9 +30,9 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
App::import('Core', array('Helper', 'AppHelper', 'Controller', 'View')); App::import('Core', array('Helper', 'AppHelper', 'Controller', 'View'));
App::import('Helper', array('Session')); App::import('Helper', array('Session'));
/** /**
* Short description for class. * SessionHelperTest class
* *
* @package cake.tests * @package cake
* @subpackage cake.tests.cases.libs.view.helpers * @subpackage cake.tests.cases.libs.view.helpers
*/ */
class SessionHelperTest extends CakeTestCase { class SessionHelperTest extends CakeTestCase {
@ -224,5 +224,4 @@ class SessionHelperTest extends CakeTestCase {
//$this->assertFalse($this->Session->valid()); //$this->assertFalse($this->Session->valid());
} }
} }
?> ?>

Some files were not shown because too many files have changed in this diff Show more