Revert "Giant changes to make it work on php7"

This reverts commit 144a7a0fb1.
This commit is contained in:
Karl Cordes 2025-08-08 13:39:37 +10:00
parent 144a7a0fb1
commit 97dbeb6a1c
145 changed files with 845 additions and 2144 deletions

View file

@ -65,12 +65,8 @@ RUN chown -R www-data:www-data /var/www/cmc-sales \
# Set working directory
WORKDIR /var/www/cmc-sales
# Copy CakePHP core and application
COPY cake/ /var/www/cmc-sales/cake/
# Copy application (will be overridden by volume mount)
COPY app/ /var/www/cmc-sales/app/
COPY vendors/ /var/www/cmc-sales/vendors/
COPY index.php /var/www/cmc-sales/
COPY *.sh /var/www/cmc-sales/
# Expose port 80
EXPOSE 80

BIN
app/.DS_Store vendored

Binary file not shown.

View file

@ -2,6 +2,8 @@
//CakePHP is pretty awful. I was so foolish.
class DATABASE_CONFIG {
var $default = array(
@ -13,19 +15,4 @@ class DATABASE_CONFIG {
'database' => 'cmc',
'prefix' => '',
);
function __construct() {
// Use environment-specific database settings if APP_ENV is set
if (isset($_ENV['APP_ENV']) && $_ENV['APP_ENV'] == 'staging') {
$this->default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'db-staging',
'login' => 'cmc_staging',
'password' => 'staging_password',
'database' => 'cmc_staging',
'prefix' => '',
);
}
}
}

View file

@ -5,10 +5,10 @@
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'db-staging',
'login' => 'cmc_staging',
'password' => 'staging_password',
'database' => 'cmc_staging',
'host' => '172.17.0.1',
'login' => 'staging',
'password' => 'stagingmoopwoopVerySecure',
'database' => 'staging',
'prefix' => '',
);
}

View file

@ -93,12 +93,4 @@ if (!function_exists('mysql_connect')) {
function mysql_real_escape_string($unescaped_string, $link_identifier = null) {
return mysqli_real_escape_string($link_identifier, $unescaped_string);
}
}
// Create alias for Object class to fix PHP 7 reserved word issue
// This should be included AFTER CakePHP's Object class is defined
function create_object_alias() {
if (class_exists('CakeObject') && !class_exists('Object', false)) {
class_alias('CakeObject', 'Object');
}
}

BIN
app/webroot/.DS_Store vendored

Binary file not shown.

View file

@ -1,111 +0,0 @@
<?php
/**
* CakePHP Setup Test
*/
echo "<h1>CakePHP Setup Test</h1>";
// Test 1: PHP Version
echo "<h2>PHP Information</h2>";
echo "<p><strong>PHP Version:</strong> " . PHP_VERSION . "</p>";
echo "<p><strong>Server API:</strong> " . php_sapi_name() . "</p>";
// Test 2: Required Extensions
echo "<h2>PHP Extensions</h2>";
$extensions = ['mysql', 'mysqli', 'gd', 'curl', 'mbstring'];
foreach ($extensions as $ext) {
$loaded = extension_loaded($ext);
echo "<p><strong>$ext:</strong> " . ($loaded ? '✓ Loaded' : '✗ Not Loaded') . "</p>";
}
// Test 3: CakePHP Constants
echo "<h2>CakePHP Constants</h2>";
$constants = ['ROOT', 'APP_DIR', 'CAKE_CORE_INCLUDE_PATH', 'WWW_ROOT'];
foreach ($constants as $const) {
if (defined($const)) {
echo "<p><strong>$const:</strong> " . constant($const) . "</p>";
} else {
echo "<p><strong>$const:</strong> ✗ Not defined</p>";
}
}
// Test 4: File System
echo "<h2>File System</h2>";
$paths = [
'/var/www/cmc-sales',
'/var/www/cmc-sales/cake',
'/var/www/cmc-sales/app',
'/var/www/cmc-sales/app/webroot'
];
foreach ($paths as $path) {
$exists = file_exists($path);
$readable = is_readable($path);
echo "<p><strong>$path:</strong> " .
($exists ? '✓ Exists' : '✗ Missing') .
($readable ? ', ✓ Readable' : ', ✗ Not readable') . "</p>";
}
// Test 5: CakePHP Core
echo "<h2>CakePHP Core Test</h2>";
$cake_bootstrap = '/var/www/cmc-sales/cake/bootstrap.php';
if (file_exists($cake_bootstrap)) {
echo "<p><strong>CakePHP Bootstrap:</strong> ✓ Found at $cake_bootstrap</p>";
// Try to include it
try {
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', '/var/www/cmc-sales');
}
if (!defined('ROOT')) {
define('ROOT', '/var/www/cmc-sales');
}
if (!defined('APP_DIR')) {
define('APP_DIR', 'app');
}
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
echo "<p><strong>Include Test:</strong> Ready to include CakePHP</p>";
// Note: We don't actually include it here to avoid conflicts
} catch (Exception $e) {
echo "<p><strong>Include Test:</strong> ✗ Error - " . $e->getMessage() . "</p>";
}
} else {
echo "<p><strong>CakePHP Bootstrap:</strong> ✗ Not found</p>";
}
// Test 6: Database
echo "<h2>Database Test</h2>";
$db_host = $_ENV['DB_HOST'] ?? 'db-staging';
$db_user = $_ENV['DB_USER'] ?? 'cmc_staging';
$db_pass = $_ENV['DB_PASSWORD'] ?? '';
$db_name = $_ENV['DB_NAME'] ?? 'cmc_staging';
echo "<p><strong>DB Host:</strong> $db_host</p>";
echo "<p><strong>DB User:</strong> $db_user</p>";
echo "<p><strong>DB Name:</strong> $db_name</p>";
if (function_exists('mysqli_connect')) {
$conn = @mysqli_connect($db_host, $db_user, $db_pass, $db_name);
if ($conn) {
echo "<p><strong>Database Connection:</strong> ✓ Connected</p>";
mysqli_close($conn);
} else {
echo "<p><strong>Database Connection:</strong> ✗ Failed - " . mysqli_connect_error() . "</p>";
}
} else {
echo "<p><strong>Database Connection:</strong> ✗ MySQLi not available</p>";
}
echo "<h2>Server Information</h2>";
echo "<pre>";
echo "Document Root: " . $_SERVER['DOCUMENT_ROOT'] . "\n";
echo "Script Name: " . $_SERVER['SCRIPT_NAME'] . "\n";
echo "Working Directory: " . getcwd() . "\n";
echo "</pre>";
echo "<p><small>Generated at: " . date('Y-m-d H:i:s') . "</small></p>";
?>

View file

