diff --git a/Dockerfile.ubuntu-php b/Dockerfile.ubuntu-php index e92fffd1..cb5d7837 100644 --- a/Dockerfile.ubuntu-php +++ b/Dockerfile.ubuntu-php @@ -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 diff --git a/app/.DS_Store b/app/.DS_Store deleted file mode 100644 index 9e09c8d1..00000000 Binary files a/app/.DS_Store and /dev/null differ diff --git a/app/config/database.php b/app/config/database.php index def0e908..56058f83 100644 --- a/app/config/database.php +++ b/app/config/database.php @@ -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' => '', - ); - } - } } diff --git a/app/config/database_stg.php b/app/config/database_stg.php index e0888f2b..1ee8c813 100644 --- a/app/config/database_stg.php +++ b/app/config/database_stg.php @@ -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' => '', ); } diff --git a/app/config/php7_compat.php b/app/config/php7_compat.php index 639f68a2..3bab09f6 100644 --- a/app/config/php7_compat.php +++ b/app/config/php7_compat.php @@ -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'); - } } \ No newline at end of file diff --git a/app/webroot/.DS_Store b/app/webroot/.DS_Store deleted file mode 100644 index 3e71061e..00000000 Binary files a/app/webroot/.DS_Store and /dev/null differ diff --git a/app/webroot/test_setup.php b/app/webroot/test_setup.php deleted file mode 100644 index add5b512..00000000 --- a/app/webroot/test_setup.php +++ /dev/null @@ -1,111 +0,0 @@ -CakePHP Setup Test"; - -// Test 1: PHP Version -echo "
PHP Version: " . PHP_VERSION . "
"; -echo "Server API: " . php_sapi_name() . "
"; - -// Test 2: Required Extensions -echo "$ext: " . ($loaded ? '✓ Loaded' : '✗ Not Loaded') . "
"; -} - -// Test 3: CakePHP Constants -echo "$const: " . constant($const) . "
"; - } else { - echo "$const: ✗ Not defined
"; - } -} - -// Test 4: File System -echo "$path: " . - ($exists ? '✓ Exists' : '✗ Missing') . - ($readable ? ', ✓ Readable' : ', ✗ Not readable') . "
"; -} - -// Test 5: CakePHP Core -echo "CakePHP Bootstrap: ✓ Found at $cake_bootstrap
"; - - // 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 "Include Test: Ready to include CakePHP
"; - // Note: We don't actually include it here to avoid conflicts - - } catch (Exception $e) { - echo "Include Test: ✗ Error - " . $e->getMessage() . "
"; - } -} else { - echo "CakePHP Bootstrap: ✗ Not found
"; -} - -// Test 6: Database -echo "DB Host: $db_host
"; -echo "DB User: $db_user
"; -echo "DB Name: $db_name
"; - -if (function_exists('mysqli_connect')) { - $conn = @mysqli_connect($db_host, $db_user, $db_pass, $db_name); - if ($conn) { - echo "Database Connection: ✓ Connected
"; - mysqli_close($conn); - } else { - echo "Database Connection: ✗ Failed - " . mysqli_connect_error() . "
"; - } -} else { - echo "Database Connection: ✗ MySQLi not available
"; -} - -echo ""; -echo "Document Root: " . $_SERVER['DOCUMENT_ROOT'] . "\n"; -echo "Script Name: " . $_SERVER['SCRIPT_NAME'] . "\n"; -echo "Working Directory: " . getcwd() . "\n"; -echo ""; - -echo "
Generated at: " . date('Y-m-d H:i:s') . "
"; -?> \ No newline at end of file diff --git a/cake/console/error.php b/cake/console/error.php index c47367a1..9c88a40b 100755 --- a/cake/console/error.php +++ b/cake/console/error.php @@ -30,7 +30,7 @@ * @package cake * @subpackage cake.cake.console */ -class ErrorHandler extends CakeObject { +class ErrorHandler extends Object { /** * Standard output stream. * diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 5afd5ed4..19b07509 100755 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -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('--------------'); diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 43c86b5e..36974eb5 100755 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -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; diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index e847fb53..eed6bff8 100755 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -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); } diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index e5e6d852..736522a8 100755 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -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); diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index d61734a8..f7a0c302 100755 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -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); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index bc3b9ad2..cd60df61 100755 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -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()); diff --git a/cake/dispatcher.php b/cake/dispatcher.php index d8765bf0..ca147f30 100755 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -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()); } } diff --git a/cake/libs/cache.php b/cake/libs/cache.php index 6a3c2ce6..aabd2795 100755 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -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 * diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index fecf9794..abbd5a0e 100755 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -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 === '\\') { diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index 5c4bbeb3..2d70a6e8 100755 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -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]; diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index 5b97257f..5ff5ec32 100755 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -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})) { diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 42c16de5..c9056d28 100755 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -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; } diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 4cb46a0e..c40571cd 100755 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -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}; diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index b2e4ad2d..d68c61f0 100755 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -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. * diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 0d0c65ca..1aa37e52 100755 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -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. * diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index 1e0a063d..56713f5c 100755 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -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. * diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index b45ae072..b2e2ea42 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -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(); diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 999e4ea2..efca6b2c 100755 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -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 * diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index d5963a86..96d14025 100755 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -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 * diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 528c8d71..6a582bfc 100755 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -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(); diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index cf4be9a2..165e2b56 100755 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -35,7 +35,7 @@ * @package cake * @subpackage cake.cake.libs.controller */ -class Scaffold extends CakeObject { +class Scaffold extends Object { /** * Controller object * diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 2079e4c1..f80d05c2 100755 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -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'); diff --git a/cake/libs/error.php b/cake/libs/error.php index 4647bba6..e8db8276 100755 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -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'; } diff --git a/cake/libs/file.php b/cake/libs/file.php index f00fd827..b57cb4c7 100755 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -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); } diff --git a/cake/libs/flay.php b/cake/libs/flay.php index 9362830f..ed23cf7f 100755 --- a/cake/libs/flay.php +++ b/cake/libs/flay.php @@ -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. * diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 3b108a93..28f32672 100755 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -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. * diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 31e04834..6e21ca5c 100755 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -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]; } diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 5caf467c..71f07b4e 100755 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -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; diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index 6cb8a3fe..95f66c25 100755 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -32,7 +32,7 @@ * @package cake * @subpackage cake.cake.libs */ -class L10n extends CakeObject { +class L10n extends Object { /** * The language for current locale * diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php index e039b7d9..73b16017 100755 --- a/cake/libs/magic_db.php +++ b/cake/libs/magic_db.php @@ -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; } diff --git a/cake/libs/model/behavior.php b/cake/libs/model/behavior.php index 881b070e..fdbc64e3 100755 --- a/cake/libs/model/behavior.php +++ b/cake/libs/model/behavior.php @@ -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}); } diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 68f304d1..32f16984 100755 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -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); diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index f9cfc515..b1b2baef 100755 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -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? * diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index 1faa073b..d0368992 100755 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -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 = ""; $content = $File->prepare($content); diff --git a/cake/libs/multibyte.php b/cake/libs/multibyte.php index 9dc9c9b6..724b6592 100755 --- a/cake/libs/multibyte.php +++ b/cake/libs/multibyte.php @@ -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]; } diff --git a/cake/libs/object.php b/cake/libs/object.php index 1519e76f..61c0896c 100755 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -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 ?> \ No newline at end of file diff --git a/cake/libs/overloadable_php4.php b/cake/libs/overloadable_php4.php index 0a6ff9df..b60411c5 100755 --- a/cake/libs/overloadable_php4.php +++ b/cake/libs/overloadable_php4.php @@ -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 * diff --git a/cake/libs/overloadable_php5.php b/cake/libs/overloadable_php5.php index 347f7c9c..906b6b37 100755 --- a/cake/libs/overloadable_php5.php +++ b/cake/libs/overloadable_php5.php @@ -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. * diff --git a/cake/libs/router.php b/cake/libs/router.php index 65520c7c..0b2b3b61 100755 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -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]; diff --git a/cake/libs/security.php b/cake/libs/security.php index fc610c1e..15ec7c1b 100755 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -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]; } diff --git a/cake/libs/session.php b/cake/libs/session.php index a2ae2511..c90318c9 100755 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -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 * diff --git a/cake/libs/set.php b/cake/libs/set.php index 8e54b15d..2afb7156 100755 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -30,7 +30,7 @@ * @package cake * @subpackage cake.cake.libs */ -class Set extends CakeObject { +class Set extends Object { /** * Deprecated * diff --git a/cake/libs/socket.php b/cake/libs/socket.php index 487d0911..c5c945aa 100755 --- a/cake/libs/socket.php +++ b/cake/libs/socket.php @@ -31,7 +31,7 @@ App::import('Core', 'Validation'); * @package cake * @subpackage cake.cake.libs */ -class CakeSocket extends CakeObject { +class CakeSocket extends Object { /** * Object description * diff --git a/cake/libs/string.php b/cake/libs/string.php index 2f8950ea..286017bd 100755 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -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]; } diff --git a/cake/libs/validation.php b/cake/libs/validation.php index f519fec0..be0d20c2 100755 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -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]; } diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index 39814a0c..d8e60b12 100755 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -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 . '\'; diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index e372e9f2..15e25099 100755 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -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'])) { diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index bd8434dc..6377a526 100755 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -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)); } } diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index a5d8d57d..1ed8c01c 100755 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -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' ); diff --git a/cake/libs/xml.php b/cake/libs/xml.php index 7daa6684..0d91825b 100755 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -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]; } diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 86e22f85..6eda913f 100755 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -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"; diff --git a/cake/tests/cases/console/libs/acl.test.php b/cake/tests/cases/console/libs/acl.test.php index 6f7f1154..f27a6943 100755 --- a/cake/tests/cases/console/libs/acl.test.php +++ b/cake/tests/cases/console/libs/acl.test.php @@ -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'; } diff --git a/cake/tests/cases/console/libs/api.test.php b/cake/tests/cases/console/libs/api.test.php index cc60aecf..b5568fce 100755 --- a/cake/tests/cases/console/libs/api.test.php +++ b/cake/tests/cases/console/libs/api.test.php @@ -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; } /** diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index 48573fcf..063910db 100755 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -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'])); diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index c7114535..b832088e 100755 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -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 diff --git a/cake/tests/cases/console/libs/tasks/extract.test.php b/cake/tests/cases/console/libs/tasks/extract.test.php index 6ae11c64..d393a527 100755 --- a/cake/tests/cases/console/libs/tasks/extract.test.php +++ b/cake/tests/cases/console/libs/tasks/extract.test.php @@ -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 diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 0449893b..548f2960 100755 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -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; } /** diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index f761eaa0..613c8949 100755 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -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; diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index 56fa70d8..895eaaf4 100755 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -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'); diff --git a/cake/tests/cases/libs/cake_test_fixture.test.php b/cake/tests/cases/libs/cake_test_fixture.test.php index a3c64608..d5844bc6 100755 --- a/cake/tests/cases/libs/cake_test_fixture.test.php +++ b/cake/tests/cases/libs/cake_test_fixture.test.php @@ -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); diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index ef18aff5..9a1e6c41 100755 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -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. * diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index 4013c6b1..e3f78b28 100755 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -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(); diff --git a/cake/tests/cases/libs/controller/components/acl.test.php b/cake/tests/cases/libs/controller/components/acl.test.php index f33eeef0..755d7ae1 100755 --- a/cake/tests/cases/libs/controller/components/acl.test.php +++ b/cake/tests/cases/libs/controller/components/acl.test.php @@ -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 diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 3bf3358f..481b2dd5 100755 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -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); diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 44feb8db..8baf95e4 100755 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -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()); diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php index fe2a2df9..f744f2dc 100755 --- a/cake/tests/cases/libs/controller/components/security.test.php +++ b/cake/tests/cases/libs/controller/components/security.test.php @@ -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'; diff --git a/cake/tests/cases/libs/controller/components/session.test.php b/cake/tests/cases/libs/controller/components/session.test.php index 25802217..b79f043c 100755 --- a/cake/tests/cases/libs/controller/components/session.test.php +++ b/cake/tests/cases/libs/controller/components/session.test.php @@ -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'); diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 90baed20..8c7b3204 100755 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -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'; diff --git a/cake/tests/cases/libs/controller/controller_merge_vars.test.php b/cake/tests/cases/libs/controller/controller_merge_vars.test.php index b7cf274c..b405d3ec 100755 --- a/cake/tests/cases/libs/controller/controller_merge_vars.test.php +++ b/cake/tests/cases/libs/controller/controller_merge_vars.test.php @@ -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(); diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/cake/tests/cases/libs/controller/pages_controller.test.php index 53aef113..66980e74 100755 --- a/cake/tests/cases/libs/controller/pages_controller.test.php +++ b/cake/tests/cases/libs/controller/pages_controller.test.php @@ -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'); diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index c22822bd..72cab3eb 100755 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -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'); diff --git a/cake/tests/cases/libs/error.test.php b/cake/tests/cases/libs/error.test.php index 550fb1ef..e3d233e1 100755 --- a/cake/tests/cases/libs/error.test.php +++ b/cake/tests/cases/libs/error.test.php @@ -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("/'\/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( diff --git a/cake/tests/cases/libs/file.test.php b/cake/tests/cases/libs/file.test.php index ad668e1b..f0d64a7b 100755 --- a/cake/tests/cases/libs/file.test.php +++ b/cake/tests/cases/libs/file.test.php @@ -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); } diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index a3915a09..6fad570d 100755 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -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(); } } diff --git a/cake/tests/cases/libs/http_socket.test.php b/cake/tests/cases/libs/http_socket.test.php index c169ce27..b3fa948b 100755 --- a/cake/tests/cases/libs/http_socket.test.php +++ b/cake/tests/cases/libs/http_socket.test.php @@ -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 diff --git a/cake/tests/cases/libs/l10n.test.php b/cake/tests/cases/libs/l10n.test.php index 8a3a32bb..48df8fa3 100755 --- a/cake/tests/cases/libs/l10n.test.php +++ b/cake/tests/cases/libs/l10n.test.php @@ -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( diff --git a/cake/tests/cases/libs/magic_db.test.php b/cake/tests/cases/libs/magic_db.test.php index e383faf1..3eba7eb4 100755 --- a/cake/tests/cases/libs/magic_db.test.php +++ b/cake/tests/cases/libs/magic_db.test.php @@ -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 * diff --git a/cake/tests/cases/libs/model/behavior.test.php b/cake/tests/cases/libs/model/behavior.test.php index 374741a9..727316a2 100755 --- a/cake/tests/cases/libs/model/behavior.test.php +++ b/cake/tests/cases/libs/model/behavior.test.php @@ -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'); diff --git a/cake/tests/cases/libs/model/behaviors/acl.test.php b/cake/tests/cases/libs/model/behaviors/acl.test.php index f58a6730..3ca1974e 100755 --- a/cake/tests/cases/libs/model/behaviors/acl.test.php +++ b/cake/tests/cases/libs/model/behaviors/acl.test.php @@ -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', diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index 58f0276b..ca16f318 100755 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -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(); diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/cake/tests/cases/libs/model/behaviors/translate.test.php index 36b60180..3ec69f02 100755 --- a/cake/tests/cases/libs/model/behaviors/translate.test.php +++ b/cake/tests/cases/libs/model/behaviors/translate.test.php @@ -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; diff --git a/cake/tests/cases/libs/model/behaviors/tree.test.php b/cake/tests/cases/libs/model/behaviors/tree.test.php index 592d6de5..2d030cb4 100755 --- a/cake/tests/cases/libs/model/behaviors/tree.test.php +++ b/cake/tests/cases/libs/model/behaviors/tree.test.php @@ -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); diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php index 447db40d..691a86c1 100755 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php @@ -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( diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php index fabb5039..6b835890 100755 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php @@ -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'; diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index aa2ddcac..aec59ba4 100755 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -415,7 +415,7 @@ class DboPostgresTest extends CakeTestCase { ªºnh˚ºO^∏…®[Ó“‚ÅfıÌ≥∫F!Eœ(π∑T6`¬tΩÆ0ì»rTÎ`»Ñ« ]≈åp˝)=¿Ô0∆öVÂmˇˆ„ø~¯ÁÔ∏b*fc»‡Îı„Ú}∆tœs∂Y∫ÜaÆ˙X∏~<ÿ·Ùvé1‹p¿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õÒπÀ•:ôOPHP Version: " . PHP_VERSION . "
"; -echo "MySQL Extension: " . (function_exists('mysql_connect') || function_exists('mysqli_connect') ? 'Available' : 'Not Available') . "
"; -echo "GD Extension: " . (extension_loaded('gd') ? 'Loaded' : 'Not Loaded') . "
"; -echo "Error Reporting: " . error_reporting() . "
"; -echo "";
-if (defined('ROOT')) echo "ROOT: " . ROOT . "\n";
-if (defined('APP_DIR')) echo "APP_DIR: " . APP_DIR . "\n";
-if (defined('CAKE_CORE_INCLUDE_PATH')) echo "CAKE_CORE_INCLUDE_PATH: " . CAKE_CORE_INCLUDE_PATH . "\n";
-echo "";
-phpinfo();
-EOF
-
-echo ""
-echo "Compatibility fixes applied!"
-echo ""
-echo "Test your PHP setup at: http://localhost:8091/test_php.php"
-echo ""
-echo "If you still have issues:"
-echo "1. Check error logs: docker logs cmc-php-staging"
-echo "2. Try PHP 5.6 version: docker compose -f docker-compose.caddy-staging-php56.yml up -d"
-echo "3. Use the original Dockerfile with fixes"
\ No newline at end of file
diff --git a/scripts/fix-cakephp-php7.sh b/scripts/fix-cakephp-php7.sh
deleted file mode 100755
index 16ee13d3..00000000
--- a/scripts/fix-cakephp-php7.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-# Fix CakePHP for PHP 7 compatibility
-
-echo "Fixing CakePHP for PHP 7 compatibility..."
-
-# Fix =& new syntax in cake directory
-echo "Fixing deprecated =& new syntax..."
-find cake -name "*.php" -type f -exec perl -i -pe 's/=&\s*new/= new/g' {} \;
-
-# Fix extends Object to extends CakeObject
-echo "Fixing Object class inheritance..."
-find cake -name "*.php" -type f -exec perl -i -pe 's/extends Object/extends CakeObject/g' {} \;
-
-echo "CakePHP PHP 7 compatibility fixes applied!"
-echo "Note: This is a bulk fix and may need manual verification for edge cases."
\ No newline at end of file
diff --git a/scripts/install-caddy.sh b/scripts/install-caddy.sh
deleted file mode 100755
index 85e5c967..00000000
--- a/scripts/install-caddy.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-
-# Caddy installation script for Debian 12
-# Usage: sudo ./scripts/install-caddy.sh
-
-set -e
-
-if [ "$EUID" -ne 0 ]; then
- echo "Please run as root (use sudo)"
- exit 1
-fi
-
-echo "Installing Caddy web server on Debian 12..."
-
-# Install dependencies
-apt update
-apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
-
-# Add Caddy GPG key
-curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
-
-# Add Caddy repository
-curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
-
-# Update and install Caddy
-apt update
-apt install -y caddy
-
-# Create directories
-mkdir -p /etc/caddy
-mkdir -p /var/log/caddy
-mkdir -p /var/lib/caddy
-
-# Set permissions
-chown caddy:caddy /var/log/caddy
-chown caddy:caddy /var/lib/caddy
-
-# Enable and start Caddy service
-systemctl enable caddy
-systemctl stop caddy # We'll configure it first
-
-echo "Caddy installed successfully!"
-echo ""
-echo "Next steps:"
-echo "1. Copy your Caddyfile to /etc/caddy/Caddyfile"
-echo "2. Update the basicauth passwords in Caddyfile"
-echo "3. Start Caddy with: sudo systemctl start caddy"
-echo "4. Check status with: sudo systemctl status caddy"
-echo ""
-echo "Generate password hash with: caddy hash-password"
\ No newline at end of file
diff --git a/scripts/lego-list-certs.sh b/scripts/lego-list-certs.sh
deleted file mode 100755
index 65e9f539..00000000
--- a/scripts/lego-list-certs.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-# Lego SSL certificate listing script for CMC Sales
-# Usage: ./scripts/lego-list-certs.sh
-
-set -e
-
-echo "Listing SSL certificates managed by Lego..."
-
-# Check if lego container is running
-if ! docker ps | grep -q "cmc-lego"; then
- echo "ERROR: Lego container is not running. Please start it first with 'make proxy'"
- exit 1
-fi
-
-# List all certificates
-docker exec cmc-lego lego \
- --path="/data" \
- list
-
-echo ""
-echo "Certificate files in container:"
-docker exec cmc-lego find /data/certificates -name "*.crt" -o -name "*.key" | sort
\ No newline at end of file
diff --git a/scripts/lego-obtain-cert.sh b/scripts/lego-obtain-cert.sh
deleted file mode 100755
index 6f936108..00000000
--- a/scripts/lego-obtain-cert.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/bash
-
-# Lego SSL certificate obtainment script for CMC Sales
-# Usage: ./scripts/lego-obtain-cert.sh [domain] [email]
-
-set -e
-
-DOMAIN=${1}
-EMAIL=${2}
-
-if [ -z "$DOMAIN" ] || [ -z "$EMAIL" ]; then
- echo "Usage: $0