@ -30,7 +30,7 @@
* @package cake
* @subpackage cake.cake.console
*/
class ErrorHandler extends CakeObject {
class ErrorHandler extends Object {
/**
* Standard output stream.
*

View file

@ -64,7 +64,7 @@ class ConsoleShell extends Shell {
foreach ($this->models as $model) {
$class = Inflector::camelize(r('.php', '', $model));
$this->models[$model] = $class;
$this->{$class} = new $class();
$this->{$class} =& new $class();
}
$this->out('Model classes:');
$this->out('--------------');

View file

@ -79,7 +79,7 @@ class SchemaShell extends Shell {
$connection = $this->params['connection'];
}
$this->Schema = new CakeSchema(compact('name', 'path', 'file', 'connection'));
$this->Schema =& new CakeSchema(compact('name', 'path', 'file', 'connection'));
}
/**
* Override main
@ -138,7 +138,7 @@ class SchemaShell extends Shell {
$content['file'] = $this->params['file'];
if ($snapshot === true) {
$Folder = new Folder($this->Schema->path);
$Folder =& new Folder($this->Schema->path);
$result = $Folder->read();
$numToUse = false;

View file

@ -30,7 +30,7 @@
* @package cake
* @subpackage cake.cake.console.libs
*/
class Shell extends CakeObject {
class Shell extends Object {
/**
* An instance of the ShellDispatcher object that loaded this script
*
@ -200,7 +200,7 @@ class Shell extends CakeObject {
*/
function _loadDbConfig() {
if (config('database') && class_exists('DATABASE_CONFIG')) {
$this->DbConfig = new DATABASE_CONFIG();
$this->DbConfig =& new DATABASE_CONFIG();
return true;
}
$this->err('Database config could not be loaded');
@ -222,7 +222,7 @@ class Shell extends CakeObject {
}
if ($this->uses === true && App::import('Model', 'AppModel')) {
$this->AppModel = new AppModel(false, false, false);
$this->AppModel =& new AppModel(false, false, false);
return true;
}
@ -290,7 +290,7 @@ class Shell extends CakeObject {
} else {
$this->taskNames[] = $taskName;
if (!PHP5) {
$this->{$taskName} = new $taskClass($this->Dispatch);
$this->{$taskName} =& new $taskClass($this->Dispatch);
} else {
$this->{$taskName} = new $taskClass($this->Dispatch);
}

View file

@ -252,7 +252,7 @@ class ControllerTask extends Shell {
exit;
}
$actions = null;
$modelObj = new $currentModelName();
$modelObj =& new $currentModelName();
$controllerPath = $this->_controllerPath($controllerName);
$pluralName = $this->_pluralName($currentModelName);
$singularName = Inflector::variable($currentModelName);

View file

@ -192,7 +192,7 @@ class ProjectTask extends Shell {
* @access public
*/
function securitySalt($path) {
$File = new File($path . 'config' . DS . 'core.php');
$File =& new File($path . 'config' . DS . 'core.php');
$contents = $File->read();
if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.salt\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
if (!class_exists('Security')) {
@ -216,7 +216,7 @@ class ProjectTask extends Shell {
*/
function corePath($path) {
if (dirname($path) !== CAKE_CORE_INCLUDE_PATH) {
$File = new File($path . 'webroot' . DS . 'index.php');
$File =& new File($path . 'webroot' . DS . 'index.php');
$contents = $File->read();
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
@ -227,7 +227,7 @@ class ProjectTask extends Shell {
return false;
}
$File = new File($path . 'webroot' . DS . 'test.php');
$File =& new File($path . 'webroot' . DS . 'test.php');
$contents = $File->read();
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
$result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '" . CAKE_CORE_INCLUDE_PATH . "');", $contents);
@ -248,7 +248,7 @@ class ProjectTask extends Shell {
* @access public
*/
function cakeAdmin($name) {
$File = new File(CONFIGS . 'core.php');
$File =& new File(CONFIGS . 'core.php');
$contents = $File->read();
if (preg_match('%([/\\t\\x20]*Configure::write\(\'Routing.admin\',[\\t\\x20\'a-z]*\\);)%', $contents, $match)) {
$result = str_replace($match[0], "\t" . 'Configure::write(\'Routing.admin\', \''.$name.'\');', $contents);

View file

@ -290,7 +290,7 @@ class ViewTask extends Shell {
$content = $this->getContent();
}
$filename = $this->path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp';
$Folder = new Folder($this->path . $this->controllerPath, true);
$Folder =& new Folder($this->path . $this->controllerPath, true);
$errors = $Folder->errors();
if (empty($errors)) {
$path = $Folder->slashTerm($Folder->pwd());

View file

@ -37,7 +37,7 @@ App::import('Core', array('Router', 'Controller'));
* @package cake
* @subpackage cake.cake
*/
class Dispatcher extends CakeObject {
class Dispatcher extends Object {
/**
* Base URL
*
@ -456,7 +456,7 @@ class Dispatcher extends CakeObject {
$params = $this->_restructureParams($params, true);
}
$this->params = $params;
$controller = new $ctrlClass();
$controller =& new $ctrlClass();
}
return $controller;
}
@ -679,7 +679,7 @@ class Dispatcher extends CakeObject {
App::import('Core', 'View');
}
$controller = null;
$view = new View($controller, false);
$view =& new View($controller, false);
return $view->renderCache($filename, getMicrotime());
}
}

View file

@ -29,7 +29,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class Cache extends CakeObject {
class Cache extends Object {
/**
* Cache engine to use
*
@ -68,7 +68,7 @@ class Cache extends CakeObject {
function &getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] = new Cache();
$instance[0] =& new Cache();
}
return $instance[0];
}
@ -148,7 +148,7 @@ class Cache extends CakeObject {
if ($_this->__loadEngine($name) === false) {
return false;
}
$_this->_Engine[$name] = new $cacheClass();
$_this->_Engine[$name] =& new $cacheClass();
}
if ($_this->_Engine[$name]->init($settings)) {
@ -406,7 +406,7 @@ class Cache extends CakeObject {
* @package cake
* @subpackage cake.cake.libs
*/
class CacheEngine extends CakeObject {
class CacheEngine extends Object {
/**
* settings of current engine instance
*

View file

@ -86,7 +86,7 @@ class FileEngine extends CacheEngine {
if (!class_exists('File')) {
require LIBS . 'file.php';
}
$this->__File = new File($this->settings['path'] . DS . 'cake');
$this->__File =& new File($this->settings['path'] . DS . 'cake');
}
if (DIRECTORY_SEPARATOR === '\\') {

View file

@ -73,7 +73,7 @@ class MemcacheEngine extends CacheEngine {
}
if (!isset($this->__Memcache)) {
$return = false;
$this->__Memcache = new Memcache();
$this->__Memcache =& new Memcache();
foreach ($this->settings['servers'] as $server) {
$parts = explode(':', $server);
$host = $parts[0];

View file

@ -65,7 +65,7 @@ class ClassRegistry {
function &getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] = new ClassRegistry();
$instance[0] =& new ClassRegistry();
}
return $instance[0];
}
@ -137,7 +137,7 @@ class ClassRegistry {
}
if (class_exists($class) || App::import($type, $pluginPath . $class)) {
${$class} = new $class($settings);
${$class} =& new $class($settings);
} elseif ($type === 'Model') {
if ($plugin && class_exists($plugin . 'AppModel')) {
$appModel = $plugin . 'AppModel';
@ -145,7 +145,7 @@ class ClassRegistry {
$appModel = 'AppModel';
}
$settings['name'] = $class;
${$class} = new $appModel($settings);
${$class} =& new $appModel($settings);
}
if (!isset(${$class})) {

View file

@ -31,7 +31,7 @@
* @subpackage cake.cake.libs
* @link http://book.cakephp.org/view/42/The-Configuration-Class
*/
class Configure extends CakeObject {
class Configure extends Object {
/**
* List of additional path(s) where model files reside.
*
@ -133,7 +133,7 @@ class Configure extends CakeObject {
static function &getInstance($boot = true) {
static $instance = array();
if (!$instance) {
$instance[0] = new Configure();
$instance[0] =& new Configure();
$instance[0]->__loadBootstrap($boot);
}
return $instance[0];
@ -223,7 +223,7 @@ class Configure extends CakeObject {
require LIBS . 'folder.php';
}
$items = array();
$Folder = new Folder($path);
$Folder =& new Folder($path);
$contents = $Folder->read(false, true);
if (is_array($contents)) {
@ -717,7 +717,7 @@ class Configure extends CakeObject {
* @package cake
* @subpackage cake.cake.libs
*/
class App extends CakeObject {
class App extends Object {
/**
* Paths to search for files.
*
@ -903,7 +903,7 @@ class App extends CakeObject {
function &getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] = new App();
$instance[0] =& new App();
$instance[0]->__map = Cache::read('file_map', '_cake_core_');
}
return $instance[0];
@ -943,7 +943,7 @@ class App extends CakeObject {
if (!class_exists('Folder')) {
require LIBS . 'folder.php';
}
$Folder = new Folder();
$Folder =& new Folder();
$directories = $Folder->tree($path, false, 'dir');
$this->__paths[$path] = $directories;
}

View file

@ -28,7 +28,7 @@
* @subpackage cake.cake.libs.controller
* @link http://book.cakephp.org/view/62/Components
*/
class Component extends CakeObject {
class Component extends Object {
/**
* Contains various controller variable information (plugin, name, base).
*
@ -234,9 +234,9 @@ class Component extends CakeObject {
}
} else {
if ($componentCn === 'SessionComponent') {
$object->{$component} = new $componentCn($base);
$object->{$component} =& new $componentCn($base);
} else {
$object->{$component} = new $componentCn();
$object->{$component} =& new $componentCn();
}
$object->{$component}->enabled = true;
$this->_loaded[$component] =& $object->{$component};

View file

@ -32,7 +32,7 @@
* @package cake
* @subpackage cake.cake.libs.controller.components
*/
class AclComponent extends CakeObject {
class AclComponent extends Object {
/**
* Instance of an ACL class
*
@ -56,7 +56,7 @@ class AclComponent extends CakeObject {
trigger_error(sprintf(__('Could not find %s.', true), $name), E_USER_WARNING);
}
}
$this->_Instance = new $name();
$this->_Instance =& new $name();
$this->_Instance->initialize($this);
}
/**
@ -157,7 +157,7 @@ class AclComponent extends CakeObject {
* @subpackage cake.cake.libs.controller.components
* @abstract
*/
class AclBase extends CakeObject {
class AclBase extends Object {
/**
* This class should never be instantiated, just subclassed.
*

View file

@ -36,7 +36,7 @@ App::import(array('Router', 'Security'));
* @package cake
* @subpackage cake.cake.libs.controller.components
*/
class AuthComponent extends CakeObject {
class AuthComponent extends Object {
/**
* Maintains current user login state.
*

View file

@ -37,7 +37,7 @@ App::import('Core', 'Security');
* @subpackage cake.cake.libs.controller.components
*
*/
class CookieComponent extends CakeObject {
class CookieComponent extends Object {
/**
* The name of the cookie.
*

View file

@ -35,7 +35,7 @@
*
*/
App::import('Core', 'Multibyte');
class EmailComponent extends CakeObject{
class EmailComponent extends Object{
/**
* Recipient of the email
*
@ -671,7 +671,7 @@ class EmailComponent extends CakeObject{
function __smtp() {
App::import('Core', array('Socket'));
$this->__smtpConnection = new CakeSocket(array_merge(array('protocol'=>'smtp'), $this->smtpOptions));
$this->__smtpConnection =& new CakeSocket(array_merge(array('protocol'=>'smtp'), $this->smtpOptions));
if (!$this->__smtpConnection->connect()) {
$this->smtpError = $this->__smtpConnection->lastError();

View file

@ -36,7 +36,7 @@ if (!defined('REQUEST_MOBILE_UA')) {
* @subpackage cake.cake.libs.controller.components
*
*/
class RequestHandlerComponent extends CakeObject {
class RequestHandlerComponent extends Object {
/**
* The layout that will be switched to for Ajax requests
*

View file

@ -32,7 +32,7 @@
* @package cake
* @subpackage cake.cake.libs.controller.components
*/
class SecurityComponent extends CakeObject {
class SecurityComponent extends Object {
/**
* The controller method that will be called if this request is black-hole'd
*

View file

@ -38,7 +38,7 @@ App::import('Core', array('Component', 'View'));
* @link http://book.cakephp.org/view/49/Controllers
*
*/
class Controller extends CakeObject {
class Controller extends Object {
/**
* The name of this controller. Controller names are plural, named after the model they manipulate.
*
@ -335,7 +335,7 @@ class Controller extends CakeObject {
}
$this->modelClass = Inflector::classify($this->name);
$this->modelKey = Inflector::underscore($this->modelClass);
$this->Component = new Component();
$this->Component =& new Component();
$childMethods = get_class_methods($this);
$parentMethods = get_class_methods('Controller');
@ -776,7 +776,7 @@ class Controller extends CakeObject {
$this->set('cakeDebug', $this);
}
$View = new $viewClass($this);
$View =& new $viewClass($this);
if (!empty($this->modelNames)) {
$models = array();

View file

@ -35,7 +35,7 @@
* @package cake
* @subpackage cake.cake.libs.controller
*/
class Scaffold extends CakeObject {
class Scaffold extends Object {
/**
* Controller object
*

View file

@ -43,7 +43,7 @@
* @subpackage cake.cake.libs
* @link http://book.cakephp.org/view/460/Using-the-Debugger-Class
*/
class Debugger extends CakeObject {
class Debugger extends Object {
/**
* A list of errors generated by the application.
*
@ -105,7 +105,7 @@ class Debugger extends CakeObject {
}
if (!$instance) {
$instance[0] = new Debugger();
$instance[0] =& new Debugger();
if (Configure::read() > 0) {
Configure::version(); // Make sure the core config is loaded
$instance[0]->helpPath = Configure::read('Cake.Debugger.HelpPath');

View file

@ -66,7 +66,7 @@ class CakeErrorController extends AppController {
* @package cake
* @subpackage cake.cake.libs
*/
class ErrorHandler extends CakeObject {
class ErrorHandler extends Object {
/**
* Controller instance.
*
@ -86,9 +86,9 @@ class ErrorHandler extends CakeObject {
if ($__previousError != array($method, $messages)) {
$__previousError = array($method, $messages);
$this->controller = new CakeErrorController();
$this->controller =& new CakeErrorController();
} else {
$this->controller = new Controller();
$this->controller =& new Controller();
$this->controller->viewPath = 'errors';
}

View file

@ -38,7 +38,7 @@ if (!class_exists('Folder')) {
* @package cake
* @subpackage cake.cake.libs
*/
class File extends CakeObject {
class File extends Object {
/**
* Folder object of the File
*
@ -93,7 +93,7 @@ class File extends CakeObject {
*/
function __construct($path, $create = false, $mode = 0755) {
parent::__construct();
$this->Folder = new Folder(dirname($path), $create, $mode);
$this->Folder =& new Folder(dirname($path), $create, $mode);
if (!is_dir($path)) {
$this->name = basename($path);
}

View file

@ -39,7 +39,7 @@ if (!class_exists('Object')) {
* @package cake
* @subpackage cake.cake.libs
*/
class Flay extends CakeObject{
class Flay extends Object{
/**
* Text to be parsed.
*

View file

@ -37,7 +37,7 @@ if (!class_exists('Object')) {
* @package cake
* @subpackage cake.cake.libs
*/
class Folder extends CakeObject {
class Folder extends Object {
/**
* Path to Folder.
*

View file

@ -36,7 +36,7 @@ App::import('Core', 'l10n');
* @package cake
* @subpackage cake.cake.libs
*/
class I18n extends CakeObject {
class I18n extends Object {
/**
* Instance of the I10n class for localization
*
@ -106,8 +106,8 @@ class I18n extends CakeObject {
function &getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] = new I18n();
$instance[0]->l10n = new L10n();
$instance[0] =& new I18n();
$instance[0]->l10n =& new L10n();
}
return $instance[0];
}

View file

@ -45,7 +45,7 @@ if (!class_exists('Set')) {
* @subpackage cake.cake.libs
* @link http://book.cakephp.org/view/491/Inflector
*/
class Inflector extends CakeObject {
class Inflector extends Object {
/**
* Pluralized words.
*
@ -128,7 +128,7 @@ class Inflector extends CakeObject {
static $instance = array();
if (!$instance) {
$instance[0] = new Inflector();
$instance[0] =& new Inflector();
if (file_exists(CONFIGS.'inflections.php')) {
include(CONFIGS.'inflections.php');
$instance[0]->__pluralRules = $pluralRules;

View file

@ -32,7 +32,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class L10n extends CakeObject {
class L10n extends Object {
/**
* The language for current locale
*

View file

@ -31,7 +31,7 @@ if (!class_exists('File')) {
* @package cake.tests
* @subpackage cake.tests.cases.libs
*/
class MagicDb extends CakeObject {
class MagicDb extends Object {
/**
* Holds the parsed MagicDb for this class instance
*
@ -53,7 +53,7 @@ class MagicDb extends CakeObject {
if (is_array($magicDb) || strpos($magicDb, '# FILE_ID DB') === 0) {
$data = $magicDb;
} else {
$File = new File($magicDb);
$File =& new File($magicDb);
if (!$File->exists()) {
return false;
}
@ -158,7 +158,7 @@ class MagicDb extends CakeObject {
}
$matches = array();
$MagicFileResource = new MagicFileResource($file);
$MagicFileResource =& new MagicFileResource($file);
foreach ($this->db['database'] as $format) {
$magic = $format[0];
$match = $MagicFileResource->test($magic);
@ -178,7 +178,7 @@ class MagicDb extends CakeObject {
* @package cake.tests
* @subpackage cake.tests.cases.libs
*/
class MagicFileResource extends CakeObject{
class MagicFileResource extends Object{
/**
* undocumented variable
*
@ -202,7 +202,7 @@ class MagicFileResource extends CakeObject{
*/
function __construct($file) {
if (file_exists($file)) {
$this->resource = new File($file);
$this->resource =& new File($file);
} else {
$this->resource = $file;
}

View file

@ -32,7 +32,7 @@
* @package cake
* @subpackage cake.cake.libs.model
*/
class ModelBehavior extends CakeObject {
class ModelBehavior extends Object {
/**
* Contains configuration settings for use with individual model objects. This
* is used because if multiple models use this Behavior, each will use the same
@ -204,7 +204,7 @@ class ModelBehavior extends CakeObject {
* @package cake
* @subpackage cake.cake.libs.model
*/
class BehaviorCollection extends CakeObject {
class BehaviorCollection extends Object {
/**
* Stores a reference to the attached name
*
@ -283,7 +283,7 @@ class BehaviorCollection extends CakeObject {
if (PHP5) {
$this->{$name} = new $class;
} else {
$this->{$name} = new $class;
$this->{$name} =& new $class;
}
ClassRegistry::addObject($class, $this->{$name});
}

View file

@ -35,7 +35,7 @@ config('database');
* @package cake
* @subpackage cake.cake.libs.model
*/
class ConnectionManager extends CakeObject {
class ConnectionManager extends Object {
/**
* Holds a loaded instance of the Connections object
*
@ -63,7 +63,7 @@ class ConnectionManager extends CakeObject {
*/
function __construct() {
if (class_exists('DATABASE_CONFIG')) {
$this->config = new DATABASE_CONFIG();
$this->config =& new DATABASE_CONFIG();
}
}
/**
@ -77,7 +77,7 @@ class ConnectionManager extends CakeObject {
static $instance = array();
if (!$instance) {
$instance[0] = new ConnectionManager();
$instance[0] =& new ConnectionManager();
}
return $instance[0];
@ -103,7 +103,7 @@ class ConnectionManager extends CakeObject {
$conn = $connections[$name];
$class = $conn['classname'];
$_this->loadDataSource($name);
$_this->_dataSources[$name] = new $class($_this->config->{$name});
$_this->_dataSources[$name] =& new $class($_this->config->{$name});
$_this->_dataSources[$name]->configKeyName = $name;
} else {
trigger_error(sprintf(__("ConnectionManager::getDataSource - Non-existent data source %s", true), $name), E_USER_ERROR);

View file

@ -32,7 +32,7 @@
* @package cake
* @subpackage cake.cake.libs.model.datasources
*/
class DataSource extends CakeObject {
class DataSource extends Object {
/**
* Are we connected to the DataSource?
*

View file

@ -29,7 +29,7 @@ App::import('Model', 'ConnectionManager');
* @package cake
* @subpackage cake.cake.libs.model
*/
class CakeSchema extends CakeObject {
class CakeSchema extends Object {
/**
* Name of the App Schema
*
@ -158,7 +158,7 @@ class CakeSchema extends CakeObject {
}
if (class_exists($class)) {
$Schema = new $class($options);
$Schema =& new $class($options);
return $Schema;
}
@ -354,7 +354,7 @@ class CakeSchema extends CakeObject {
$out .="}\n";
$File = new File($path . DS . $file, true);
$File =& new File($path . DS . $file, true);
$header = '$Id';
$content = "<?php \n/* SVN FILE: {$header}$ */\n/* {$name} schema generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>";
$content = $File->prepare($content);

View file

@ -241,7 +241,7 @@ if (!function_exists('mb_encode_mimeheader')) {
* @package cake
* @subpackage cake.cake.libs
*/
class Multibyte extends CakeObject {
class Multibyte extends Object {
/**
* Holds the case folding values
*
@ -274,7 +274,7 @@ class Multibyte extends CakeObject {
static $instance = array();
if (!$instance) {
$instance[0] = new Multibyte();
$instance[0] =& new Multibyte();
}
return $instance[0];
}

View file

@ -34,7 +34,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class CakeObject {
class Object {
/**
* Log object
*
@ -295,7 +295,4 @@ class CakeObject {
}
}
}
// Note: In PHP 7+, 'Object' is a reserved class name
// All classes that extend Object should now extend CakeObject instead
?>

View file

@ -30,7 +30,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class Overloadable extends CakeObject {
class Overloadable extends Object {
/**
* Constructor.
*
@ -88,7 +88,7 @@ Overloadable::overload('Overloadable');
* @package cake
* @subpackage cake.cake.libs
*/
class Overloadable2 extends CakeObject {
class Overloadable2 extends Object {
/**
* Constructor
*

View file

@ -30,7 +30,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class Overloadable extends CakeObject {
class Overloadable extends Object {
/**
* Overload implementation. No need for implementation in PHP5.
*
@ -60,7 +60,7 @@ class Overloadable extends CakeObject {
*
* @package cake
*/
class Overloadable2 extends CakeObject {
class Overloadable2 extends Object {
/**
* Overload implementation. No need for implementation in PHP5.
*

View file

@ -37,7 +37,7 @@ if (!class_exists('Object')) {
* @package cake
* @subpackage cake.cake.libs
*/
class Router extends CakeObject {
class Router extends Object {
/**
* Array of routes
*
@ -170,7 +170,7 @@ class Router extends CakeObject {
static $instance = array();
if (!$instance) {
$instance[0] = new Router();
$instance[0] =& new Router();
$instance[0]->__admin = Configure::read('Routing.admin');
}
return $instance[0];

View file

@ -32,7 +32,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class Security extends CakeObject {
class Security extends Object {
/**
* Default hash method
*
@ -50,7 +50,7 @@ class Security extends CakeObject {
function &getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] = new Security;
$instance[0] =& new Security;
}
return $instance[0];
}

View file

@ -46,7 +46,7 @@ if (!class_exists('Security')) {
* @package cake
* @subpackage cake.cake.libs
*/
class CakeSession extends CakeObject {
class CakeSession extends Object {
/**
* True if the Session is still valid
*

View file

@ -30,7 +30,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class Set extends CakeObject {
class Set extends Object {
/**
* Deprecated
*

View file

@ -31,7 +31,7 @@ App::import('Core', 'Validation');
* @package cake
* @subpackage cake.cake.libs
*/
class CakeSocket extends CakeObject {
class CakeSocket extends Object {
/**
* Object description
*

View file

@ -30,7 +30,7 @@
* @package cake
* @subpackage cake.cake.libs
*/
class String extends CakeObject {
class String extends Object {
/**
* Gets a reference to the String object instance
*
@ -42,7 +42,7 @@ class String extends CakeObject {
static $instance = array();
if (!$instance) {
$instance[0] = new String();
$instance[0] =& new String();
}
return $instance[0];
}

View file

@ -52,7 +52,7 @@
* @subpackage cake.cake.libs
* @since CakePHP v 1.2.0.3830
*/
class Validation extends CakeObject {
class Validation extends Object {
/**
* Set the the value of methods $check param.
*
@ -119,7 +119,7 @@ class Validation extends CakeObject {
static $instance = array();
if (!$instance) {
$instance[0] = new Validation();
$instance[0] =& new Validation();
}
return $instance[0];
}

View file

@ -252,7 +252,7 @@ class CacheHelper extends AppHelper {
';
}
$file .= '$controller = new ' . $this->controllerName . 'Controller();
$file .= '$controller =& new ' . $this->controllerName . 'Controller();
$controller->plugin = $this->plugin = \''.$this->plugin.'\';
$controller->helpers = $this->helpers = unserialize(\'' . serialize($this->helpers) . '\');
$controller->base = $this->base = \'' . $this->base . '\';

View file

@ -136,7 +136,7 @@ class JsHelper extends Overloadable2 {
}
$func .= "'" . Router::url($url) . "'";
$ajax = new AjaxHelper();
$ajax =& new AjaxHelper();
$func .= ", " . $ajax->__optionsForAjax($options) . ")";
if (isset($options['before'])) {

View file

@ -46,7 +46,7 @@ class XmlHelper extends AppHelper {
*/
function __construct() {
parent::__construct();
$this->Xml = new Xml();
$this->Xml =& new Xml();
$this->Xml->options(array('verifyNs' => false));
}
/**
@ -155,7 +155,7 @@ class XmlHelper extends AppHelper {
*/
function serialize($data, $options = array()) {
$options += array('attributes' => false, 'format' => 'attributes');
$data = new Xml($data, $options);
$data =& new Xml($data, $options);
return $data->toString($options + array('header' => false));
}
}

View file

@ -34,7 +34,7 @@ App::import('Core', array('Helper', 'ClassRegistry'));
* @package cake
* @subpackage cake.cake.libs.view
*/
class View extends CakeObject {
class View extends Object {
/**
* Path parts for creating links in views.
*
@ -745,7 +745,7 @@ class View extends CakeObject {
return false;
}
}
$loaded[$helper] = new $helperCn($options);
$loaded[$helper] =& new $helperCn($options);
$vars = array(
'base', 'webroot', 'here', 'params', 'action', 'data', 'themeWeb', 'plugin'
);

View file

@ -34,7 +34,7 @@ App::import('Core', 'Set');
* @subpackage cake.cake.libs
* @since CakePHP v .0.10.3.1400
*/
class XmlNode extends CakeObject {
class XmlNode extends Object {
/**
* Name of node
*
@ -147,7 +147,7 @@ class XmlNode extends CakeObject {
* @return object XmlNode
*/
function &createNode($name = null, $value = null, $namespace = false) {
$node = new XmlNode($name, $value, $namespace);
$node =& new XmlNode($name, $value, $namespace);
$node->setParent($this);
return $node;
}
@ -161,7 +161,7 @@ class XmlNode extends CakeObject {
* @return object XmlElement
*/
function &createElement($name = null, $value = null, $attributes = array(), $namespace = false) {
$element = new XmlElement($name, $value, $attributes, $namespace);
$element =& new XmlElement($name, $value, $attributes, $namespace);
$element->setParent($this);
return $element;
}
@ -1398,7 +1398,7 @@ class XmlManager {
static $instance = array();
if (!$instance) {
$instance[0] = new XmlManager();
$instance[0] =& new XmlManager();
}
return $instance[0];
}

View file

@ -151,7 +151,7 @@ class ShellDispatcherTest extends UnitTestCase {
* @return void
*/
function testParseParams() {
$Dispatcher = new TestShellDispatcher();
$Dispatcher =& new TestShellDispatcher();
$params = array(
'/cake/1.2.x.x/cake/console/cake.php',
@ -423,7 +423,7 @@ class ShellDispatcherTest extends UnitTestCase {
* @return void
*/
function testBuildPaths() {
$Dispatcher = new TestShellDispatcher();
$Dispatcher =& new TestShellDispatcher();
$result = $Dispatcher->shellPaths;
$expected = array(
@ -444,13 +444,13 @@ class ShellDispatcherTest extends UnitTestCase {
* @return void
*/
function testDispatch() {
$Dispatcher = new TestShellDispatcher(array('sample'));
$Dispatcher =& new TestShellDispatcher(array('sample'));
$this->assertPattern('/This is the main method called from SampleShell/', $Dispatcher->stdout);
$Dispatcher = new TestShellDispatcher(array('test_plugin_two.example'));
$Dispatcher =& new TestShellDispatcher(array('test_plugin_two.example'));
$this->assertPattern('/This is the main method called from TestPluginTwo.ExampleShell/', $Dispatcher->stdout);
$Dispatcher = new TestShellDispatcher(array('test_plugin_two.welcome', 'say_hello'));
$Dispatcher =& new TestShellDispatcher(array('test_plugin_two.welcome', 'say_hello'));
$this->assertPattern('/This is the say_hello method called from TestPluginTwo.WelcomeShell/', $Dispatcher->stdout);
}
/**
@ -460,7 +460,7 @@ class ShellDispatcherTest extends UnitTestCase {
* @return void
*/
function testHelpCommand() {
$Dispatcher = new TestShellDispatcher();
$Dispatcher =& new TestShellDispatcher();
$expected = "/ CORE(\\\|\/)tests(\\\|\/)test_app(\\\|\/)plugins(\\\|\/)test_plugin(\\\|\/)vendors(\\\|\/)shells:";
$expected .= "\n\t example";

View file

@ -84,8 +84,8 @@ class AclShellTest extends CakeTestCase {
* @access public
*/
function startTest() {
$this->Dispatcher = new TestAclShellMockShellDispatcher();
$this->Task = new MockAclShell($this->Dispatcher);
$this->Dispatcher =& new TestAclShellMockShellDispatcher();
$this->Task =& new MockAclShell($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->params['datasource'] = 'test_suite';
}

View file

@ -62,8 +62,8 @@ class ApiShellTest extends CakeTestCase {
* @access public
*/
function startTest() {
$this->Dispatcher = new ApiShellMockShellDispatcher();
$this->Shell = new MockApiShell($this->Dispatcher);
$this->Dispatcher =& new ApiShellMockShellDispatcher();
$this->Shell =& new MockApiShell($this->Dispatcher);
$this->Shell->Dispatch =& $this->Dispatcher;
}
/**

View file

@ -124,8 +124,8 @@ class SchemaShellTest extends CakeTestCase {
* @access public
*/
function startTest() {
$this->Dispatcher = new TestSchemaShellMockShellDispatcher();
$this->Shell = new MockSchemaShell($this->Dispatcher);
$this->Dispatcher =& new TestSchemaShellMockShellDispatcher();
$this->Shell =& new MockSchemaShell($this->Dispatcher);
$this->Shell->Dispatch =& $this->Dispatcher;
}
@ -193,9 +193,9 @@ class SchemaShellTest extends CakeTestCase {
* @return void
**/
function testDumpWithFileWriting() {
$file = new File(APP . 'config' . DS . 'sql' . DS . 'i18n.php');
$file =& new File(APP . 'config' . DS . 'sql' . DS . 'i18n.php');
$contents = $file->read();
$file = new File(TMP . 'tests' . DS . 'i18n.php');
$file =& new File(TMP . 'tests' . DS . 'i18n.php');
$file->write($contents);
$this->Shell->params = array('name' => 'i18n');
@ -204,7 +204,7 @@ class SchemaShellTest extends CakeTestCase {
$this->Shell->Schema->path = TMP . 'tests';
$this->Shell->dump();
$sql = new File(TMP . 'tests' . DS . 'i18n.sql');
$sql =& new File(TMP . 'tests' . DS . 'i18n.sql');
$contents = $sql->read();
$this->assertPattern('/DROP TABLE/', $contents);
$this->assertPattern('/CREATE TABLE `i18n`/', $contents);
@ -228,7 +228,7 @@ class SchemaShellTest extends CakeTestCase {
$this->Shell->path = TMP;
$this->Shell->params['file'] = 'schema.php';
$this->Shell->args = array('snapshot');
$this->Shell->Schema = new MockSchemaCakeSchema();
$this->Shell->Schema =& new MockSchemaCakeSchema();
$this->Shell->Schema->setReturnValue('read', array('schema data'));
$this->Shell->Schema->setReturnValue('write', true);
@ -249,7 +249,7 @@ class SchemaShellTest extends CakeTestCase {
$this->Shell->args = array();
$this->Shell->setReturnValue('in', 'q');
$this->Shell->Schema = new MockSchemaCakeSchema();
$this->Shell->Schema =& new MockSchemaCakeSchema();
$this->Shell->Schema->path = TMP;
$this->Shell->Schema->expectNever('read');
@ -269,7 +269,7 @@ class SchemaShellTest extends CakeTestCase {
$this->Shell->setReturnValue('in', 'o');
$this->Shell->expectAt(1, 'out', array(new PatternExpectation('/Schema file:\s[a-z\.]+\sgenerated/')));
$this->Shell->Schema = new MockSchemaCakeSchema();
$this->Shell->Schema =& new MockSchemaCakeSchema();
$this->Shell->Schema->path = TMP;
$this->Shell->Schema->setReturnValue('read', array('schema data'));
$this->Shell->Schema->setReturnValue('write', true);
@ -341,7 +341,7 @@ class SchemaShellTest extends CakeTestCase {
$this->Shell->setReturnValue('in', 'y');
$this->Shell->run();
$article = new Model(array('name' => 'Article', 'ds' => 'test_suite'));
$article =& new Model(array('name' => 'Article', 'ds' => 'test_suite'));
$fields = $article->schema();
$this->assertTrue(isset($fields['summary']));

View file

@ -95,8 +95,8 @@ class ShellTest extends CakeTestCase {
* @access public
*/
function setUp() {
$this->Dispatcher = new TestShellMockShellDispatcher();
$this->Shell = new TestShell($this->Dispatcher);
$this->Dispatcher =& new TestShellMockShellDispatcher();
$this->Shell =& new TestShell($this->Dispatcher);
}
/**
* tearDown method

View file

@ -59,8 +59,8 @@ class ExtractTaskTest extends CakeTestCase {
* @access public
*/
function setUp() {
$this->Dispatcher = new TestExtractTaskMockShellDispatcher();
$this->Task = new ExtractTask($this->Dispatcher);
$this->Dispatcher =& new TestExtractTaskMockShellDispatcher();
$this->Task =& new ExtractTask($this->Dispatcher);
}
/**
* tearDown method

View file

@ -63,8 +63,8 @@ class TestTaskTest extends CakeTestCase {
* @access public
*/
function setUp() {
$this->Dispatcher = new TestTestTaskMockShellDispatcher();
$this->Task = new MockTestTask($this->Dispatcher);
$this->Dispatcher =& new TestTestTaskMockShellDispatcher();
$this->Task =& new MockTestTask($this->Dispatcher);
$this->Task->Dispatch =& $this->Dispatcher;
}
/**

View file

@ -544,7 +544,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testParseParamsWithoutZerosAndEmptyPost() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$test = $Dispatcher->parseParams("/testcontroller/testaction/params1/params2/params3");
$this->assertIdentical($test['controller'], 'testcontroller');
$this->assertIdentical($test['action'], 'testaction');
@ -561,7 +561,7 @@ class DispatcherTest extends CakeTestCase {
*/
function testParseParamsReturnsPostedData() {
$_POST['testdata'] = "My Posted Content";
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$test = $Dispatcher->parseParams("/");
$this->assertTrue($test['form'], "Parsed URL not returning post data");
$this->assertIdentical($test['form']['testdata'], "My Posted Content");
@ -573,7 +573,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testParseParamsWithSingleZero() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$test = $Dispatcher->parseParams("/testcontroller/testaction/1/0/23");
$this->assertIdentical($test['controller'], 'testcontroller');
$this->assertIdentical($test['action'], 'testaction');
@ -588,7 +588,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testParseParamsWithManySingleZeros() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$test = $Dispatcher->parseParams("/testcontroller/testaction/0/0/0/0/0/0");
$this->assertPattern('/\\A(?:0)\\z/', $test['pass'][0]);
$this->assertPattern('/\\A(?:0)\\z/', $test['pass'][1]);
@ -604,7 +604,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testParseParamsWithManyZerosInEachSectionOfUrl() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$test = $Dispatcher->parseParams("/testcontroller/testaction/000/0000/00000/000000/000000/0000000");
$this->assertPattern('/\\A(?:000)\\z/', $test['pass'][0]);
$this->assertPattern('/\\A(?:0000)\\z/', $test['pass'][1]);
@ -620,7 +620,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$test = $Dispatcher->parseParams("/testcontroller/testaction/01/0403/04010/000002/000030/0000400");
$this->assertPattern('/\\A(?:01)\\z/', $test['pass'][0]);
$this->assertPattern('/\\A(?:0403)\\z/', $test['pass'][1]);
@ -641,7 +641,7 @@ class DispatcherTest extends CakeTestCase {
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
$_GET = array('coffee' => 'life', 'sleep' => 'sissies');
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$uri = 'posts/home/?coffee=life&sleep=sissies';
$result = $Dispatcher->parseParams($uri);
$this->assertPattern('/posts/', $result['controller']);
@ -649,7 +649,7 @@ class DispatcherTest extends CakeTestCase {
$this->assertTrue(isset($result['url']['sleep']));
$this->assertTrue(isset($result['url']['coffee']));
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$uri = '/?coffee=life&sleep=sissy';
$result = $Dispatcher->parseParams($uri);
$this->assertPattern('/pages/', $result['controller']);
@ -712,7 +712,7 @@ class DispatcherTest extends CakeTestCase {
),
));
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$result = $Dispatcher->parseParams('/');
$expected = array(
@ -830,7 +830,7 @@ class DispatcherTest extends CakeTestCase {
)
)
);
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$result = $Dispatcher->parseParams('/');
$expected = array(
'Document' => array(
@ -895,7 +895,7 @@ class DispatcherTest extends CakeTestCase {
)
);
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$result = $Dispatcher->parseParams('/');
$expected = array(
@ -917,7 +917,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testGetUrl() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$Dispatcher->base = '/app/webroot/index.php';
$uri = '/app/webroot/index.php/posts/add';
$result = $Dispatcher->getUrl($uri);
@ -933,7 +933,7 @@ class DispatcherTest extends CakeTestCase {
$_GET['url'] = array();
Configure::write('App.base', '/control');
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$Dispatcher->baseUrl();
$uri = '/control/students/browse';
$result = $Dispatcher->getUrl($uri);
@ -941,7 +941,7 @@ class DispatcherTest extends CakeTestCase {
$this->assertEqual($expected, $result);
$_GET['url'] = array();
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$Dispatcher->base = '';
$uri = '/?/home';
$result = $Dispatcher->getUrl($uri);
@ -956,7 +956,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testBaseUrlAndWebrootWithModRewrite() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$Dispatcher->base = false;
$_SERVER['DOCUMENT_ROOT'] = '/cake/repo/branches';
@ -1037,7 +1037,7 @@ class DispatcherTest extends CakeTestCase {
Configure::write('App.base', '/control');
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$result = $Dispatcher->baseUrl();
$expected = '/control';
$this->assertEqual($expected, $result);
@ -1051,7 +1051,7 @@ class DispatcherTest extends CakeTestCase {
$_SERVER['DOCUMENT_ROOT'] = '/var/www/abtravaff/html';
$_SERVER['SCRIPT_FILENAME'] = '/var/www/abtravaff/html/newaffiliate/index.php';
$_SERVER['PHP_SELF'] = '/newaffiliate/index.php';
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$result = $Dispatcher->baseUrl();
$expected = '/newaffiliate';
$this->assertEqual($expected, $result);
@ -1065,7 +1065,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testBaseUrlAndWebrootWithBaseUrl() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
Configure::write('App.dir', 'app');
@ -1134,7 +1134,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testBaseUrlAndWebrootWithBase() {
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$Dispatcher->base = '/app';
$result = $Dispatcher->baseUrl();
$expected = '/app';
@ -1164,7 +1164,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testMissingController() {
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('App.baseUrl','/index.php');
$url = 'some_controller/home/param:value/param2:value2';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
@ -1183,7 +1183,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testPrivate() {
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('App.baseUrl','/index.php');
$url = 'some_pages/_protected/param:value/param2:value2';
@ -1205,7 +1205,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testMissingAction() {
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('App.baseUrl','/index.php');
$url = 'some_pages/home/param:value/param2:value2';
@ -1220,7 +1220,7 @@ class DispatcherTest extends CakeTestCase {
)));
$this->assertEqual($expected, $controller);
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('App.baseUrl','/index.php');
$url = 'some_pages/redirect/param:value/param2:value2';
@ -1242,7 +1242,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testDispatch() {
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('App.baseUrl','/index.php');
$url = 'pages/home/param:value/param2:value2';
@ -1269,7 +1269,7 @@ class DispatcherTest extends CakeTestCase {
unset($Dispatcher);
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('App.baseUrl','/timesheets/index.php');
$url = 'timesheets';
@ -1296,7 +1296,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testDispatchWithArray() {
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('App.baseUrl','/index.php');
$url = 'pages/home/param:value/param2:value2';
@ -1316,7 +1316,7 @@ class DispatcherTest extends CakeTestCase {
*/
function testAdminDispatch() {
$_POST = array();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('Routing.admin', 'admin');
Configure::write('App.baseUrl','/cake/repo/branches/1.2.x.x/index.php');
$url = 'admin/test_dispatch_pages/index/param:value/param2:value2';
@ -1349,7 +1349,7 @@ class DispatcherTest extends CakeTestCase {
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Router::connect('/my_plugin/:controller/*', array('plugin'=>'my_plugin', 'controller'=>'pages', 'action'=>'display'));
$Dispatcher->base = false;
@ -1397,7 +1397,7 @@ class DispatcherTest extends CakeTestCase {
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Router::connect('/my_plugin/:controller/:action/*', array('plugin'=>'my_plugin', 'controller'=>'pages', 'action'=>'display'));
$Dispatcher->base = false;
@ -1434,7 +1434,7 @@ class DispatcherTest extends CakeTestCase {
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'my_plugin/add/param:value/param2:value2';
@ -1455,7 +1455,7 @@ class DispatcherTest extends CakeTestCase {
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
/* Simulates the Route for a real plugin, installed in APP/plugins */
@ -1483,7 +1483,7 @@ class DispatcherTest extends CakeTestCase {
Configure::write('Routing.admin', 'admin');
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'admin/my_plugin/add/5/param:value/param2:value2';
@ -1503,7 +1503,7 @@ class DispatcherTest extends CakeTestCase {
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$controller = $Dispatcher->dispatch('admin/articles_test', array('return' => 1));
@ -1536,21 +1536,21 @@ class DispatcherTest extends CakeTestCase {
Router::reload();
Router::connect('/my_plugin/:controller/:action/*', array('plugin'=>'my_plugin'));
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'my_plugin/my_plugin/add';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
$this->assertFalse(isset($controller->params['pass'][0]));
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'my_plugin/my_plugin/add/0';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
$this->assertTrue(isset($controller->params['pass'][0]));
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'my_plugin/add';
@ -1558,14 +1558,14 @@ class DispatcherTest extends CakeTestCase {
$this->assertFalse(isset($controller->params['pass'][0]));
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'my_plugin/add/0';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
$this->assertIdentical('0',$controller->params['pass'][0]);
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'my_plugin/add/1';
@ -1583,7 +1583,7 @@ class DispatcherTest extends CakeTestCase {
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'my_plugin/not_here/param:value/param2:value2';
@ -1599,7 +1599,7 @@ class DispatcherTest extends CakeTestCase {
$this->assertIdentical($expected, $controller);
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'my_plugin/param:value/param2:value2';
@ -1627,7 +1627,7 @@ class DispatcherTest extends CakeTestCase {
Router::reload();
Router::connect('/admin/:controller/:action/*', array('prefix'=>'admin'), array('controller', 'action'));
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$Dispatcher->base = false;
$url = 'test_dispatch_pages/admin_index/param:value/param2:value2';
@ -1648,7 +1648,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
**/
function testTestPluginDispatch() {
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$_back = Configure::read('pluginPaths');
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS));
$url = '/test_plugin/tests/index';
@ -1668,7 +1668,7 @@ class DispatcherTest extends CakeTestCase {
*/
function testChangingParamsFromBeforeFilter() {
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
$url = 'some_posts/index/param:value/param2:value2';
$controller = $Dispatcher->dispatch($url, array('return' => 1));
@ -1707,7 +1707,7 @@ class DispatcherTest extends CakeTestCase {
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS));
Configure::write('vendorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS));
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Configure::write('debug', 0);
ob_start();
@ -1777,7 +1777,7 @@ class DispatcherTest extends CakeTestCase {
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS));
$dispatcher = new Dispatcher();
$dispatcher =& new Dispatcher();
$dispatcher->base = false;
$url = '/';
@ -1902,7 +1902,7 @@ class DispatcherTest extends CakeTestCase {
Router::mapResources('Posts');
$_SERVER['REQUEST_METHOD'] = 'POST';
$dispatcher = new Dispatcher();
$dispatcher =& new Dispatcher();
$dispatcher->base = false;
$result = $dispatcher->parseParams('/posts');
@ -1956,7 +1956,7 @@ class DispatcherTest extends CakeTestCase {
"/index.php/%22%3E%3Ch1%20onclick=%22alert('xss');%22%3Eheya%3C/h1%3E"
);
$dispatcher = new Dispatcher();
$dispatcher =& new Dispatcher();
$result = $dispatcher->baseUrl();
$expected = '/index.php/h1 onclick=alert(xss);heya';
$this->assertEqual($result, $expected);
@ -1968,7 +1968,7 @@ class DispatcherTest extends CakeTestCase {
* @return void
*/
function testEnvironmentDetection() {
$dispatcher = new Dispatcher();
$dispatcher =& new Dispatcher();
$environments = array(
'IIS' => array(
@ -2077,7 +2077,7 @@ class DispatcherTest extends CakeTestCase {
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
Router::reload();
$Dispatcher = new TestDispatcher();
$Dispatcher =& new TestDispatcher();
Router::connect('/myalias/:action/*', array('controller' => 'my_controller', 'action' => null));
$Dispatcher->base = false;

View file

@ -78,8 +78,8 @@ class CakeTestCaseTest extends CakeTestCase {
* @return void
*/
function setUp() {
$this->Case = new SubjectCakeTestCase();
$reporter = new MockCakeHtmlReporter();
$this->Case =& new SubjectCakeTestCase();
$reporter =& new MockCakeHtmlReporter();
$this->Case->setReporter($reporter);
$this->Reporter = $reporter;
}
@ -265,7 +265,7 @@ class CakeTestCaseTest extends CakeTestCase {
$this->assertEqual($result, array('var' => 'string'));
$db =& ConnectionManager::getDataSource('test_suite');
$fixture = new PostFixture();
$fixture =& new PostFixture();
$fixture->create($db);
$result = $this->Case->testAction('/tests_apps_posts/add', array('return' => 'vars'));
@ -321,7 +321,7 @@ class CakeTestCaseTest extends CakeTestCase {
ConnectionManager::create('cake_test_case', $config);
$db2 =& ConnectionManager::getDataSource('cake_test_case');
$fixture = new PostFixture($db2);
$fixture =& new PostFixture($db2);
$fixture->create($db2);
$fixture->insert($db2);
@ -349,7 +349,7 @@ class CakeTestCaseTest extends CakeTestCase {
ConnectionManager::create('cake_test_case', $config);
$db =& ConnectionManager::getDataSource('cake_test_case');
$fixture = new PostFixture($db);
$fixture =& new PostFixture($db);
$fixture->create($db);
$fixture->insert($db);
@ -399,8 +399,8 @@ class CakeTestCaseTest extends CakeTestCase {
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS));
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS));
$Dispatcher = new CakeTestDispatcher();
$Case = new CakeDispatcherMockTestCase();
$Dispatcher =& new CakeTestDispatcher();
$Case =& new CakeDispatcherMockTestCase();
$Case->expectOnce('startController');
$Case->expectOnce('endController');

View file

@ -125,7 +125,7 @@ class CakeTestFixtureTest extends CakeTestCase {
* @return void
*/
function setUp() {
$this->criticDb = new FixtureMockDboSource();
$this->criticDb =& new FixtureMockDboSource();
$this->criticDb->fullDebug = true;
}
/**
@ -144,23 +144,23 @@ class CakeTestFixtureTest extends CakeTestCase {
* @return void
*/
function testInit() {
$Fixture = new CakeTestFixtureTestFixture();
$Fixture =& new CakeTestFixtureTestFixture();
unset($Fixture->table);
$Fixture->init();
$this->assertEqual($Fixture->table, 'fixture_tests');
$this->assertEqual($Fixture->primaryKey, 'id');
$Fixture = new CakeTestFixtureTestFixture();
$Fixture =& new CakeTestFixtureTestFixture();
$Fixture->primaryKey = 'my_random_key';
$Fixture->init();
$this->assertEqual($Fixture->primaryKey, 'my_random_key');
$this->_initDb();
$Source = new CakeTestFixtureTestFixture();
$Source =& new CakeTestFixtureTestFixture();
$Source->create($this->db);
$Source->insert($this->db);
$Fixture = new CakeTestFixtureImportFixture();
$Fixture =& new CakeTestFixtureImportFixture();
$expected = array('id', 'name', 'created');
$this->assertEqual(array_keys($Fixture->fields), $expected);
@ -174,7 +174,7 @@ class CakeTestFixtureTest extends CakeTestCase {
$Fixture->init();
$this->assertEqual(count($Fixture->records), count($Source->records));
$Fixture = new CakeTestFixtureImportFixture();
$Fixture =& new CakeTestFixtureImportFixture();
$Fixture->fields = $Fixture->records = null;
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'test_suite');
$Fixture->init();
@ -201,13 +201,13 @@ class CakeTestFixtureTest extends CakeTestCase {
ConnectionManager::create('new_test_suite', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix'])));
$newTestSuiteDb =& ConnectionManager::getDataSource('new_test_suite');
$Source = new CakeTestFixtureTestFixture();
$Source =& new CakeTestFixtureTestFixture();
$Source->create($newTestSuiteDb);
$Source->insert($newTestSuiteDb);
$defaultDb->config = $newTestSuiteDb->config;
$Fixture = new CakeTestFixtureDefaultImportFixture();
$Fixture =& new CakeTestFixtureDefaultImportFixture();
$Fixture->fields = $Fixture->records = null;
$Fixture->import = array('model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite');
$Fixture->init();
@ -227,7 +227,7 @@ class CakeTestFixtureTest extends CakeTestCase {
* @return void
*/
function testCreate() {
$Fixture = new CakeTestFixtureTestFixture();
$Fixture =& new CakeTestFixtureTestFixture();
$this->criticDb->expectAtLeastOnce('execute');
$this->criticDb->expectAtLeastOnce('createSchema');
$return = $Fixture->create($this->criticDb);
@ -245,7 +245,7 @@ class CakeTestFixtureTest extends CakeTestCase {
* @return void
*/
function testInsert() {
$Fixture = new CakeTestFixtureTestFixture();
$Fixture =& new CakeTestFixtureTestFixture();
$this->criticDb->setReturnValue('insertMulti', true);
$this->criticDb->expectAtLeastOnce('insertMulti');
@ -260,7 +260,7 @@ class CakeTestFixtureTest extends CakeTestCase {
* @return void
*/
function testDrop() {
$Fixture = new CakeTestFixtureTestFixture();
$Fixture =& new CakeTestFixtureTestFixture();
$this->criticDb->setReturnValueAt(0, 'execute', true);
$this->criticDb->expectAtLeastOnce('execute');
$this->criticDb->expectAtLeastOnce('dropSchema');
@ -280,7 +280,7 @@ class CakeTestFixtureTest extends CakeTestCase {
* @return void
*/
function testTruncate() {
$Fixture = new CakeTestFixtureTestFixture();
$Fixture =& new CakeTestFixtureTestFixture();
$this->criticDb->expectAtLeastOnce('truncate');
$Fixture->truncate($this->criticDb);
$this->assertTrue($this->criticDb->fullDebug);

View file

@ -158,7 +158,7 @@ class CodeCoverageManagerTest extends CakeTestCase {
* @package cake
* @subpackage cake.tests.cases.libs
*/
class Set extends CakeObject {
class Set extends Object {
/**
* Value of the Set object.
*
@ -315,7 +315,7 @@ PHP;
* @package cake
* @subpackage cake.tests.cases.libs
*/
class Set extends CakeObject {
class Set extends Object {
/**
* Value of the Set object.
*

View file

@ -72,7 +72,7 @@ if (!class_exists('AppController')) {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class ParamTestComponent extends CakeObject {
class ParamTestComponent extends Object {
/**
* name property
*
@ -133,7 +133,7 @@ class ComponentTestController extends AppController {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class AppleComponent extends CakeObject {
class AppleComponent extends Object {
/**
* components property
*
@ -165,7 +165,7 @@ class AppleComponent extends CakeObject {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class OrangeComponent extends CakeObject {
class OrangeComponent extends Object {
/**
* components property
*
@ -202,7 +202,7 @@ class OrangeComponent extends CakeObject {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class BananaComponent extends CakeObject {
class BananaComponent extends Object {
/**
* testField property
*
@ -227,7 +227,7 @@ class BananaComponent extends CakeObject {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class MutuallyReferencingOneComponent extends CakeObject {
class MutuallyReferencingOneComponent extends Object {
/**
* components property
*
@ -242,7 +242,7 @@ class MutuallyReferencingOneComponent extends CakeObject {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class MutuallyReferencingTwoComponent extends CakeObject {
class MutuallyReferencingTwoComponent extends Object {
/**
* components property
*
@ -257,7 +257,7 @@ class MutuallyReferencingTwoComponent extends CakeObject {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class SomethingWithEmailComponent extends CakeObject {
class SomethingWithEmailComponent extends Object {
/**
* components property
*
@ -302,19 +302,19 @@ class ComponentTest extends CakeTestCase {
* @return void
*/
function testLoadComponents() {
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('RequestHandler');
$Component = new Component();
$Component =& new Component();
$Component->init($Controller);
$this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent'));
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->plugin = 'test_plugin';
$Controller->components = array('RequestHandler', 'TestPluginComponent');
$Component = new Component();
$Component =& new Component();
$Component->init($Controller);
$this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent'));
@ -325,19 +325,19 @@ class ComponentTest extends CakeTestCase {
));
$this->assertFalse(isset($Controller->TestPluginOtherComponent));
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('Security');
$Component = new Component();
$Component =& new Component();
$Component->init($Controller);
$this->assertTrue(is_a($Controller->Security, 'SecurityComponent'));
$this->assertTrue(is_a($Controller->Security->Session, 'SessionComponent'));
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('Security', 'Cookie', 'RequestHandler');
$Component = new Component();
$Component =& new Component();
$Component->init($Controller);
$this->assertTrue(is_a($Controller->Security, 'SecurityComponent'));
@ -351,7 +351,7 @@ class ComponentTest extends CakeTestCase {
* @return void
*/
function testNestedComponentLoading() {
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('Apple');
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@ -370,7 +370,7 @@ class ComponentTest extends CakeTestCase {
* @return void
*/
function testComponentStartup() {
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('Apple');
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@ -390,7 +390,7 @@ class ComponentTest extends CakeTestCase {
* @return void
*/
function testMultipleComponentInitialize() {
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('Orange', 'Banana');
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@ -409,7 +409,7 @@ class ComponentTest extends CakeTestCase {
return;
}
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('ParamTest' => array('test' => 'value', 'flag'), 'Apple');
$Controller->constructClasses();
@ -424,7 +424,7 @@ class ComponentTest extends CakeTestCase {
$this->assertEqual($Controller->ParamTest->flag, true);
//Settings are merged from app controller and current controller.
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array(
'ParamTest' => array('test' => 'value'),
'Orange' => array('ripeness' => 'perfect')
@ -443,7 +443,7 @@ class ComponentTest extends CakeTestCase {
* @return void
**/
function testComponentParamsNoDuplication() {
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('Orange' => array('setting' => array('itemx')));
$Controller->constructClasses();
@ -457,7 +457,7 @@ class ComponentTest extends CakeTestCase {
* @return void
*/
function testMutuallyReferencingComponents() {
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('MutuallyReferencingOne');
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@ -481,7 +481,7 @@ class ComponentTest extends CakeTestCase {
* @return void
*/
function testSomethingReferencingEmailComponent() {
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->components = array('SomethingWithEmail');
$Controller->constructClasses();
$Controller->Component->initialize($Controller);
@ -510,7 +510,7 @@ class ComponentTest extends CakeTestCase {
function testDoubleLoadingOfSessionComponent() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController');
$Controller = new ComponentTestController();
$Controller =& new ComponentTestController();
$Controller->uses = array();
$Controller->components = array('Session');
$Controller->constructClasses();

View file

@ -165,10 +165,10 @@ class DbAclTwoTest extends DbAcl {
* @return void
*/
function __construct() {
$this->Aro = new AroTwoTest();
$this->Aro->Permission = new PermissionTwoTest();
$this->Aco = new AcoTwoTest();
$this->Aro->Permission = new PermissionTwoTest();
$this->Aro =& new AroTwoTest();
$this->Aro->Permission =& new PermissionTwoTest();
$this->Aco =& new AcoTwoTest();
$this->Aro->Permission =& new PermissionTwoTest();
}
}
/**
@ -200,7 +200,7 @@ class AclComponentTest extends CakeTestCase {
* @return void
*/
function startTest() {
$this->Acl = new AclComponent();
$this->Acl =& new AclComponent();
}
/**
* before method

View file

@ -445,7 +445,7 @@ class AuthTest extends CakeTestCase {
Configure::write('Acl.database', 'test_suite');
Configure::write('Acl.classname', 'DbAcl');
$this->Controller = new AuthTestController();
$this->Controller =& new AuthTestController();
$this->Controller->Component->init($this->Controller);
ClassRegistry::addObject('view', new View($this->Controller));
@ -509,7 +509,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testLogin() {
$this->AuthUser = new AuthUser();
$this->AuthUser =& new AuthUser();
$user['id'] = 1;
$user['username'] = 'mariano';
$user['password'] = Security::hash(Configure::read('Security.salt') . 'cake');
@ -580,7 +580,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testAuthorizeFalse() {
$this->AuthUser = new AuthUser();
$this->AuthUser =& new AuthUser();
$user = $this->AuthUser->find();
$this->Controller->Session->write('Auth', $user);
$this->Controller->Auth->userModel = 'AuthUser';
@ -605,7 +605,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testAuthorizeController() {
$this->AuthUser = new AuthUser();
$this->AuthUser =& new AuthUser();
$user = $this->AuthUser->find();
$this->Controller->Session->write('Auth', $user);
$this->Controller->Auth->userModel = 'AuthUser';
@ -628,7 +628,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testAuthorizeModel() {
$this->AuthUser = new AuthUser();
$this->AuthUser =& new AuthUser();
$user = $this->AuthUser->find();
$this->Controller->Session->write('Auth', $user);
@ -653,7 +653,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testAuthorizeCrud() {
$this->AuthUser = new AuthUser();
$this->AuthUser =& new AuthUser();
$user = $this->AuthUser->find();
$this->Controller->Session->write('Auth', $user);
@ -951,7 +951,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testEmptyUsernameOrPassword() {
$this->AuthUser = new AuthUser();
$this->AuthUser =& new AuthUser();
$user['id'] = 1;
$user['username'] = 'mariano';
$user['password'] = Security::hash(Configure::read('Security.salt') . 'cake');
@ -981,7 +981,7 @@ class AuthTest extends CakeTestCase {
* @return void
*/
function testInjection() {
$this->AuthUser = new AuthUser();
$this->AuthUser =& new AuthUser();
$this->AuthUser->id = 2;
$this->AuthUser->saveField('password', Security::hash(Configure::read('Security.salt') . 'cake'));
@ -1086,7 +1086,7 @@ class AuthTest extends CakeTestCase {
'argSeparator' => ':', 'namedArgs' => array()
)));
$this->AuthUser = new AuthUser();
$this->AuthUser =& new AuthUser();
$user = array(
'id' => 1, 'username' => 'felix',
'password' => Security::hash(Configure::read('Security.salt') . 'cake'
@ -1131,7 +1131,7 @@ class AuthTest extends CakeTestCase {
function testCustomField() {
Router::reload();
$this->AuthUserCustomField = new AuthUserCustomField();
$this->AuthUserCustomField =& new AuthUserCustomField();
$user = array(
'id' => 1, 'email' => 'harking@example.com',
'password' => Security::hash(Configure::read('Security.salt') . 'cake'
@ -1208,7 +1208,7 @@ class AuthTest extends CakeTestCase {
}
ob_start();
$Dispatcher = new Dispatcher();
$Dispatcher =& new Dispatcher();
$Dispatcher->dispatch('/ajax_auth/add', array('return' => 1));
$result = ob_get_clean();
$this->assertEqual("Ajax!\nthis is the test element", $result);

View file

@ -181,7 +181,7 @@ class EmailComponentTest extends CakeTestCase {
$this->_appEncoding = Configure::read('App.encoding');
Configure::write('App.encoding', 'UTF-8');
$this->Controller = new EmailTestController();
$this->Controller =& new EmailTestController();
restore_error_handler();
@$this->Controller->Component->init($this->Controller);
@ -470,7 +470,7 @@ TEXTBLOC;
$this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost');
$this->Controller->EmailTest->reset();
$socket = new CakeSocket(array_merge(array('protocol'=>'smtp'), $this->Controller->EmailTest->smtpOptions));
$socket =& new CakeSocket(array_merge(array('protocol'=>'smtp'), $this->Controller->EmailTest->smtpOptions));
$this->Controller->EmailTest->setConnectionSocket($socket);
$this->assertTrue($this->Controller->EmailTest->getConnectionSocket());

View file

@ -137,7 +137,7 @@ class SecurityComponentTest extends CakeTestCase {
* @return void
*/
function setUp() {
$this->Controller = new SecurityTestController();
$this->Controller =& new SecurityTestController();
$this->Controller->Component->init($this->Controller);
$this->Controller->Security =& $this->Controller->TestSecurity;
$this->Controller->Security->blackHoleCallback = 'fail';

View file

@ -107,20 +107,20 @@ class SessionComponentTest extends CakeTestCase {
*/
function testSessionAutoStart() {
Configure::write('Session.start', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->__active);
$this->assertFalse($Session->__started);
$Session->startup(new SessionTestController());
Configure::write('Session.start', true);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertTrue($Session->__active);
$this->assertFalse($Session->__started);
$Session->startup(new SessionTestController());
$this->assertTrue(isset($_SESSION));
$Object = new Object();
$Session = new SessionComponent();
$Session =& new SessionComponent();
$Session->start();
$expected = $Session->id();
@ -137,14 +137,14 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionInitialize() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertEqual($Session->__bare, 0);
$Session->initialize(new SessionTestController());
$this->assertEqual($Session->__bare, 0);
$sessionController = new SessionTestController();
$sessionController =& new SessionTestController();
$sessionController->params['bare'] = 1;
$Session->initialize($sessionController);
$this->assertEqual($Session->__bare, 1);
@ -156,14 +156,14 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionActivate() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertTrue($Session->__active);
$this->assertNull($Session->activate());
$this->assertTrue($Session->__active);
Configure::write('Session.start', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->__active);
$this->assertNull($Session->activate());
$this->assertTrue($Session->__active);
@ -177,7 +177,7 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionValid() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertTrue($Session->valid());
@ -185,17 +185,17 @@ class SessionComponentTest extends CakeTestCase {
$this->assertFalse($Session->valid());
Configure::write('Session.start', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->__active);
$this->assertFalse($Session->valid());
Configure::write('Session.start', true);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$Session->time = $Session->read('Config.time') + 1;
$this->assertFalse($Session->valid());
Configure::write('Session.checkAgent', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$Session->time = $Session->read('Config.time') + 1;
$this->assertFalse($Session->valid());
Configure::write('Session.checkAgent', true);
@ -207,12 +207,12 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionError() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->error());
Configure::write('Session.start', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->__active);
$this->assertFalse($Session->error());
Configure::write('Session.start', true);
@ -224,7 +224,7 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionReadWrite() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->read('Test'));
@ -251,7 +251,7 @@ class SessionComponentTest extends CakeTestCase {
$Session->del('Test');
Configure::write('Session.start', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->write('Test', 'some value'));
$Session->write('Test', 'some value');
$this->assertFalse($Session->read('Test'));
@ -264,7 +264,7 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionDel() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->del('Test'));
@ -272,7 +272,7 @@ class SessionComponentTest extends CakeTestCase {
$this->assertTrue($Session->del('Test'));
Configure::write('Session.start', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$Session->write('Test', 'some value');
$this->assertFalse($Session->del('Test'));
Configure::write('Session.start', true);
@ -284,7 +284,7 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionDelete() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->delete('Test'));
@ -292,7 +292,7 @@ class SessionComponentTest extends CakeTestCase {
$this->assertTrue($Session->delete('Test'));
Configure::write('Session.start', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$Session->write('Test', 'some value');
$this->assertFalse($Session->delete('Test'));
Configure::write('Session.start', true);
@ -304,7 +304,7 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionCheck() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertFalse($Session->check('Test'));
@ -313,7 +313,7 @@ class SessionComponentTest extends CakeTestCase {
$Session->delete('Test');
Configure::write('Session.start', false);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$Session->write('Test', 'some value');
$this->assertFalse($Session->check('Test'));
Configure::write('Session.start', true);
@ -325,7 +325,7 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionFlash() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertNull($Session->read('Message.flash'));
@ -351,7 +351,7 @@ class SessionComponentTest extends CakeTestCase {
*/
function testSessionId() {
unset($_SESSION);
$Session = new SessionComponent();
$Session =& new SessionComponent();
$this->assertNull($Session->id());
}
/**
@ -361,7 +361,7 @@ class SessionComponentTest extends CakeTestCase {
* @return void
*/
function testSessionDestroy() {
$Session = new SessionComponent();
$Session =& new SessionComponent();
$Session->write('Test', 'some value');
$this->assertEqual($Session->read('Test'), 'some value');

View file

@ -328,7 +328,7 @@ class TestController extends AppController {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class TestComponent extends CakeObject {
class TestComponent extends Object {
/**
* beforeRedirect method
*
@ -380,7 +380,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testConstructClasses() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->modelClass = 'ControllerPost';
$Controller->passedArgs[] = '1';
$Controller->constructClasses();
@ -388,7 +388,7 @@ class ControllerTest extends CakeTestCase {
unset($Controller);
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('ControllerPost', 'ControllerComment');
$Controller->passedArgs[] = '1';
$Controller->constructClasses();
@ -404,7 +404,7 @@ class ControllerTest extends CakeTestCase {
);
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS));
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('TestPlugin.TestPluginPost');
$Controller->constructClasses();
@ -422,7 +422,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testAliasName() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('NameTest');
$Controller->constructClasses();
@ -439,7 +439,7 @@ class ControllerTest extends CakeTestCase {
*/
function testPersistent() {
Configure::write('Cache.disable', false);
$Controller = new Controller();
$Controller =& new Controller();
$Controller->modelClass = 'ControllerPost';
$Controller->persistModel = true;
$Controller->constructClasses();
@ -458,7 +458,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testPaginate() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('ControllerPost', 'ControllerComment');
$Controller->passedArgs[] = '1';
$Controller->params['url'] = array();
@ -519,7 +519,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testPaginateExtraParams() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('ControllerPost', 'ControllerComment');
$Controller->passedArgs[] = '1';
$Controller->params['url'] = array();
@ -551,7 +551,7 @@ class ControllerTest extends CakeTestCase {
$this->assertEqual($Controller->ControllerPost->lastQuery['limit'], 12);
$this->assertEqual($paging['options']['limit'], 12);
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('ControllerPaginateModel');
$Controller->params['url'] = array();
$Controller->constructClasses();
@ -578,7 +578,7 @@ class ControllerTest extends CakeTestCase {
* @access public
*/
function testPaginatePassedArgs() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('ControllerPost');
$Controller->passedArgs[] = array('1', '2', '3');
$Controller->params['url'] = array();
@ -610,7 +610,7 @@ class ControllerTest extends CakeTestCase {
* @return void
**/
function testPaginateSpecialType() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('ControllerPost', 'ControllerComment');
$Controller->passedArgs[] = '1';
$Controller->params['url'] = array();
@ -631,7 +631,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testDefaultPaginateParams() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->modelClass = 'ControllerPost';
$Controller->params['url'] = array();
$Controller->paginate = array('order' => 'ControllerPost.id DESC');
@ -648,7 +648,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testFlash() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->flash('this should work', '/flash');
$result = $Controller->output;
@ -678,7 +678,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testControllerSet() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->set('variable_with_underscores', null);
$this->assertTrue(array_key_exists('variable_with_underscores', $Controller->viewVars));
@ -713,7 +713,7 @@ class ControllerTest extends CakeTestCase {
function testRender() {
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS));
$Controller = new Controller();
$Controller =& new Controller();
$Controller->viewPath = 'posts';
$result = $Controller->render('index');
@ -744,7 +744,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testToBeInheritedGuardmethods() {
$Controller = new Controller();
$Controller =& new Controller();
$this->assertTrue($Controller->_beforeScaffold(''));
$this->assertTrue($Controller->_afterScaffoldSave(''));
$this->assertTrue($Controller->_afterScaffoldSaveError(''));
@ -806,8 +806,8 @@ class ControllerTest extends CakeTestCase {
App::import('Helper', 'Cache');
foreach ($codes as $code => $msg) {
$MockController = new MockController();
$MockController->Component = new Component();
$MockController =& new MockController();
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->expectAt(0, 'header', array("HTTP/1.1 {$code} {$msg}"));
$MockController->expectAt(1, 'header', array('Location: http://cakephp.org'));
@ -816,8 +816,8 @@ class ControllerTest extends CakeTestCase {
$this->assertFalse($MockController->autoRender);
}
foreach ($codes as $code => $msg) {
$MockController = new MockController();
$MockController->Component = new Component();
$MockController =& new MockController();
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->expectAt(0, 'header', array("HTTP/1.1 {$code} {$msg}"));
$MockController->expectAt(1, 'header', array('Location: http://cakephp.org'));
@ -826,24 +826,24 @@ class ControllerTest extends CakeTestCase {
$this->assertFalse($MockController->autoRender);
}
$MockController = new MockController();
$MockController->Component = new Component();
$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 =& 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 =& new MockController();
$MockController->components = array('MockTest');
$MockController->Component = new Component();
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', null);
$MockController->expectAt(0, 'header', array('HTTP/1.1 301 Moved Permanently'));
@ -851,9 +851,9 @@ class ControllerTest extends CakeTestCase {
$MockController->expectCallCount('header', 2);
$MockController->redirect('http://cakephp.org', 301, false);
$MockController = new MockController();
$MockController =& new MockController();
$MockController->components = array('MockTest');
$MockController->Component = new Component();
$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'));
@ -861,17 +861,17 @@ class ControllerTest extends CakeTestCase {
$MockController->expectCallCount('header', 2);
$MockController->redirect('http://cakephp.org', 301, false);
$MockController = new MockController();
$MockController =& new MockController();
$MockController->components = array('MockTest');
$MockController->Component = new Component();
$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 =& new MockController();
$MockController->components = array('MockTest', 'MockTestB');
$MockController->Component = new Component();
$MockController->Component =& new Component();
$MockController->Component->init($MockController);
$MockController->MockTest->setReturnValue('beforeRedirect', 'http://book.cakephp.org');
$MockController->MockTestB->setReturnValue('beforeRedirect', 'http://bakery.cakephp.org');
@ -891,7 +891,7 @@ class ControllerTest extends CakeTestCase {
return;
}
$TestController = new TestController();
$TestController =& new TestController();
$TestController->constructClasses();
$testVars = get_class_vars('TestController');
@ -914,7 +914,7 @@ class ControllerTest extends CakeTestCase {
$this->assertEqual(count(array_diff($TestController->uses, $uses)), 0);
$this->assertEqual(count(array_diff_assoc(Set::normalize($TestController->components), Set::normalize($components))), 0);
$TestController = new AnotherTestController();
$TestController =& new AnotherTestController();
$TestController->constructClasses();
$appVars = get_class_vars('AppController');
@ -927,7 +927,7 @@ class ControllerTest extends CakeTestCase {
$this->assertFalse(isset($TestController->ControllerPost));
$TestController = new ControllerCommentsController();
$TestController =& new ControllerCommentsController();
$TestController->constructClasses();
$appVars = get_class_vars('AppController');
@ -950,7 +950,7 @@ class ControllerTest extends CakeTestCase {
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
return;
}
$TestController = new TestController();
$TestController =& new TestController();
$expected = array('foo');
$TestController->components = array('Cookie' => $expected);
$TestController->constructClasses();
@ -963,7 +963,7 @@ class ControllerTest extends CakeTestCase {
* @return void
**/
function testMergeVarsNotGreedy() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->components = array();
$Controller->uses = array();
$Controller->constructClasses();
@ -977,7 +977,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testReferer() {
$Controller = new Controller();
$Controller =& new Controller();
$_SERVER['HTTP_REFERER'] = 'http://cakephp.org';
$result = $Controller->referer(null, false);
$expected = 'http://cakephp.org';
@ -1023,7 +1023,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testSetAction() {
$TestController = new TestController();
$TestController =& new TestController();
$TestController->setAction('index', 1, 2);
$expected = array('testId' => 1, 'test2Id' => 2);
$this->assertidentical($TestController->data, $expected);
@ -1035,7 +1035,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testUnimplementedIsAuthorized() {
$TestController = new TestController();
$TestController =& new TestController();
$TestController->isAuthorized();
$this->assertError();
}
@ -1046,7 +1046,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testValidateErrors() {
$TestController = new TestController();
$TestController =& new TestController();
$TestController->constructClasses();
$this->assertFalse($TestController->validateErrors());
$this->assertEqual($TestController->validate(), 0);
@ -1067,7 +1067,7 @@ class ControllerTest extends CakeTestCase {
* @return void
*/
function testPostConditions() {
$Controller = new Controller();
$Controller =& new Controller();
$data = array(
@ -1132,7 +1132,7 @@ class ControllerTest extends CakeTestCase {
*/
function testRequestHandlerPrefers(){
Configure::write('debug', 2);
$Controller = new Controller();
$Controller =& new Controller();
$Controller->components = array("RequestHandler");
$Controller->modelClass='ControllerPost';
$Controller->params['url']['ext'] = 'rss';

View file

@ -53,7 +53,7 @@ if (!class_exists('AppController')) {
*
* @package cake.tests.cases.libs.controller
**/
class MergeVarComponent extends CakeObject {
class MergeVarComponent extends Object {
}
@ -139,7 +139,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* @return void
**/
function testComponentParamMergingNoDuplication() {
$Controller = new MergeVariablesController();
$Controller =& new MergeVariablesController();
$Controller->constructClasses();
$expected = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false));
@ -151,7 +151,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* @return void
**/
function testComponentMergingWithRedeclarations() {
$Controller = new MergeVariablesController();
$Controller =& new MergeVariablesController();
$Controller->components['MergeVar'] = array('remote', 'redirect' => true);
$Controller->constructClasses();
@ -164,7 +164,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* @return void
**/
function testHelperSettingMergingNoDuplication() {
$Controller = new MergeVariablesController();
$Controller =& new MergeVariablesController();
$Controller->constructClasses();
$expected = array('MergeVar' => array('format' => 'html', 'terse'));
@ -176,7 +176,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* @return void
**/
function testMergeVarsWithPlugin() {
$Controller = new MergePostsController();
$Controller =& new MergePostsController();
$Controller->components = array('Email' => array('ports' => 'open'));
$Controller->plugin = 'MergeVarPlugin';
$Controller->constructClasses();
@ -194,7 +194,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
);
$this->assertEqual($Controller->helpers, $expected, 'Helpers are unexpected %s');
$Controller = new MergePostsController();
$Controller =& new MergePostsController();
$Controller->components = array();
$Controller->plugin = 'MergeVarPlugin';
$Controller->constructClasses();
@ -212,7 +212,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* @return void
**/
function testMergeVarsNotGreedy() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->components = array();
$Controller->uses = array();
$Controller->constructClasses();

View file

@ -67,7 +67,7 @@ class PagesControllerTest extends CakeTestCase {
}
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS));
$Pages = new PagesController();
$Pages =& new PagesController();
$Pages->viewPath = 'posts';
$Pages->display('index');

View file

@ -262,7 +262,7 @@ class ScaffoldViewTest extends CakeTestCase {
* @return void
*/
function startTest() {
$this->Controller = new ScaffoldMockController();
$this->Controller =& new ScaffoldMockController();
}
/**
* endTest method
@ -284,7 +284,7 @@ class ScaffoldViewTest extends CakeTestCase {
Configure::write('Routing.admin', 'admin');
$this->Controller->action = 'index';
$ScaffoldView = new TestScaffoldView($this->Controller);
$ScaffoldView =& new TestScaffoldView($this->Controller);
$result = $ScaffoldView->testGetFilename('index');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp';
$this->assertEqual($result, $expected);
@ -328,11 +328,11 @@ class ScaffoldViewTest extends CakeTestCase {
Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS));
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS));
$Controller = new ScaffoldMockController();
$Controller =& new ScaffoldMockController();
$Controller->scaffold = 'admin';
$Controller->viewPath = 'posts';
$Controller->action = 'admin_edit';
$ScaffoldView = new TestScaffoldView($Controller);
$ScaffoldView =& new TestScaffoldView($Controller);
$result = $ScaffoldView->testGetFilename('admin_edit');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.edit.ctp';
$this->assertEqual($result, $expected);
@ -341,12 +341,12 @@ class ScaffoldViewTest extends CakeTestCase {
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.edit.ctp';
$this->assertEqual($result, $expected);
$Controller = new ScaffoldMockController();
$Controller =& new ScaffoldMockController();
$Controller->scaffold = 'admin';
$Controller->viewPath = 'tests';
$Controller->plugin = 'test_plugin';
$Controller->action = 'admin_add';
$ScaffoldView = new TestScaffoldView($Controller);
$ScaffoldView =& new TestScaffoldView($Controller);
$result = $ScaffoldView->testGetFilename('admin_add');
$expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'
. DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.edit.ctp';
@ -595,7 +595,7 @@ class ScaffoldTest extends CakeTestCase {
* @return void
*/
function startTest() {
$this->Controller = new ScaffoldMockController();
$this->Controller =& new ScaffoldMockController();
}
/**
* endTest method
@ -634,7 +634,7 @@ class ScaffoldTest extends CakeTestCase {
$this->Controller->controller = 'scaffold_mock';
$this->Controller->base = '/';
$this->Controller->constructClasses();
$Scaffold = new TestScaffoldMock($this->Controller, $params);
$Scaffold =& new TestScaffoldMock($this->Controller, $params);
$result = $Scaffold->getParams();
$this->assertEqual($result['action'], 'admin_edit');
}
@ -664,7 +664,7 @@ class ScaffoldTest extends CakeTestCase {
$this->Controller->controller = 'scaffold_mock';
$this->Controller->base = '/';
$this->Controller->constructClasses();
$Scaffold = new TestScaffoldMock($this->Controller, $params);
$Scaffold =& new TestScaffoldMock($this->Controller, $params);
$result = $Scaffold->controller->viewVars;
$this->assertEqual($result['singularHumanName'], 'Scaffold Mock');

View file

@ -36,7 +36,7 @@ if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
* @package cake
* @subpackage cake.tests.cases.libs
*/
class BlueberryComponent extends CakeObject {
class BlueberryComponent extends Object {
/**
* testName property
*
@ -261,7 +261,7 @@ class ErrorHandlerTest extends CakeTestCase {
$this->assertPattern("/<strong>'\/test_error'<\/strong>/", $result);
ob_start();
$TestErrorHandler = new TestErrorHandler('error404', array('message' => 'Page not found'));
$TestErrorHandler =& new TestErrorHandler('error404', array('message' => 'Page not found'));
ob_get_clean();
ob_start();
$TestErrorHandler->error404(array(

View file

@ -47,7 +47,7 @@ class FileTest extends CakeTestCase {
*/
function testBasic() {
$file = __FILE__;
$this->File = new File($file);
$this->File =& new File($file);
$result = $this->File->pwd();
$expecting = $file;
@ -209,7 +209,7 @@ class FileTest extends CakeTestCase {
*/
function testCreate() {
$tmpFile = TMP.'tests'.DS.'cakephp.file.test.tmp';
$File = new File($tmpFile, true, 0777);
$File =& new File($tmpFile, true, 0777);
$this->assertTrue($File->exists());
}
/**
@ -219,7 +219,7 @@ class FileTest extends CakeTestCase {
* @return void
*/
function testOpeningNonExistantFileCreatesIt() {
$someFile = new File(TMP . 'some_file.txt', false);
$someFile =& new File(TMP . 'some_file.txt', false);
$this->assertTrue($someFile->open());
$this->assertEqual($someFile->read(), '');
$someFile->close();
@ -252,7 +252,7 @@ class FileTest extends CakeTestCase {
* @return void
*/
function testReadable() {
$someFile = new File(TMP . 'some_file.txt', false);
$someFile =& new File(TMP . 'some_file.txt', false);
$this->assertTrue($someFile->open());
$this->assertTrue($someFile->readable());
$someFile->close();
@ -265,7 +265,7 @@ class FileTest extends CakeTestCase {
* @return void
*/
function testWritable() {
$someFile = new File(TMP . 'some_file.txt', false);
$someFile =& new File(TMP . 'some_file.txt', false);
$this->assertTrue($someFile->open());
$this->assertTrue($someFile->writable());
$someFile->close();
@ -278,7 +278,7 @@ class FileTest extends CakeTestCase {
* @return void
*/
function testExecutable() {
$someFile = new File(TMP . 'some_file.txt', false);
$someFile =& new File(TMP . 'some_file.txt', false);
$this->assertTrue($someFile->open());
$this->assertFalse($someFile->executable());
$someFile->close();
@ -291,7 +291,7 @@ class FileTest extends CakeTestCase {
* @return void
*/
function testLastAccess() {
$someFile = new File(TMP . 'some_file.txt', false);
$someFile =& new File(TMP . 'some_file.txt', false);
$this->assertFalse($someFile->lastAccess());
$this->assertTrue($someFile->open());
$this->assertEqual($someFile->lastAccess(), time());
@ -305,7 +305,7 @@ class FileTest extends CakeTestCase {
* @return void
*/
function testLastChange() {
$someFile = new File(TMP . 'some_file.txt', false);
$someFile =& new File(TMP . 'some_file.txt', false);
$this->assertFalse($someFile->lastChange());
$this->assertTrue($someFile->open('r+'));
$this->assertEqual($someFile->lastChange(), time());
@ -328,7 +328,7 @@ class FileTest extends CakeTestCase {
unlink($tmpFile);
}
$TmpFile = new File($tmpFile);
$TmpFile =& new File($tmpFile);
$this->assertFalse(file_exists($tmpFile));
$this->assertFalse(is_resource($TmpFile->handle));
@ -358,7 +358,7 @@ class FileTest extends CakeTestCase {
unlink($tmpFile);
}
$TmpFile = new File($tmpFile);
$TmpFile =& new File($tmpFile);
$this->assertFalse(file_exists($tmpFile));
$fragments = array('CakePHP\'s', ' test suite', ' was here ...', '');
@ -386,13 +386,13 @@ class FileTest extends CakeTestCase {
if (!file_exists($tmpFile)) {
touch($tmpFile);
}
$TmpFile = new File($tmpFile);
$TmpFile =& new File($tmpFile);
$this->assertTrue(file_exists($tmpFile));
$result = $TmpFile->delete();
$this->assertTrue($result);
$this->assertFalse(file_exists($tmpFile));
$TmpFile = new File('/this/does/not/exist');
$TmpFile =& new File('/this/does/not/exist');
$result = $TmpFile->delete();
$this->assertFalse($result);
}

View file

@ -40,7 +40,7 @@ class FolderTest extends CakeTestCase {
*/
function testBasic() {
$path = dirname(__FILE__);
$Folder = new Folder($path);
$Folder =& new Folder($path);
$result = $Folder->pwd();
$this->assertEqual($result, $path);
@ -66,7 +66,7 @@ class FolderTest extends CakeTestCase {
$path = dirname(dirname(__FILE__));
$inside = dirname($path) . DS;
$Folder = new Folder($path);
$Folder =& new Folder($path);
$result = $Folder->pwd();
$this->assertEqual($result, $path);
@ -91,7 +91,7 @@ class FolderTest extends CakeTestCase {
*/
function testOperations() {
$path = TEST_CAKE_CORE_INCLUDE_PATH . 'console' . DS . 'libs' . DS . 'templates' . DS . 'skel';
$Folder = new Folder($path);
$Folder =& new Folder($path);
$result = is_dir($Folder->pwd());
$this->assertTrue($result);
@ -150,7 +150,7 @@ class FolderTest extends CakeTestCase {
$result = $Folder->delete();
$this->assertTrue($result);
$Folder = new Folder('non-existent');
$Folder =& new Folder('non-existent');
$result = $Folder->pwd();
$this->assertNull($result);
}
@ -164,7 +164,7 @@ class FolderTest extends CakeTestCase {
$this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Folder permissions tests not supported on Windows');
$path = TEST_CAKE_CORE_INCLUDE_PATH . 'console' . DS . 'libs' . DS . 'templates' . DS . 'skel';
$Folder = new Folder($path);
$Folder =& new Folder($path);
$subdir = 'test_folder_new';
$new = TMP . $subdir;
@ -174,7 +174,7 @@ class FolderTest extends CakeTestCase {
$this->assertTrue($Folder->create($new . DS . 'test2'));
$filePath = $new . DS . 'test1.php';
$File = new File($filePath);
$File =& new File($filePath);
$this->assertTrue($File->create());
$copy = TMP . 'test_folder_copy';
@ -200,7 +200,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testZeroAsDirectory() {
$Folder = new Folder(TMP);
$Folder =& new Folder(TMP);
$new = TMP . '0';
$this->assertTrue($Folder->create($new));
@ -222,7 +222,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testFolderRead() {
$Folder = new Folder(TMP);
$Folder =& new Folder(TMP);
$expected = array('cache', 'logs', 'sessions', 'tests');
$result = $Folder->read(true, true);
@ -240,7 +240,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testFolderTree() {
$Folder = new Folder();
$Folder =& new Folder();
$expected = array(
array(
TEST_CAKE_CORE_INCLUDE_PATH . 'config',
@ -380,7 +380,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testInCakePath() {
$Folder = new Folder();
$Folder =& new Folder();
$Folder->cd(ROOT);
$path = 'C:\\path\\to\\file';
$result = $Folder->inCakePath($path);
@ -404,7 +404,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testFind() {
$Folder = new Folder();
$Folder =& new Folder();
$Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH . 'config');
$result = $Folder->find();
$expected = array('config.php', 'paths.php');
@ -456,7 +456,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testFindRecursive() {
$Folder = new Folder();
$Folder =& new Folder();
$Folder->cd(TEST_CAKE_CORE_INCLUDE_PATH);
$result = $Folder->findRecursive('(config|paths)\.php');
$expected = array(
@ -476,7 +476,7 @@ class FolderTest extends CakeTestCase {
$Folder->cd(TMP);
$Folder->mkdir($Folder->pwd() . DS . 'testme');
$Folder->cd('testme');
$File = new File($Folder->pwd() . DS . 'paths.php');
$File =& new File($Folder->pwd() . DS . 'paths.php');
$File->create();
$Folder->cd(TMP . 'sessions');
$result = $Folder->findRecursive('paths\.php');
@ -484,7 +484,7 @@ class FolderTest extends CakeTestCase {
$this->assertIdentical($result, $expected);
$Folder->cd(TMP . 'testme');
$File = new File($Folder->pwd() . DS . 'my.php');
$File =& new File($Folder->pwd() . DS . 'my.php');
$File->create();
$Folder->cd($Folder->pwd() . '/../..');
@ -515,7 +515,7 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testConstructWithNonExistantPath() {
$Folder = new Folder(TMP . 'config_non_existant', true);
$Folder =& new Folder(TMP . 'config_non_existant', true);
$this->assertTrue(is_dir(TMP . 'config_non_existant'));
$Folder->cd(TMP);
$Folder->delete($Folder->pwd() . 'config_non_existant');
@ -527,10 +527,10 @@ class FolderTest extends CakeTestCase {
* @return void
*/
function testDirSize() {
$Folder = new Folder(TMP . 'config_non_existant', true);
$Folder =& new Folder(TMP . 'config_non_existant', true);
$this->assertEqual($Folder->dirSize(), 0);
$File = new File($Folder->pwd() . DS . 'my.php', true, 0777);
$File =& new File($Folder->pwd() . DS . 'my.php', true, 0777);
$File->create();
$File->write('something here');
$File->close();
@ -547,7 +547,7 @@ class FolderTest extends CakeTestCase {
*/
function testDelete() {
$path = TMP . 'folder_delete_test';
$Folder = new Folder($path, true);
$Folder =& new Folder($path, true);
touch(TMP . 'folder_delete_test' . DS . 'file1');
touch(TMP . 'folder_delete_test' . DS . 'file2');
@ -593,35 +593,35 @@ class FolderTest extends CakeTestCase {
touch($file1);
touch($file2);
$Folder = new Folder($folder1);
$Folder =& new Folder($folder1);
$result = $Folder->copy($folder3);
$this->assertTrue($result);
$this->assertTrue(file_exists($folder3 . DS . 'file1.php'));
$this->assertTrue(file_exists($folder3 . DS . 'folder2' . DS . 'file2.php'));
$Folder = new Folder($folder3);
$Folder =& new Folder($folder3);
$Folder->delete();
$Folder = new Folder($folder1);
$Folder =& new Folder($folder1);
$result = $Folder->copy($folder3);
$this->assertTrue($result);
$this->assertTrue(file_exists($folder3 . DS . 'file1.php'));
$this->assertTrue(file_exists($folder3 . DS . 'folder2' . DS . 'file2.php'));
$Folder = new Folder($folder3);
$Folder =& new Folder($folder3);
$Folder->delete();
new Folder($folder3, true);
new Folder($folder3 . DS . 'folder2', true);
file_put_contents($folder3 . DS . 'folder2' . DS . 'file2.php', 'untouched');
$Folder = new Folder($folder1);
$Folder =& new Folder($folder1);
$result = $Folder->copy($folder3);
$this->assertTrue($result);
$this->assertTrue(file_exists($folder3 . DS . 'file1.php'));
$this->assertEqual(file_get_contents($folder3 . DS . 'folder2' . DS . 'file2.php'), 'untouched');
$Folder = new Folder($path);
$Folder =& new Folder($path);
$Folder->delete();
}
/**
@ -651,7 +651,7 @@ class FolderTest extends CakeTestCase {
touch($file1);
touch($file2);
$Folder = new Folder($folder1);
$Folder =& new Folder($folder1);
$result = $Folder->move($folder3);
$this->assertTrue($result);
$this->assertTrue(file_exists($folder3 . DS . 'file1.php'));
@ -661,7 +661,7 @@ class FolderTest extends CakeTestCase {
$this->assertFalse(file_exists($folder2));
$this->assertFalse(file_exists($file2));
$Folder = new Folder($folder3);
$Folder =& new Folder($folder3);
$Folder->delete();
new Folder($folder1, true);
@ -669,7 +669,7 @@ class FolderTest extends CakeTestCase {
touch($file1);
touch($file2);
$Folder = new Folder($folder1);
$Folder =& new Folder($folder1);
$result = $Folder->move($folder3);
$this->assertTrue($result);
$this->assertTrue(file_exists($folder3 . DS . 'file1.php'));
@ -679,7 +679,7 @@ class FolderTest extends CakeTestCase {
$this->assertFalse(file_exists($folder2));
$this->assertFalse(file_exists($file2));
$Folder = new Folder($folder3);
$Folder =& new Folder($folder3);
$Folder->delete();
new Folder($folder1, true);
@ -690,7 +690,7 @@ class FolderTest extends CakeTestCase {
touch($file2);
file_put_contents($folder3 . DS . 'folder2' . DS . 'file2.php', 'untouched');
$Folder = new Folder($folder1);
$Folder =& new Folder($folder1);
$result = $Folder->move($folder3);
$this->assertTrue($result);
$this->assertTrue(file_exists($folder3 . DS . 'file1.php'));
@ -699,7 +699,7 @@ class FolderTest extends CakeTestCase {
$this->assertFalse(file_exists($folder2));
$this->assertFalse(file_exists($file2));
$Folder = new Folder($path);
$Folder =& new Folder($path);
$Folder->delete();
}
}

View file

@ -58,8 +58,8 @@ class HttpSocketTest extends CakeTestCase {
Mock::generatePartial('HttpSocket', 'TestHttpSocketRequests', array('read', 'write', 'connect', 'request'));
}
$this->Socket = new TestHttpSocket();
$this->RequestSocket = new TestHttpSocketRequests();
$this->Socket =& new TestHttpSocket();
$this->RequestSocket =& new TestHttpSocketRequests();
}
/**
* We use this function to clean up after the test case was executed

View file

@ -39,7 +39,7 @@ class L10nTest extends CakeTestCase {
* @return void
*/
function testGet() {
$l10n = new L10n();
$l10n =& new L10n();
// Catalog Entry
$l10n->get('en');
@ -124,7 +124,7 @@ class L10nTest extends CakeTestCase {
$__SERVER = $_SERVER;
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'inexistent,en-ca';
$l10n = new L10n();
$l10n =& new L10n();
$l10n->get();
$result = $l10n->language;
$expected = 'English (Canadian)';
@ -175,7 +175,7 @@ class L10nTest extends CakeTestCase {
* @return void
*/
function testMap() {
$l10n = new L10n();
$l10n =& new L10n();
$result = $l10n->map(array('afr', 'af'));
$expected = array('afr' => 'af', 'af' => 'afr');
@ -496,7 +496,7 @@ class L10nTest extends CakeTestCase {
* @return void
*/
function testCatalog() {
$l10n = new L10n();
$l10n =& new L10n();
$result = $l10n->catalog(array('af'));
$expected = array(

View file

@ -43,7 +43,7 @@ class MagicDbTest extends UnitTestCase {
* @access public
*/
function setUp() {
$this->Db = new MagicDb();
$this->Db =& new MagicDb();
}
/**
* MagicDb::analyze should properly detect the file type and output additional info as requested.
@ -158,7 +158,7 @@ class MagicDbTest extends UnitTestCase {
* @package cake
* @subpackage cake.tests.cases.libs
*/
class MagicDbTestData extends CakeObject {
class MagicDbTestData extends Object {
/**
* Base64 encoded data
*

View file

@ -983,7 +983,7 @@ class BehaviorTest extends CakeTestCase {
* @return void
*/
function testBehaviorTrigger() {
$Apple = new Apple();
$Apple =& new Apple();
$Apple->Behaviors->attach('Test');
$Apple->Behaviors->attach('Test2');
$Apple->Behaviors->attach('Test3');
@ -1057,7 +1057,7 @@ class BehaviorTest extends CakeTestCase {
* @return void
**/
function testBehaviorAttachAndDetach() {
$Sample = new Sample();
$Sample =& new Sample();
$Sample->actsAs = array('Test3' => array('bar'), 'Test2' => array('foo', 'bar'));
$Sample->Behaviors->init($Sample->alias, $Sample->actsAs);
$Sample->Behaviors->attach('Test2');

View file

@ -210,8 +210,8 @@ class AclBehaviorTestCase extends CakeTestCase {
function startTest() {
Configure::write('Acl.database', 'test_suite');
$this->Aco = new Aco();
$this->Aro = new Aro();
$this->Aco =& new Aco();
$this->Aro =& new Aro();
}
/**
* tearDown method
@ -230,12 +230,12 @@ class AclBehaviorTestCase extends CakeTestCase {
* @access public
*/
function testSetup() {
$User = new AclUser();
$User =& new AclUser();
$this->assertTrue(isset($User->Behaviors->Acl->settings['User']));
$this->assertEqual($User->Behaviors->Acl->settings['User']['type'], 'requester');
$this->assertTrue(is_object($User->Aro));
$Post = new AclPost();
$Post =& new AclPost();
$this->assertTrue(isset($Post->Behaviors->Acl->settings['Post']));
$this->assertEqual($Post->Behaviors->Acl->settings['Post']['type'], 'controlled');
$this->assertTrue(is_object($Post->Aco));
@ -247,7 +247,7 @@ class AclBehaviorTestCase extends CakeTestCase {
* @access public
*/
function testAfterSave() {
$Post = new AclPost();
$Post =& new AclPost();
$data = array(
'Post' => array(
'author_id' => 1,
@ -271,7 +271,7 @@ class AclBehaviorTestCase extends CakeTestCase {
);
$this->Aro->save($aroData);
$Person = new AclPerson();
$Person =& new AclPerson();
$data = array(
'AclPerson' => array(
'name' => 'Trent',
@ -304,7 +304,7 @@ class AclBehaviorTestCase extends CakeTestCase {
)
);
$this->Aro->save($aroData);
$Person = new AclPerson();
$Person =& new AclPerson();
$data = array(
'AclPerson' => array(
'name' => 'Trent',
@ -349,7 +349,7 @@ class AclBehaviorTestCase extends CakeTestCase {
* @access public
*/
function testNode() {
$Person = new AclPerson();
$Person =& new AclPerson();
$aroData = array(
'Aro' => array(
'model' => 'AclPerson',

View file

@ -3123,7 +3123,7 @@ class ContainableBehaviorTest extends CakeTestCase {
* @return void
*/
function testPaginate() {
$Controller = new Controller();
$Controller =& new Controller();
$Controller->uses = array('Article');
$Controller->passedArgs[] = '1';
$Controller->params['url'] = array();

View file

@ -70,22 +70,22 @@ class TranslateBehaviorTest extends CakeTestCase {
* @return void
*/
function testTranslateModel() {
$TestModel = new Tag();
$TestModel =& new Tag();
$TestModel->translateTable = 'another_i18n';
$TestModel->Behaviors->attach('Translate', array('title'));
$this->assertEqual($TestModel->translateModel()->name, 'I18nModel');
$this->assertEqual($TestModel->translateModel()->useTable, 'another_i18n');
$TestModel = new User();
$TestModel =& new User();
$TestModel->Behaviors->attach('Translate', array('title'));
$this->assertEqual($TestModel->translateModel()->name, 'I18nModel');
$this->assertEqual($TestModel->translateModel()->useTable, 'i18n');
$TestModel = new TranslatedArticle();
$TestModel =& new TranslatedArticle();
$this->assertEqual($TestModel->translateModel()->name, 'TranslateArticleModel');
$this->assertEqual($TestModel->translateModel()->useTable, 'article_i18n');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$this->assertEqual($TestModel->translateModel()->name, 'TranslateTestModel');
$this->assertEqual($TestModel->translateModel()->useTable, 'i18n');
}
@ -98,7 +98,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testLocaleFalsePlain() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = false;
$result = $TestModel->read(null, 1);
@ -122,7 +122,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testLocaleFalseAssociations() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = false;
$TestModel->unbindTranslation();
$translations = array('title' => 'Title', 'content' => 'Content');
@ -176,7 +176,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testLocaleSingle() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'eng';
$result = $TestModel->read(null, 1);
$expected = array(
@ -231,7 +231,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testLocaleSingleWithConditions() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'eng';
$result = $TestModel->find('all', array('conditions' => array('slug' => 'first_translated')));
$expected = array(
@ -270,7 +270,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testLocaleSingleAssociations() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'eng';
$TestModel->unbindTranslation();
$translations = array('title' => 'Title', 'content' => 'Content');
@ -330,7 +330,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testLocaleMultiple() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = array('deu', 'eng', 'cze');
$delete = array(
array('locale' => 'deu'),
@ -393,7 +393,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testMissingTranslation() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'rus';
$result = $TestModel->read(null, 1);
$this->assertFalse($result);
@ -420,7 +420,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testTranslatedFindList() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'deu';
$TestModel->displayField = 'title';
$result = $TestModel->find('list', array('recursive' => 1));
@ -453,7 +453,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testReadSelectedFields() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'eng';
$result = $TestModel->find('all', array('fields' => array('slug', 'TranslatedItem.content')));
$expected = array(
@ -488,7 +488,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testSaveCreate() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'spa';
$data = array('slug' => 'fourth_translated', 'title' => 'Leyenda #4', 'content' => 'Contenido #4');
$TestModel->create($data);
@ -506,7 +506,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testSaveUpdate() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'spa';
$oldData = array('slug' => 'fourth_translated', 'title' => 'Leyenda #4');
$TestModel->create($oldData);
@ -528,7 +528,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testMultipleCreate() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'deu';
$data = array(
'slug' => 'new_translated',
@ -566,7 +566,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testMultipleUpdate() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'eng';
$TestModel->validate['title'] = 'notEmpty';
$data = array('TranslatedItem' => array(
@ -608,7 +608,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testMixedCreateUpdateWithArrayLocale() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = array('cze', 'deu');
$data = array('TranslatedItem' => array(
'id' => 1,
@ -647,7 +647,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testValidation() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$TestModel->locale = 'eng';
$TestModel->validate['title'] = '/Only this title/';
$data = array('TranslatedItem' => array(
@ -678,7 +678,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testAttachDetach() {
$this->loadFixtures('Translate', 'TranslatedItem');
$TestModel = new TranslatedItem();
$TestModel =& new TranslatedItem();
$Behavior =& $this->Model->Behaviors->Translate;
$TestModel->unbindTranslation();
@ -728,7 +728,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testAnotherTranslateTable() {
$this->loadFixtures('Translate', 'TranslatedItem', 'TranslateTable');
$TestModel = new TranslatedItemWithTable();
$TestModel =& new TranslatedItemWithTable();
$TestModel->locale = 'eng';
$result = $TestModel->read(null, 1);
$expected = array(
@ -751,7 +751,7 @@ class TranslateBehaviorTest extends CakeTestCase {
function testTranslateWithAssociations() {
$this->loadFixtures('TranslateArticle', 'TranslatedArticle', 'User', 'Comment', 'ArticlesTag', 'Tag');
$TestModel = new TranslatedArticle();
$TestModel =& new TranslatedArticle();
$TestModel->locale = 'eng';
$recursive = $TestModel->recursive;

View file

@ -60,7 +60,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testInitialize() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$result = $this->Tree->find('count');
@ -77,7 +77,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testDetectInvalidLeft() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$result = $this->Tree->findByName('1.1');
@ -103,7 +103,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testDetectInvalidRight() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$result = $this->Tree->findByName('1.1');
@ -129,7 +129,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testDetectInvalidParent() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$result = $this->Tree->findByName('1.1');
@ -154,7 +154,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testDetectNoneExistantParent() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$result = $this->Tree->findByName('1.1');
@ -177,7 +177,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testRecoverFromMissingParent() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$result = $this->Tree->findByName('1.1');
@ -200,7 +200,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testDetectInvalidParents() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->updateAll(array($parentField => null));
@ -222,7 +222,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testDetectInvalidLftsRghts() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->updateAll(array($leftField => 0, $rightField => 0));
@ -243,7 +243,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testDetectEqualLftsRghts() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(1, 3);
$result = $this->Tree->findByName('1.1');
@ -270,7 +270,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testAddOrphan() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->save(array($modelClass => array('name' => 'testAddOrphan', $parentField => null)));
@ -289,7 +289,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testAddMiddle() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data= $this->Tree->find(array($modelClass . '.name' => '1.1'), array('id'));
@ -322,7 +322,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testAddInvalid() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -346,7 +346,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testAddNotIndexedByModel() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->save(array('name' => 'testAddNotIndexed', $parentField => null));
@ -365,7 +365,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMovePromote() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -391,7 +391,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveWithWhitelist() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -418,7 +418,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testInsertWithWhitelist() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->whitelist = array('name', $parentField);
@ -436,7 +436,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveBefore() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -464,7 +464,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveAfter() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -492,7 +492,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveDemoteInvalid() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -525,7 +525,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveInvalid() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -551,7 +551,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveSelfInvalid() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -577,7 +577,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveUpSuccess() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1.2'), array('id'));
@ -598,7 +598,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveUpFail() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1.1'));
@ -620,7 +620,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveUp2() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(1, 10);
$data = $this->Tree->find(array($modelClass . '.name' => '1.5'), array('id'));
@ -650,7 +650,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveUpFirst() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(1, 10);
$data = $this->Tree->find(array($modelClass . '.name' => '1.5'), array('id'));
@ -680,7 +680,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveDownSuccess() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1.1'), array('id'));
@ -701,7 +701,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveDownFail() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1.2'));
@ -722,7 +722,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveDownLast() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(1, 10);
$data = $this->Tree->find(array($modelClass . '.name' => '1.5'), array('id'));
@ -752,7 +752,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveDown2() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(1, 10);
$data = $this->Tree->find(array($modelClass . '.name' => '1.5'), array('id'));
@ -782,7 +782,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testSaveNoMove() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(1, 10);
$data = $this->Tree->find(array($modelClass . '.name' => '1.5'), array('id'));
@ -812,7 +812,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testMoveToRootAndMoveUp() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(1, 1);
$data = $this->Tree->find(array($modelClass . '.name' => '1.1'), array('id'));
$this->Tree->id = $data[$modelClass]['id'];
@ -836,7 +836,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testDelete() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$initialCount = $this->Tree->find('count');
@ -871,7 +871,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testRemove() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$initialCount = $this->Tree->find('count');
$result = $this->Tree->findByName('1.1');
@ -903,7 +903,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testRemoveLastTopParent() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$initialCount = $this->Tree->find('count');
@ -936,7 +936,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testRemoveNoChildren() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$initialCount = $this->Tree->find('count');
@ -970,7 +970,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testRemoveAndDelete() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$initialCount = $this->Tree->find('count');
@ -1002,7 +1002,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testRemoveAndDeleteNoChildren() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$initialCount = $this->Tree->find('count');
@ -1034,7 +1034,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testChildren() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1. Root'));
@ -1062,7 +1062,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testCountChildren() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1. Root'));
@ -1082,7 +1082,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testGetParentNode() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1.2.2'));
@ -1100,7 +1100,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testGetPath() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1.2.2'));
@ -1120,7 +1120,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testNoAmbiguousColumn() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->bindModel(array('belongsTo' => array('Dummy' =>
array('className' => $modelClass, 'foreignKey' => $parentField, 'conditions' => array('Dummy.id' => null)))), false);
$this->Tree->initialize(2, 2);
@ -1152,7 +1152,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testReorderTree() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(3, 3);
$nodes = $this->Tree->find('list', array('order' => $leftField));
@ -1180,7 +1180,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testGenerateTreeListWithSelfJoin() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->bindModel(array('belongsTo' => array('Dummy' =>
array('className' => $modelClass, 'foreignKey' => $parentField, 'conditions' => array('Dummy.id' => null)))), false);
$this->Tree->initialize(2, 2);
@ -1197,7 +1197,7 @@ class NumberTreeTest extends CakeTestCase {
*/
function testArraySyntax() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(3, 3);
$this->assertIdentical($this->Tree->childCount(2), $this->Tree->childCount(array('id' => 2)));
$this->assertIdentical($this->Tree->getParentNode(2), $this->Tree->getParentNode(array('id' => 2)));
@ -1237,7 +1237,7 @@ class ScopedTreeTest extends NumberTreeTest {
* @return void
*/
function testStringScope() {
$this->Tree = new FlagTree();
$this->Tree =& new FlagTree();
$this->Tree->initialize(2, 3);
$this->Tree->id = 1;
@ -1273,7 +1273,7 @@ class ScopedTreeTest extends NumberTreeTest {
* @return void
*/
function testArrayScope() {
$this->Tree = new FlagTree();
$this->Tree =& new FlagTree();
$this->Tree->initialize(2, 3);
$this->Tree->id = 1;
@ -1309,7 +1309,7 @@ class ScopedTreeTest extends NumberTreeTest {
* @return void
*/
function testMoveUpWithScope() {
$this->Ad = new Ad();
$this->Ad =& new Ad();
$this->Ad->Behaviors->attach('Tree', array('scope'=>'Campaign'));
$this->Ad->moveUp(6);
@ -1325,7 +1325,7 @@ class ScopedTreeTest extends NumberTreeTest {
* @return void
*/
function testMoveDownWithScope() {
$this->Ad = new Ad();
$this->Ad =& new Ad();
$this->Ad->Behaviors->attach('Tree', array('scope' => 'Campaign'));
$this->Ad->moveDown(6);
@ -1342,7 +1342,7 @@ class ScopedTreeTest extends NumberTreeTest {
* @return void
*/
function testTranslatingTree() {
$this->Tree = new FlagTree();
$this->Tree =& new FlagTree();
$this->Tree->cacheQueries = false;
$this->Tree->translateModel = 'TranslateTreeTestModel';
$this->Tree->Behaviors->attach('Translate', array('name'));
@ -1441,10 +1441,10 @@ class ScopedTreeTest extends NumberTreeTest {
*/
function testAliasesWithScopeInTwoTreeAssociations() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->TreeTwo = new NumberTreeTwo();
$this->TreeTwo =& new NumberTreeTwo();
$record = $this->Tree->find('first');
@ -1522,7 +1522,7 @@ class AfterTreeTest extends NumberTreeTest {
* @return void
*/
function testAftersaveCallback() {
$this->Tree = new AfterTree();
$this->Tree =& new AfterTree();
$expected = array('AfterTree' => array('name' => 'Six and One Half Changed in AfterTree::afterSave() but not in database', 'parent_id' => 6, 'lft' => 11, 'rght' => 12));
$result = $this->Tree->save(array('AfterTree' => array('name' => 'Six and One Half', 'parent_id' => 6)));
@ -1594,7 +1594,7 @@ class UuidTreeTest extends NumberTreeTest {
*/
function testMovePromote() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -1620,7 +1620,7 @@ class UuidTreeTest extends NumberTreeTest {
*/
function testMoveWithWhitelist() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$this->Tree->id = null;
@ -1647,7 +1647,7 @@ class UuidTreeTest extends NumberTreeTest {
*/
function testRemoveNoChildren() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$initialCount = $this->Tree->find('count');
@ -1681,7 +1681,7 @@ class UuidTreeTest extends NumberTreeTest {
*/
function testRemoveAndDeleteNoChildren() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$initialCount = $this->Tree->find('count');
@ -1713,7 +1713,7 @@ class UuidTreeTest extends NumberTreeTest {
*/
function testChildren() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->initialize(2, 2);
$data = $this->Tree->find(array($modelClass . '.name' => '1. Root'));
@ -1741,7 +1741,7 @@ class UuidTreeTest extends NumberTreeTest {
*/
function testNoAmbiguousColumn() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->bindModel(array('belongsTo' => array('Dummy' =>
array('className' => $modelClass, 'foreignKey' => $parentField, 'conditions' => array('Dummy.id' => null)))), false);
$this->Tree->initialize(2, 2);
@ -1773,7 +1773,7 @@ class UuidTreeTest extends NumberTreeTest {
*/
function testGenerateTreeListWithSelfJoin() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree =& new $modelClass();
$this->Tree->bindModel(array('belongsTo' => array('Dummy' =>
array('className' => $modelClass, 'foreignKey' => $parentField, 'conditions' => array('Dummy.id' => null)))), false);
$this->Tree->initialize(2, 2);

View file

@ -371,7 +371,7 @@ class DboMysqlTest extends CakeTestCase {
function testIndexOnMySQL4Output() {
$name = $this->db->fullTableName('simple');
$mockDbo = new QueryMockDboMysql($this);
$mockDbo =& new QueryMockDboMysql($this);
$columnData = array(
array('0' => array(
'Table' => 'with_compound_keys',
@ -512,7 +512,7 @@ class DboMysqlTest extends CakeTestCase {
App::import('Core', 'Schema');
$this->db->cacheSources = $this->db->testing = false;
$schema1 = new CakeSchema(array(
$schema1 =& new CakeSchema(array(
'name' => 'AlterTest1',
'connection' => 'test_suite',
'altertest' => array(
@ -523,7 +523,7 @@ class DboMysqlTest extends CakeTestCase {
)));
$this->db->query($this->db->createSchema($schema1));
$schema2 = new CakeSchema(array(
$schema2 =& new CakeSchema(array(
'name' => 'AlterTest2',
'connection' => 'test_suite',
'altertest' => array(
@ -543,7 +543,7 @@ class DboMysqlTest extends CakeTestCase {
$this->assertEqual($schema2->tables['altertest']['indexes'], $indexes);
// Change three indexes, delete one and add another one
$schema3 = new CakeSchema(array(
$schema3 =& new CakeSchema(array(
'name' => 'AlterTest3',
'connection' => 'test_suite',
'altertest' => array(

View file

@ -103,7 +103,7 @@ class DboOracleTest extends CakeTestCase {
*/
function testName() {
$Db = $this->db;
#$Db = new DboOracle($config = null, $autoConnect = false);
#$Db =& new DboOracle($config = null, $autoConnect = false);
$r = $Db->name($Db->name($Db->name('foo.last_update_date')));
$e = 'foo.last_update_date';

View file

@ -415,7 +415,7 @@ class DboPostgresTest extends CakeTestCase {
ªºnh˚ºO^∏…®[Ó“ÅfıÌ≥∫F!(π∑T6`¬tΩÆ0ì»rTÎ`»Ñ«
]≈åp˝)=¿Ô0∆öVÂmˇˆ„ø~¯ÁÔ∏b*fc»‡Îı„Ú}∆tœs∂Y∫ÜaÆ˙X∏~<ÿ·Ù vé1p¿TD∆ÔîÄ“úhˆ*Ú€îe)K p¨ÚJ3Ÿ∞ã>ÊuNê°“√Ü Ê9iÙ0˙AAEÍ ˙`∂£\'ûce•åƒXŸÁ´1SK{qdá"tÏ[wQ#SµBe∞∑µó…ÌV`B"Ñ≥„!è_Óφ-ºú¿Ë0ˆeê∂´ë+HFj…‡zvHÓN|ÔL÷ûñ3õÜ$z%sá…pÎóV38âs Çoµ•ß3†<9B·¨û~¢3)ÂxóÿÁCÕòÆ ∫Í=»ÿSπS;∆~±êÆTEp∑óÈ÷ÀuìDHÈ $ÉõæÜjû§"≤ÃONM®RËíRr{õS ∏Ê™op±W;ÂUÔP∫kÔˇflTæ∑óflË” ÆC©Ô[≥◊HÁ˚¨hê"ÆbF?ú%h˙ˇ4xèÕ(ó2ÙáíM])Ñd|=fë-cI0ñL¢kÖêk‰Rƒ«ıÄWñ8mO3∏&√æËX¯Hó—ì]yF2»˜ádàà‡‹Çο„≥7mªHAS∑¶.;Œx(1}_kd©.fidç48M\áªCp^Krí<ɉXÓıïl!Ì$N<ı∞B»G]…∂Ó¯>˛ÔbõÒπÀ•:ôO<j∂™œ%âÏ—>@È$pÖuÊ´-QqV ?V≥JÆÍqÛX8(lπï@zgÖ}Fe<ˇ‡Sñ“ÿ˜ê?6‡L∫Oß~µ?ËeäÚ®YîÕ =¢DÁu*GvBk;)L¬N«î:flö∂≠ÇΩq„Ñm하Ë"û≥§:±≤i^ΩÑ!)Wıyŧôá„RÄ÷Òôc≠—s™rıPdêãh˘ßHVç5fifiÈF€çÌÛuçÖ/M=µ±ÿGû1coÔuñæ.õ∑7ÉÏÜÆ,°H†ÍÉÌ∂7e º® íˆ◊øNWK”ÂYµñé;µ¶gV->µtË¥áßN2 ¯¶BaP-)eW.àôt^∏1C∑Ö?L„&”54jvãªZ ÷+4% ´0l…»ú^°´© ûiπ∑é®óܱÒÿ‰ïˆÌdˆ◊Æ19rQ=Í|ı•rMæ¬;ò‰Y‰é9. ˝V«ã¯∏,+ë®j*¡·/';
$model = new AppModel(array('name' => 'BinaryTest', 'ds' => 'test_suite'));
$model =& new AppModel(array('name' => 'BinaryTest', 'ds' => 'test_suite'));
$model->save(compact('data'));
$result = $model->find('first');
@ -528,7 +528,7 @@ class DboPostgresTest extends CakeTestCase {
* @return void
*/
function testAlterSchema() {
$Old = new CakeSchema(array(
$Old =& new CakeSchema(array(
'connection' => 'test_suite',
'name' => 'AlterPosts',
'alter_posts' => array(
@ -543,7 +543,7 @@ class DboPostgresTest extends CakeTestCase {
));
$this->db->query($this->db->createSchema($Old));
$New = new CakeSchema(array(
$New =& new CakeSchema(array(
'connection' => 'test_suite',
'name' => 'AlterPosts',
'alter_posts' => array(
@ -575,7 +575,7 @@ class DboPostgresTest extends CakeTestCase {
function testAlterIndexes() {
$this->db->cacheSources = false;
$schema1 = new CakeSchema(array(
$schema1 =& new CakeSchema(array(
'name' => 'AlterTest1',
'connection' => 'test_suite',
'altertest' => array(
@ -587,7 +587,7 @@ class DboPostgresTest extends CakeTestCase {
));
$this->db->query($this->db->createSchema($schema1));
$schema2 = new CakeSchema(array(
$schema2 =& new CakeSchema(array(
'name' => 'AlterTest2',
'connection' => 'test_suite',
'altertest' => array(
@ -609,7 +609,7 @@ class DboPostgresTest extends CakeTestCase {
$this->assertEqual($schema2->tables['altertest']['indexes'], $indexes);
// Change three indexes, delete one and add another one
$schema3 = new CakeSchema(array(
$schema3 =& new CakeSchema(array(
'name' => 'AlterTest3',
'connection' => 'test_suite',
'altertest' => array(

View file

@ -210,7 +210,7 @@ class DboSqliteTest extends CakeTestCase {
* @return void
**/
function testDescribe() {
$Model = new Model(array('name' => 'User', 'ds' => 'test_suite', 'table' => 'users'));
$Model =& new Model(array('name' => 'User', 'ds' => 'test_suite', 'table' => 'users'));
$result = $this->db->describe($Model);
$expected = array(
'id' => array(
@ -256,7 +256,7 @@ class DboSqliteTest extends CakeTestCase {
function testDescribeWithUuidPrimaryKey() {
$tableName = 'uuid_tests';
$this->db->query("CREATE TABLE {$tableName} (id VARCHAR(36) PRIMARY KEY, name VARCHAR, created DATETIME, modified DATETIME)");
$Model = new Model(array('name' => 'UuidTest', 'ds' => 'test_suite', 'table' => 'uuid_tests'));
$Model =& new Model(array('name' => 'UuidTest', 'ds' => 'test_suite', 'table' => 'uuid_tests'));
$result = $this->db->describe($Model);
$expected = array(
'type' => 'string',

View file

@ -1209,13 +1209,13 @@ class DboSourceTest extends CakeTestCase {
}");
}
$this->testDb = new DboTest($this->__config);
$this->testDb =& new DboTest($this->__config);
$this->testDb->cacheSources = false;
$this->testDb->startQuote = '`';
$this->testDb->endQuote = '`';
Configure::write('debug', 1);
$this->debug = Configure::read('debug');
$this->Model = new TestModel();
$this->Model =& new TestModel();
}
/**
* endTest method
@ -1239,7 +1239,7 @@ class DboSourceTest extends CakeTestCase {
$test =& ConnectionManager::create('quoteTest', $config);
$test->simulated = array();
$this->Model = new Article2(array('alias' => 'Article', 'ds' => 'quoteTest'));
$this->Model =& new Article2(array('alias' => 'Article', 'ds' => 'quoteTest'));
$this->Model->setDataSource('quoteTest');
$this->assertEqual($this->Model->escapeField(), '`Article`.`id`');
@ -1277,11 +1277,11 @@ class DboSourceTest extends CakeTestCase {
*/
function testGenerateAssociationQuerySelfJoin() {
$this->startTime = microtime(true);
$this->Model = new Article2();
$this->Model =& new Article2();
$this->_buildRelatedModels($this->Model);
$this->_buildRelatedModels($this->Model->Category2);
$this->Model->Category2->ChildCat = new Category2();
$this->Model->Category2->ParentCat = new Category2();
$this->Model->Category2->ChildCat =& new Category2();
$this->Model->Category2->ParentCat =& new Category2();
$queryData = array();
@ -1305,7 +1305,7 @@ class DboSourceTest extends CakeTestCase {
$query = $this->testDb->generateAssociationQuery($this->Model->Category2, $null, null, null, null, $queryData, false, $null);
$this->assertPattern('/^SELECT\s+(.+)FROM(.+)`Category2`\.`group_id`\s+=\s+`Group`\.`id`\)\s+LEFT JOIN(.+)WHERE\s+1 = 1\s*$/', $query);
$this->Model = new TestModel4();
$this->Model =& new TestModel4();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1366,10 +1366,10 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateInnerJoinAssociationQuery() {
$this->Model = new TestModel9();
$this->Model =& new TestModel9();
$test =& ConnectionManager::create('test2', $this->__config);
$this->Model->setDataSource('test2');
$this->Model->TestModel8 = new TestModel8();
$this->Model->TestModel8 =& new TestModel8();
$this->Model->TestModel8->setDataSource('test2');
$this->testDb->read($this->Model, array('recursive' => 1));
@ -1389,7 +1389,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQuerySelfJoinWithConditionsInHasOneBinding() {
$this->Model = new TestModel8();
$this->Model =& new TestModel8();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1416,7 +1416,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQuerySelfJoinWithConditionsInBelongsToBinding() {
$this->Model = new TestModel9();
$this->Model =& new TestModel9();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1442,7 +1442,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQuerySelfJoinWithConditions() {
$this->Model = new TestModel4();
$this->Model =& new TestModel4();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1462,7 +1462,7 @@ class DboSourceTest extends CakeTestCase {
$this->assertPattern('/\s+ON\s+\(`TestModel4`.`parent_id` = `TestModel4Parent`.`id`\)\s+WHERE/', $result);
$this->assertPattern('/\s+WHERE\s+(?:\()?`TestModel4Parent`.`name`\s+!=\s+\'mariano\'(?:\))?\s*$/', $result);
$this->Featured2 = new Featured2();
$this->Featured2 =& new Featured2();
$this->Featured2->schema();
$this->Featured2->bindModel(array(
@ -1503,7 +1503,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasOne() {
$this->Model = new TestModel4();
$this->Model =& new TestModel4();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1535,7 +1535,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasOneWithConditions() {
$this->Model = new TestModel4();
$this->Model =& new TestModel4();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1564,7 +1564,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryBelongsTo() {
$this->Model = new TestModel5();
$this->Model =& new TestModel5();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1595,7 +1595,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryBelongsToWithConditions() {
$this->Model = new TestModel5();
$this->Model =& new TestModel5();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1626,7 +1626,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasMany() {
$this->Model = new TestModel5();
$this->Model =& new TestModel5();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1655,7 +1655,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasManyWithLimit() {
$this->Model = new TestModel5();
$this->Model =& new TestModel5();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1694,7 +1694,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasManyWithConditions() {
$this->Model = new TestModel5();
$this->Model =& new TestModel5();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1722,7 +1722,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasManyWithOffsetAndLimit() {
$this->Model = new TestModel5();
$this->Model =& new TestModel5();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1759,7 +1759,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasManyWithPageAndLimit() {
$this->Model = new TestModel5();
$this->Model =& new TestModel5();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1795,7 +1795,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasManyWithFields() {
$this->Model = new TestModel5();
$this->Model =& new TestModel5();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1920,7 +1920,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasAndBelongsToMany() {
$this->Model = new TestModel4();
$this->Model =& new TestModel4();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1950,7 +1950,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasAndBelongsToManyWithConditions() {
$this->Model = new TestModel4();
$this->Model =& new TestModel4();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -1978,7 +1978,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasAndBelongsToManyWithOffsetAndLimit() {
$this->Model = new TestModel4();
$this->Model =& new TestModel4();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -2014,7 +2014,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testGenerateAssociationQueryHasAndBelongsToManyWithPageAndLimit() {
$this->Model = new TestModel4();
$this->Model =& new TestModel4();
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
@ -2058,7 +2058,7 @@ class DboSourceTest extends CakeTestCase {
} elseif (isset($assocData['className'])) {
$className = $assocData['className'];
}
$model->$className = new $className();
$model->$className =& new $className();
$model->$className->schema();
}
}
@ -2631,7 +2631,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testConditionsWithModel() {
$this->Model = new Article2();
$this->Model =& new Article2();
$result = $this->testDb->conditions(array('Article2.viewed >=' => 0), true, true, $this->Model);
$expected = " WHERE `Article2`.`viewed` >= 0";
@ -3128,7 +3128,7 @@ class DboSourceTest extends CakeTestCase {
* @return void
*/
function testSchema() {
$Schema = new CakeSchema();
$Schema =& new CakeSchema();
$Schema->tables = array('table' => array(), 'anotherTable' => array());
$this->expectError();

View file

@ -224,10 +224,10 @@ class DbAclTest extends DbAcl {
* @return void
*/
function __construct() {
$this->Aro = new DbAroTest();
$this->Aro->Permission = new DbPermissionTest();
$this->Aco = new DbAcoTest();
$this->Aro->Permission = new DbPermissionTest();
$this->Aro =& new DbAroTest();
$this->Aro->Permission =& new DbPermissionTest();
$this->Aco =& new DbAcoTest();
$this->Aro->Permission =& new DbPermissionTest();
}
}
/**

View file

@ -42,7 +42,7 @@ class ModelDeleteTest extends BaseModelTest {
function testDeleteHabtmReferenceWithConditions() {
$this->loadFixtures('Portfolio', 'Item', 'ItemsPortfolio');
$Portfolio = new Portfolio();
$Portfolio =& new Portfolio();
$Portfolio->hasAndBelongsToMany['Item']['conditions'] = array('ItemsPortfolio.item_id >' => 1);
$result = $Portfolio->find('first', array(
@ -131,7 +131,7 @@ class ModelDeleteTest extends BaseModelTest {
*/
function testDeleteArticleBLinks() {
$this->loadFixtures('Article', 'ArticlesTag', 'Tag');
$TestModel = new ArticleB();
$TestModel =& new ArticleB();
$result = $TestModel->ArticlesTag->find('all');
$expected = array(
@ -160,8 +160,8 @@ class ModelDeleteTest extends BaseModelTest {
function testDeleteDependentWithConditions() {
$this->loadFixtures('Cd','Book','OverallFavorite');
$Cd = new Cd();
$OverallFavorite = new OverallFavorite();
$Cd =& new Cd();
$OverallFavorite =& new OverallFavorite();
$Cd->del(1);
@ -187,7 +187,7 @@ class ModelDeleteTest extends BaseModelTest {
*/
function testDel() {
$this->loadFixtures('Article');
$TestModel = new Article();
$TestModel =& new Article();
$result = $TestModel->del(2);
$this->assertTrue($result);
@ -232,7 +232,7 @@ class ModelDeleteTest extends BaseModelTest {
// make sure deleting a non-existent record doesn't break save()
// ticket #6293
$this->loadFixtures('Uuid');
$Uuid = new Uuid();
$Uuid =& new Uuid();
$data = array(
'B607DAB9-88A2-46CF-B57C-842CA9E3B3B3',
'52C8865C-10EE-4302-AE6C-6E7D8E12E2C8',
@ -266,7 +266,7 @@ class ModelDeleteTest extends BaseModelTest {
*/
function testDeleteAll() {
$this->loadFixtures('Article');
$TestModel = new Article();
$TestModel =& new Article();
$data = array('Article' => array(
'user_id' => 2,
@ -407,7 +407,7 @@ class ModelDeleteTest extends BaseModelTest {
*/
function testRecursiveDel() {
$this->loadFixtures('Article', 'Comment', 'Attachment');
$TestModel = new Article();
$TestModel =& new Article();
$result = $TestModel->del(2);
$this->assertTrue($result);
@ -442,7 +442,7 @@ class ModelDeleteTest extends BaseModelTest {
*/
function testDependentExclusiveDelete() {
$this->loadFixtures('Article', 'Comment');
$TestModel = new Article10();
$TestModel =& new Article10();
$result = $TestModel->find('all');
$this->assertEqual(count($result[0]['Comment']), 4);
@ -460,7 +460,7 @@ class ModelDeleteTest extends BaseModelTest {
*/
function testDeleteLinks() {
$this->loadFixtures('Article', 'ArticlesTag', 'Tag');
$TestModel = new Article();
$TestModel =& new Article();
$result = $TestModel->ArticlesTag->find('all');
$expected = array(
@ -508,7 +508,7 @@ class ModelDeleteTest extends BaseModelTest {
function testHabtmDeleteLinksWhenNoPrimaryKeyInJoinTable() {
$this->loadFixtures('Apple', 'Device', 'ThePaperMonkies');
$ThePaper = new ThePaper();
$ThePaper =& new ThePaper();
$ThePaper->id = 1;
$ThePaper->save(array('Monkey' => array(2, 3)));
@ -528,7 +528,7 @@ class ModelDeleteTest extends BaseModelTest {
));
$this->assertEqual($result['Monkey'], $expected);
$ThePaper = new ThePaper();
$ThePaper =& new ThePaper();
$ThePaper->id = 2;
$ThePaper->save(array('Monkey' => array(2, 3)));

View file

@ -42,7 +42,7 @@ class ModelIntegrationTest extends BaseModelTest {
*/
function testPkInHabtmLinkModelArticleB() {
$this->loadFixtures('Article', 'Tag');
$TestModel2 = new ArticleB();
$TestModel2 =& new ArticleB();
$this->assertEqual($TestModel2->ArticlesTag->primaryKey, 'article_id');
}
/**
@ -73,22 +73,22 @@ class ModelIntegrationTest extends BaseModelTest {
function testPkInHabtmLinkModel() {
//Test Nonconformant Models
$this->loadFixtures('Content', 'ContentAccount', 'Account');
$TestModel = new Content();
$TestModel =& new Content();
$this->assertEqual($TestModel->ContentAccount->primaryKey, 'iContentAccountsId');
//test conformant models with no PK in the join table
$this->loadFixtures('Article', 'Tag');
$TestModel2 = new Article();
$TestModel2 =& new Article();
$this->assertEqual($TestModel2->ArticlesTag->primaryKey, 'article_id');
//test conformant models with PK in join table
$this->loadFixtures('Item', 'Portfolio', 'ItemsPortfolio');
$TestModel3 = new Portfolio();
$TestModel3 =& new Portfolio();
$this->assertEqual($TestModel3->ItemsPortfolio->primaryKey, 'id');
//test conformant models with PK in join table - join table contains extra field
$this->loadFixtures('JoinA', 'JoinB', 'JoinAB');
$TestModel4 = new JoinA();
$TestModel4 =& new JoinA();
$this->assertEqual($TestModel4->JoinAsJoinB->primaryKey, 'id');
}
@ -100,7 +100,7 @@ class ModelIntegrationTest extends BaseModelTest {
*/
function testDynamicBehaviorAttachment() {
$this->loadFixtures('Apple');
$TestModel = new Apple();
$TestModel =& new Apple();
$this->assertEqual($TestModel->Behaviors->attached(), array());
$TestModel->Behaviors->attach('Tree', array('left' => 'left_field', 'right' => 'right_field'));
@ -148,7 +148,7 @@ class ModelIntegrationTest extends BaseModelTest {
}
$this->loadFixtures('Article', 'Tag', 'ArticlesTag', 'User', 'Comment');
$TestModel = new Article();
$TestModel =& new Article();
$expected = array(
array(
@ -535,7 +535,7 @@ class ModelIntegrationTest extends BaseModelTest {
**/
function testDeconstructFieldsTime() {
$this->loadFixtures('Apple');
$TestModel = new Apple();
$TestModel =& new Apple();
$data = array();
$data['Apple']['mytime']['hour'] = '';
@ -621,7 +621,7 @@ class ModelIntegrationTest extends BaseModelTest {
*/
function testDeconstructFieldsDateTime() {
$this->loadFixtures('Apple');
$TestModel = new Apple();
$TestModel =& new Apple();
//test null/empty values first
$data['Apple']['created']['year'] = '';
@ -849,7 +849,7 @@ class ModelIntegrationTest extends BaseModelTest {
* @return void
*/
function testInvalidAssociation() {
$TestModel = new ValidationTest1();
$TestModel =& new ValidationTest1();
$this->assertNull($TestModel->getAssociated('Foo'));
}
/**
@ -875,7 +875,7 @@ class ModelIntegrationTest extends BaseModelTest {
**/
function testResetOfExistsOnCreate() {
$this->loadFixtures('Article');
$Article = new Article();
$Article =& new Article();
$Article->id = 1;
$Article->saveField('title', 'Reset me');
$Article->delete();
@ -897,7 +897,7 @@ class ModelIntegrationTest extends BaseModelTest {
*/
function testPluginAssociations() {
$this->loadFixtures('TestPluginArticle', 'User', 'TestPluginComment');
$TestModel = new TestPluginArticle();
$TestModel =& new TestPluginArticle();
$result = $TestModel->find('all');
$expected = array(
@ -1063,7 +1063,7 @@ class ModelIntegrationTest extends BaseModelTest {
*/
function testAutoConstructAssociations() {
$this->loadFixtures('User', 'ArticleFeatured');
$TestModel = new AssociationTest1();
$TestModel =& new AssociationTest1();
$result = $TestModel->hasAndBelongsToMany;
$expected = array('AssociationTest2' => array(
@ -1079,8 +1079,8 @@ class ModelIntegrationTest extends BaseModelTest {
$this->assertEqual($result, $expected);
// Tests related to ticket https://trac.cakephp.org/ticket/5594
$TestModel = new ArticleFeatured();
$TestFakeModel = new ArticleFeatured(array('table' => false));
$TestModel =& new ArticleFeatured();
$TestFakeModel =& new ArticleFeatured(array('table' => false));
$expected = array(
'User' => array(
@ -1195,7 +1195,7 @@ class ModelIntegrationTest extends BaseModelTest {
$this->assertEqual('test_suite', $TestModel->useDbConfig);
//deprecated but test it anyway
$NewVoid = new TheVoid(null, false, 'other');
$NewVoid =& new TheVoid(null, false, 'other');
$this->assertEqual('other', $NewVoid->useDbConfig);
}
/**
@ -1205,13 +1205,13 @@ class ModelIntegrationTest extends BaseModelTest {
* @return void
*/
function testColumnTypeFetching() {
$model = new Test();
$model =& new Test();
$this->assertEqual($model->getColumnType('id'), 'integer');
$this->assertEqual($model->getColumnType('notes'), 'text');
$this->assertEqual($model->getColumnType('updated'), 'datetime');
$this->assertEqual($model->getColumnType('unknown'), null);
$model = new Article();
$model =& new Article();
$this->assertEqual($model->getColumnType('User.created'), 'datetime');
$this->assertEqual($model->getColumnType('Tag.id'), 'integer');
$this->assertEqual($model->getColumnType('Article.id'), 'integer');
@ -1223,7 +1223,7 @@ class ModelIntegrationTest extends BaseModelTest {
* @return void
*/
function testHabtmUniqueKey() {
$model = new Item();
$model =& new Item();
$this->assertFalse($model->hasAndBelongsToMany['Portfolio']['unique']);
}
/**
@ -1233,17 +1233,17 @@ class ModelIntegrationTest extends BaseModelTest {
* @return void
*/
function testIdentity() {
$TestModel = new Test();
$TestModel =& new Test();
$result = $TestModel->alias;
$expected = 'Test';
$this->assertEqual($result, $expected);
$TestModel = new TestAlias();
$TestModel =& new TestAlias();
$result = $TestModel->alias;
$expected = 'TestAlias';
$this->assertEqual($result, $expected);
$TestModel = new Test(array('alias' => 'AnotherTest'));
$TestModel =& new Test(array('alias' => 'AnotherTest'));
$result = $TestModel->alias;
$expected = 'AnotherTest';
$this->assertEqual($result, $expected);
@ -1256,7 +1256,7 @@ class ModelIntegrationTest extends BaseModelTest {
*/
function testWithAssociation() {
$this->loadFixtures('Something', 'SomethingElse', 'JoinThing');
$TestModel = new Something();
$TestModel =& new Something();
$result = $TestModel->SomethingElse->find('all');
$expected = array(
@ -1508,7 +1508,7 @@ class ModelIntegrationTest extends BaseModelTest {
function testFindSelfAssociations() {
$this->loadFixtures('Person');
$TestModel = new Person();
$TestModel =& new Person();
$TestModel->recursive = 2;
$result = $TestModel->read(null, 1);
$expected = array(
@ -1616,7 +1616,7 @@ class ModelIntegrationTest extends BaseModelTest {
*/
function testDynamicAssociations() {
$this->loadFixtures('Article', 'Comment');
$TestModel = new Article();
$TestModel =& new Article();
$TestModel->belongsTo = $TestModel->hasAndBelongsToMany = $TestModel->hasOne = array();
$TestModel->hasMany['Comment'] = array_merge($TestModel->hasMany['Comment'], array(
@ -1723,11 +1723,11 @@ class ModelIntegrationTest extends BaseModelTest {
*/
function testCreation() {
$this->loadFixtures('Article');
$TestModel = new Test();
$TestModel =& new Test();
$result = $TestModel->create();
$expected = array('Test' => array('notes' => 'write some notes here'));
$this->assertEqual($result, $expected);
$TestModel = new User();
$TestModel =& new User();
$result = $TestModel->schema();
if (isset($this->db->columns['primary_key']['length'])) {
@ -1777,12 +1777,12 @@ class ModelIntegrationTest extends BaseModelTest {
$this->assertEqual($result, $expected);
$TestModel = new Article();
$TestModel =& new Article();
$result = $TestModel->create();
$expected = array('Article' => array('published' => 'N'));
$this->assertEqual($result, $expected);
$FeaturedModel = new Featured();
$FeaturedModel =& new Featured();
$data = array(
'article_featured_id' => 1,
'category_id' => 1,

View file

@ -89,8 +89,8 @@ class ModelReadTest extends BaseModelTest {
}
$this->loadFixtures('Project', 'Product', 'Thread', 'Message', 'Bid');
$Thread = new Thread();
$Product = new Product();
$Thread =& new Thread();
$Product =& new Product();
$result = $Thread->find('all', array(
'group' => 'Thread.project_id',
@ -245,7 +245,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testOldQuery() {
$this->loadFixtures('Article');
$Article = new Article();
$Article =& new Article();
$query = 'SELECT title FROM ';
$query .= $this->db->fullTableName('articles');
@ -280,7 +280,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testPreparedQuery() {
$this->loadFixtures('Article');
$Article = new Article();
$Article =& new Article();
$this->db->_queryCache = array();
$finalQuery = 'SELECT title, published FROM ';
@ -361,7 +361,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testParameterMismatch() {
$this->loadFixtures('Article');
$Article = new Article();
$Article =& new Article();
$query = 'SELECT * FROM ' . $this->db->fullTableName('articles');
$query .= ' WHERE ' . $this->db->fullTableName('articles');
@ -389,7 +389,7 @@ class ModelReadTest extends BaseModelTest {
}
$this->loadFixtures('Article');
$Article = new Article();
$Article =& new Article();
$query = 'SELECT * FROM ? WHERE ? = ? AND ? = ?';
$param = array(
@ -411,7 +411,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testRecursiveUnbind() {
$this->loadFixtures('Apple', 'Sample');
$TestModel = new Apple();
$TestModel =& new Apple();
$TestModel->recursive = 2;
$result = $TestModel->find('all');
@ -3032,7 +3032,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindAllThreaded() {
$this->loadFixtures('Category');
$TestModel = new Category();
$TestModel =& new Category();
$result = $TestModel->find('threaded');
$expected = array(
@ -3508,7 +3508,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindNeighbors() {
$this->loadFixtures('User', 'Article');
$TestModel = new Article();
$TestModel =& new Article();
$TestModel->id = 1;
$result = $TestModel->find('neighbors', array('fields' => array('id')));
@ -3664,7 +3664,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindNeighboursLegacy() {
$this->loadFixtures('User', 'Article');
$TestModel = new Article();
$TestModel =& new Article();
$result = $TestModel->findNeighbours(null, 'Article.id', '2');
$expected = array(
@ -3714,7 +3714,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindCombinedRelations() {
$this->loadFixtures('Apple', 'Sample');
$TestModel = new Apple();
$TestModel =& new Apple();
$result = $TestModel->find('all');
@ -3990,13 +3990,13 @@ class ModelReadTest extends BaseModelTest {
*/
function testSaveEmpty() {
$this->loadFixtures('Thread');
$TestModel = new Thread();
$TestModel =& new Thread();
$data = array();
$expected = $TestModel->save($data);
$this->assertFalse($expected);
}
// function testBasicValidation() {
// $TestModel = new ValidationTest1();
// $TestModel =& new ValidationTest1();
// $TestModel->testing = true;
// $TestModel->set(array('title' => '', 'published' => 1));
// $this->assertEqual($TestModel->invalidFields(), array('title' => 'This field cannot be left blank'));
@ -4020,7 +4020,7 @@ class ModelReadTest extends BaseModelTest {
function testFindAllWithConditionInChildQuery() {
$this->loadFixtures('Basket', 'FilmFile');
$TestModel = new Basket();
$TestModel =& new Basket();
$recursive = 3;
$result = $TestModel->find('all', compact('conditions', 'recursive'));
@ -4063,7 +4063,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindAllWithConditionsHavingMixedDataTypes() {
$this->loadFixtures('Article');
$TestModel = new Article();
$TestModel =& new Article();
$expected = array(
array(
'Article' => array(
@ -4143,7 +4143,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testBindUnbind() {
$this->loadFixtures('User', 'Comment', 'FeatureSet');
$TestModel = new User();
$TestModel =& new User();
$result = $TestModel->hasMany;
$expected = array();
@ -4547,7 +4547,7 @@ class ModelReadTest extends BaseModelTest {
$this->assertEqual($result, $expected);
$TestModel2 = new DeviceType();
$TestModel2 =& new DeviceType();
$expected = array(
'className' => 'FeatureSet',
@ -4602,7 +4602,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testBindMultipleTimes() {
$this->loadFixtures('User', 'Comment', 'Article');
$TestModel = new User();
$TestModel =& new User();
$result = $TestModel->hasMany;
$expected = array();
@ -4790,7 +4790,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testAssociationAfterFind() {
$this->loadFixtures('Post', 'Author', 'Comment');
$TestModel = new Post();
$TestModel =& new Post();
$result = $TestModel->find('all');
$expected = array(
array(
@ -4850,7 +4850,7 @@ class ModelReadTest extends BaseModelTest {
$this->assertEqual($result, $expected);
unset($TestModel);
$Author = new Author();
$Author =& new Author();
$Author->Post->bindModel(array(
'hasMany' => array(
'Comment' => array(
@ -4917,7 +4917,7 @@ class ModelReadTest extends BaseModelTest {
'DocumentDirectory'
);
$DeviceType = new DeviceType();
$DeviceType =& new DeviceType();
$DeviceType->recursive = 2;
$result = $DeviceType->read(null, 1);
@ -5006,7 +5006,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testHabtmRecursiveBelongsTo() {
$this->loadFixtures('Portfolio', 'Item', 'ItemsPortfolio', 'Syfile', 'Image');
$Portfolio = new Portfolio();
$Portfolio =& new Portfolio();
$result = $Portfolio->find(array('id' => 2), null, null, 3);
$expected = array(
@ -5064,7 +5064,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testHabtmFinderQuery() {
$this->loadFixtures('Article', 'Tag', 'ArticlesTag');
$Article = new Article();
$Article =& new Article();
$sql = $this->db->buildStatement(
array(
@ -5112,7 +5112,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testHabtmLimitOptimization() {
$this->loadFixtures('Article', 'User', 'Comment', 'Tag', 'ArticlesTag');
$TestModel = new Article();
$TestModel =& new Article();
$TestModel->hasAndBelongsToMany['Tag']['limit'] = 2;
$result = $TestModel->read(null, 2);
@ -5182,7 +5182,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testHasManyLimitOptimization() {
$this->loadFixtures('Project', 'Thread', 'Message', 'Bid');
$Project = new Project();
$Project =& new Project();
$Project->recursive = 3;
$result = $Project->find('all');
@ -5296,7 +5296,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindAllRecursiveSelfJoin() {
$this->loadFixtures('Home', 'AnotherArticle', 'Advertisement');
$TestModel = new Home();
$TestModel =& new Home();
$TestModel->recursive = 2;
$result = $TestModel->find('all');
@ -5412,7 +5412,7 @@ class ModelReadTest extends BaseModelTest {
'MyProduct'
);
$MyUser = new MyUser();
$MyUser =& new MyUser();
$MyUser->recursive = 2;
$result = $MyUser->find('all');
@ -5473,7 +5473,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testReadFakeThread() {
$this->loadFixtures('CategoryThread');
$TestModel = new CategoryThread();
$TestModel =& new CategoryThread();
$fullDebug = $this->db->fullDebug;
$this->db->fullDebug = true;
@ -5537,7 +5537,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindFakeThread() {
$this->loadFixtures('CategoryThread');
$TestModel = new CategoryThread();
$TestModel =& new CategoryThread();
$fullDebug = $this->db->fullDebug;
$this->db->fullDebug = true;
@ -5601,7 +5601,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindAllFakeThread() {
$this->loadFixtures('CategoryThread');
$TestModel = new CategoryThread();
$TestModel =& new CategoryThread();
$fullDebug = $this->db->fullDebug;
$this->db->fullDebug = true;
@ -5821,7 +5821,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testConditionalNumerics() {
$this->loadFixtures('NumericArticle');
$NumericArticle = new NumericArticle();
$NumericArticle =& new NumericArticle();
$data = array('title' => '12345abcde');
$result = $NumericArticle->find($data);
$this->assertTrue(!empty($result));
@ -5839,7 +5839,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindAll() {
$this->loadFixtures('User');
$TestModel = new User();
$TestModel =& new User();
$TestModel->cacheQueries = false;
$result = $TestModel->find('all');
@ -6069,7 +6069,7 @@ class ModelReadTest extends BaseModelTest {
function testGenerateFindList() {
$this->loadFixtures('Article', 'Apple', 'Post', 'Author', 'User');
$TestModel = new Article();
$TestModel =& new Article();
$TestModel->displayField = 'title';
$result = $TestModel->find('list', array(
@ -6204,7 +6204,7 @@ class ModelReadTest extends BaseModelTest {
));
$this->assertEqual($result, $expected);
$TestModel = new Apple();
$TestModel =& new Apple();
$expected = array(
1 => 'Red Apple 1',
2 => 'Bright Red Apple',
@ -6218,7 +6218,7 @@ class ModelReadTest extends BaseModelTest {
$this->assertEqual($TestModel->find('list'), $expected);
$this->assertEqual($TestModel->Parent->find('list'), $expected);
$TestModel = new Post();
$TestModel =& new Post();
$result = $TestModel->find('list', array(
'fields' => 'Post.title'
));
@ -6299,7 +6299,7 @@ class ModelReadTest extends BaseModelTest {
));
$this->assertEqual($result, $expected);
$TestModel = new User();
$TestModel =& new User();
$result = $TestModel->find('list', array(
'fields' => array('User.user', 'User.password')
));
@ -6311,7 +6311,7 @@ class ModelReadTest extends BaseModelTest {
);
$this->assertEqual($result, $expected);
$TestModel = new ModifiedAuthor();
$TestModel =& new ModifiedAuthor();
$result = $TestModel->find('list', array(
'fields' => array('Author.id', 'Author.user')
));
@ -6331,7 +6331,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindField() {
$this->loadFixtures('User');
$TestModel = new User();
$TestModel =& new User();
$TestModel->id = 1;
$result = $TestModel->field('user');
@ -6360,7 +6360,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindUnique() {
$this->loadFixtures('User');
$TestModel = new User();
$TestModel =& new User();
$this->assertFalse($TestModel->isUnique(array(
'user' => 'nate'
@ -6383,7 +6383,7 @@ class ModelReadTest extends BaseModelTest {
function testFindCount() {
$this->loadFixtures('User', 'Project');
$TestModel = new User();
$TestModel =& new User();
$result = $TestModel->find('count');
$this->assertEqual($result, 4);
@ -6412,7 +6412,7 @@ class ModelReadTest extends BaseModelTest {
return;
}
$this->loadFixtures('Project');
$TestModel = new Project();
$TestModel =& new Project();
$TestModel->create(array('name' => 'project')) && $TestModel->save();
$TestModel->create(array('name' => 'project')) && $TestModel->save();
$TestModel->create(array('name' => 'project')) && $TestModel->save();
@ -6432,7 +6432,7 @@ class ModelReadTest extends BaseModelTest {
}
$this->loadFixtures('Project');
$db = ConnectionManager::getDataSource('test_suite');
$TestModel = new Project();
$TestModel =& new Project();
$result = $TestModel->find('count', array('conditions' => array(
$db->expression('Project.name = \'Project 3\'')
@ -6452,7 +6452,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testFindMagic() {
$this->loadFixtures('User');
$TestModel = new User();
$TestModel =& new User();
$result = $TestModel->findByUser('mariano');
$expected = array(
@ -6483,7 +6483,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testRead() {
$this->loadFixtures('User', 'Article');
$TestModel = new User();
$TestModel =& new User();
$result = $TestModel->read();
$this->assertFalse($result);
@ -6571,7 +6571,7 @@ class ModelReadTest extends BaseModelTest {
'Featured',
'ArticleFeatured'
);
$TestModel = new User();
$TestModel =& new User();
$result = $TestModel->bindModel(array('hasMany' => array('Article')), false);
$this->assertTrue($result);
@ -6683,7 +6683,7 @@ class ModelReadTest extends BaseModelTest {
'Featured',
'Category'
);
$TestModel = new Article();
$TestModel =& new Article();
$result = $TestModel->find('all', array('conditions' => array('Article.user_id' => 1)));
$expected = array(
@ -6989,7 +6989,7 @@ class ModelReadTest extends BaseModelTest {
*/
function testRecursiveFindAllWithLimit() {
$this->loadFixtures('Article', 'User', 'Tag', 'ArticlesTag', 'Comment', 'Attachment');
$TestModel = new Article();
$TestModel =& new Article();
$TestModel->hasMany['Comment']['limit'] = 2;

View file

@ -40,7 +40,7 @@ class ModelValidationTest extends BaseModelTest {
* @return void
*/
function testValidationParams() {
$TestModel = new ValidationTest1();
$TestModel =& new ValidationTest1();
$TestModel->validate['title'] = array(
'rule' => 'customValidatorWithParams',
'required' => true
@ -81,7 +81,7 @@ class ModelValidationTest extends BaseModelTest {
* @return void
*/
function testInvalidFieldsWithFieldListParams() {
$TestModel = new ValidationTest1();
$TestModel =& new ValidationTest1();
$TestModel->validate = $validate = array(
'title' => array(
'rule' => 'customValidator',

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