Standardising docblock endings throughout.

This commit is contained in:
predominant 2009-11-14 23:19:25 +11:00
parent 5092262d4d
commit 0977b3fe15
97 changed files with 559 additions and 552 deletions

View file

@ -236,7 +236,7 @@ class AclShell extends Shell {
* @param integer $indent indent level. * @param integer $indent indent level.
* @return void * @return void
* @access protected * @access protected
**/ */
function _outputNode($class, $node, $indent) { function _outputNode($class, $node, $indent) {
$indent = str_repeat(' ', $indent); $indent = str_repeat(' ', $indent);
$data = $node[$class]; $data = $node[$class];
@ -521,7 +521,7 @@ class AclShell extends Shell {
* *
* @param string $identifier Identifier to parse * @param string $identifier Identifier to parse
* @return mixed a string for aliases, and an array for model.foreignKey * @return mixed a string for aliases, and an array for model.foreignKey
**/ */
function parseIdentifier($identifier) { function parseIdentifier($identifier) {
if (preg_match('/^([\w]+)\.(.*)$/', $identifier, $matches)) { if (preg_match('/^([\w]+)\.(.*)$/', $identifier, $matches)) {
return array( return array(
@ -539,7 +539,7 @@ class AclShell extends Shell {
* @param string $class Class type you want (Aro/Aco) * @param string $class Class type you want (Aro/Aco)
* @param mixed $identifier A mixed identifier for finding the node. * @param mixed $identifier A mixed identifier for finding the node.
* @return int Integer of NodeId. Will trigger an error if nothing is found. * @return int Integer of NodeId. Will trigger an error if nothing is found.
**/ */
function _getNodeId($class, $identifier) { function _getNodeId($class, $identifier) {
$node = $this->Acl->{$class}->node($identifier); $node = $this->Acl->{$class}->node($identifier);
if (empty($node)) { if (empty($node)) {

View file

@ -242,7 +242,7 @@ class SchemaShell extends Shell {
* Run database create commands. Alias for run create. * Run database create commands. Alias for run create.
* *
* @return void * @return void
**/ */
function create() { function create() {
list($Schema, $table) = $this->_loadSchema(); list($Schema, $table) = $this->_loadSchema();
$this->__create($Schema, $table); $this->__create($Schema, $table);
@ -252,7 +252,7 @@ class SchemaShell extends Shell {
* Run database create commands. Alias for run create. * Run database create commands. Alias for run create.
* *
* @return void * @return void
**/ */
function update() { function update() {
list($Schema, $table) = $this->_loadSchema(); list($Schema, $table) = $this->_loadSchema();
$this->__update($Schema, $table); $this->__update($Schema, $table);
@ -262,7 +262,7 @@ class SchemaShell extends Shell {
* Prepares the Schema objects for database operations. * Prepares the Schema objects for database operations.
* *
* @return void * @return void
**/ */
function _loadSchema() { function _loadSchema() {
$name = $plugin = null; $name = $plugin = null;
if (isset($this->params['name'])) { if (isset($this->params['name'])) {

View file

@ -642,7 +642,7 @@ class Shell extends Object {
* *
* @param string $pluginName Name of the plugin you want ie. DebugKit * @param string $pluginName Name of the plugin you want ie. DebugKit
* @return string $path path to the correct plugin. * @return string $path path to the correct plugin.
**/ */
function _pluginPath($pluginName) { function _pluginPath($pluginName) {
return App::pluginPath($pluginName); return App::pluginPath($pluginName);
} }

View file

@ -113,7 +113,7 @@ class ControllerTask extends Shell {
* *
* @access public * @access public
* @return void * @return void
**/ */
function all() { function all() {
$this->interactive = false; $this->interactive = false;
$this->listAll($this->connection, false); $this->listAll($this->connection, false);
@ -219,7 +219,7 @@ class ControllerTask extends Shell {
* Confirm a to be baked controller with the user * Confirm a to be baked controller with the user
* *
* @return void * @return void
**/ */
function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) { function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
$this->out(); $this->out();
$this->hr(); $this->hr();
@ -257,7 +257,7 @@ class ControllerTask extends Shell {
* Interact with the user and ask about which methods (admin or regular they want to bake) * Interact with the user and ask about which methods (admin or regular they want to bake)
* *
* @return array Array containing (bakeRegular, bakeAdmin) answers * @return array Array containing (bakeRegular, bakeAdmin) answers
**/ */
function _askAboutMethods() { function _askAboutMethods() {
$wannaBakeCrud = $this->in( $wannaBakeCrud = $this->in(
__("Would you like to create some basic class methods \n(index(), add(), view(), edit())?", true), __("Would you like to create some basic class methods \n(index(), add(), view(), edit())?", true),
@ -348,7 +348,7 @@ class ControllerTask extends Shell {
* Interact with the user and get a list of additional helpers * Interact with the user and get a list of additional helpers
* *
* @return array Helpers that the user wants to use. * @return array Helpers that the user wants to use.
**/ */
function doHelpers() { function doHelpers() {
return $this->_doPropertyChoices( return $this->_doPropertyChoices(
__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true), __("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true),
@ -360,7 +360,7 @@ class ControllerTask extends Shell {
* Interact with the user and get a list of additional components * Interact with the user and get a list of additional components
* *
* @return array Components the user wants to use. * @return array Components the user wants to use.
**/ */
function doComponents() { function doComponents() {
return $this->_doPropertyChoices( return $this->_doPropertyChoices(
__("Would you like this controller to use any components?", true), __("Would you like this controller to use any components?", true),
@ -374,7 +374,7 @@ class ControllerTask extends Shell {
* @param string $prompt A yes/no question to precede the list * @param string $prompt A yes/no question to precede the list
* @param sting $example A question for a comma separated list, with examples. * @param sting $example A question for a comma separated list, with examples.
* @return array Array of values for property. * @return array Array of values for property.
**/ */
function _doPropertyChoices($prompt, $example) { function _doPropertyChoices($prompt, $example) {
$proceed = $this->in($prompt, array('y','n'), 'n'); $proceed = $this->in($prompt, array('y','n'), 'n');
$property = array(); $property = array();

View file

@ -53,7 +53,7 @@ class DbConfigTask extends Shell {
* Used for testing. * Used for testing.
* *
* @var string * @var string
**/ */
var $databaseClassName = 'DATABASE_CONFIG'; var $databaseClassName = 'DATABASE_CONFIG';
/** /**
@ -351,7 +351,7 @@ class DbConfigTask extends Shell {
* Get a user specified Connection name * Get a user specified Connection name
* *
* @return void * @return void
**/ */
function getConfig() { function getConfig() {
App::import('Model', 'ConnectionManager', false); App::import('Model', 'ConnectionManager', false);

View file

@ -54,14 +54,14 @@ class FixtureTask extends Shell {
* The db connection being used for baking * The db connection being used for baking
* *
* @var string * @var string
**/ */
var $connection = null; var $connection = null;
/** /**
* Schema instance * Schema instance
* *
* @var object * @var object
**/ */
var $_Schema = null; var $_Schema = null;
/** /**
@ -103,7 +103,7 @@ class FixtureTask extends Shell {
* *
* @access public * @access public
* @return void * @return void
**/ */
function all() { function all() {
$this->interactive = false; $this->interactive = false;
$this->Model->interactive = false; $this->Model->interactive = false;
@ -140,7 +140,7 @@ class FixtureTask extends Shell {
* *
* @param string $modelName Name of model you are dealing with. * @param string $modelName Name of model you are dealing with.
* @return array Array of import options. * @return array Array of import options.
**/ */
function importOptions($modelName) { function importOptions($modelName) {
$options = array(); $options = array();
$doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n'); $doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n');
@ -230,7 +230,7 @@ class FixtureTask extends Shell {
* @param string $fixture Contents of the fixture file. * @param string $fixture Contents of the fixture file.
* @access public * @access public
* @return void * @return void
**/ */
function generateFixtureFile($model, $otherVars) { function generateFixtureFile($model, $otherVars) {
$defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null); $defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null);
$vars = array_merge($defaults, $otherVars); $vars = array_merge($defaults, $otherVars);
@ -255,7 +255,7 @@ class FixtureTask extends Shell {
* *
* @param array $table Table schema array * @param array $table Table schema array
* @return string fields definitions * @return string fields definitions
**/ */
function _generateSchema($tableInfo) { function _generateSchema($tableInfo) {
$schema = $this->_Schema->generateTable('f', $tableInfo); $schema = $this->_Schema->generateTable('f', $tableInfo);
return substr($schema, 10, -2); return substr($schema, 10, -2);
@ -266,7 +266,7 @@ class FixtureTask extends Shell {
* *
* @param array $table Table schema array * @param array $table Table schema array
* @return array Array of records to use in the fixture. * @return array Array of records to use in the fixture.
**/ */
function _generateRecords($tableInfo, $recordCount = 1) { function _generateRecords($tableInfo, $recordCount = 1) {
$records = array(); $records = array();
for ($i = 0; $i < $recordCount; $i++) { for ($i = 0; $i < $recordCount; $i++) {
@ -337,7 +337,7 @@ class FixtureTask extends Shell {
* *
* @param array $records Array of records to be converted to string * @param array $records Array of records to be converted to string
* @return string A string value of the $records array. * @return string A string value of the $records array.
**/ */
function _makeRecordString($records) { function _makeRecordString($records) {
$out = "array(\n"; $out = "array(\n";
foreach ($records as $record) { foreach ($records as $record) {
@ -360,7 +360,7 @@ class FixtureTask extends Shell {
* @param string $modelName name of the model to take records from. * @param string $modelName name of the model to take records from.
* @param string $useTable Name of table to use. * @param string $useTable Name of table to use.
* @return array Array of records. * @return array Array of records.
**/ */
function _getRecordsFromTable($modelName, $useTable = null) { function _getRecordsFromTable($modelName, $useTable = null) {
if ($this->interactive) { if ($this->interactive) {
$condition = null; $condition = null;

View file

@ -64,14 +64,14 @@ class ModelTask extends Shell {
* Holds tables found on connection. * Holds tables found on connection.
* *
* @var array * @var array
**/ */
var $__tables = array(); var $__tables = array();
/** /**
* Holds validation method map. * Holds validation method map.
* *
* @var array * @var array
**/ */
var $__validations = array(); var $__validations = array();
/** /**
@ -109,7 +109,7 @@ class ModelTask extends Shell {
* Bake all models at once. * Bake all models at once.
* *
* @return void * @return void
**/ */
function all() { function all() {
$this->listAll($this->connection, false); $this->listAll($this->connection, false);
$unitTestExists = $this->_checkUnitTest(); $unitTestExists = $this->_checkUnitTest();
@ -129,7 +129,7 @@ class ModelTask extends Shell {
* *
* @param string $className Name of class you want model to be. * @param string $className Name of class you want model to be.
* @return object Model instance * @return object Model instance
**/ */
function &_getModelObject($className) { function &_getModelObject($className) {
$object = new Model(array('name' => $className, 'ds' => $this->connection)); $object = new Model(array('name' => $className, 'ds' => $this->connection));
return $object; return $object;
@ -142,7 +142,7 @@ class ModelTask extends Shell {
* @param string $prompt Prompt to use for options list. * @param string $prompt Prompt to use for options list.
* @param integer $default The default option for the given prompt. * @param integer $default The default option for the given prompt.
* @return result of user choice. * @return result of user choice.
**/ */
function inOptions($options, $prompt = null, $default = null) { function inOptions($options, $prompt = null, $default = null) {
$valid = false; $valid = false;
$max = count($options); $max = count($options);
@ -262,7 +262,7 @@ class ModelTask extends Shell {
* @param string $associations Collection of associations. * @param string $associations Collection of associations.
* @access protected * @access protected
* @return void * @return void
**/ */
function _printAssociation($modelName, $type, $associations) { function _printAssociation($modelName, $type, $associations) {
if (!empty($associations[$type])) { if (!empty($associations[$type])) {
for ($i = 0; $i < count($associations[$type]); $i++) { for ($i = 0; $i < count($associations[$type]); $i++) {
@ -278,7 +278,7 @@ class ModelTask extends Shell {
* @param array $fields Array of fields that might have a primary key. * @param array $fields Array of fields that might have a primary key.
* @return string Name of field that is a primary key. * @return string Name of field that is a primary key.
* @access public * @access public
**/ */
function findPrimaryKey($fields) { function findPrimaryKey($fields) {
foreach ($fields as $name => $field) { foreach ($fields as $name => $field) {
if (isset($field['key']) && $field['key'] == 'primary') { if (isset($field['key']) && $field['key'] == 'primary') {
@ -293,7 +293,7 @@ class ModelTask extends Shell {
* *
* @param array $fields Array of fields to look for and choose as a displayField * @param array $fields Array of fields to look for and choose as a displayField
* @return mixed Name of field to use for displayField or false if the user declines to choose * @return mixed Name of field to use for displayField or false if the user declines to choose
**/ */
function findDisplayField($fields) { function findDisplayField($fields) {
$fieldNames = array_keys($fields); $fieldNames = array_keys($fields);
$prompt = __("A displayField could not be automatically detected\nwould you like to choose one?", true); $prompt = __("A displayField could not be automatically detected\nwould you like to choose one?", true);
@ -337,7 +337,7 @@ class ModelTask extends Shell {
* Populate the __validations array * Populate the __validations array
* *
* @return void * @return void
**/ */
function initValidations() { function initValidations() {
$options = $choices = array(); $options = $choices = array();
if (class_exists('Validation')) { if (class_exists('Validation')) {
@ -363,7 +363,7 @@ class ModelTask extends Shell {
* @param string $fieldName Name of field to be validated. * @param string $fieldName Name of field to be validated.
* @param array $metaData metadata for field * @param array $metaData metadata for field
* @return array Array of validation for the field. * @return array Array of validation for the field.
**/ */
function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
$defaultChoice = count($this->__validations); $defaultChoice = count($this->__validations);
$validate = $alreadyChosen = array(); $validate = $alreadyChosen = array();
@ -484,7 +484,7 @@ class ModelTask extends Shell {
* @param object $model Model instance of model being generated. * @param object $model Model instance of model being generated.
* @param array $associations Array of inprogress associations * @param array $associations Array of inprogress associations
* @return array $associations with belongsTo added in. * @return array $associations with belongsTo added in.
**/ */
function findBelongsTo(&$model, $associations) { function findBelongsTo(&$model, $associations) {
$fields = $model->schema(); $fields = $model->schema();
foreach ($fields as $fieldName => $field) { foreach ($fields as $fieldName => $field) {
@ -513,7 +513,7 @@ class ModelTask extends Shell {
* @param object $model Model instance being generated * @param object $model Model instance being generated
* @param array $associations Array of inprogress associations * @param array $associations Array of inprogress associations
* @return array $associations with hasOne and hasMany added in. * @return array $associations with hasOne and hasMany added in.
**/ */
function findHasOneAndMany(&$model, $associations) { function findHasOneAndMany(&$model, $associations) {
$foreignKey = $this->_modelKey($model->name); $foreignKey = $this->_modelKey($model->name);
foreach ($this->__tables as $otherTable) { foreach ($this->__tables as $otherTable) {
@ -556,7 +556,7 @@ class ModelTask extends Shell {
* @param object $model Model instance being generated * @param object $model Model instance being generated
* @param array $associations Array of inprogress associations * @param array $associations Array of inprogress associations
* @return array $associations with hasAndBelongsToMany added in. * @return array $associations with hasAndBelongsToMany added in.
**/ */
function findHasAndBelongsToMany(&$model, $associations) { function findHasAndBelongsToMany(&$model, $associations) {
$foreignKey = $this->_modelKey($model->name); $foreignKey = $this->_modelKey($model->name);
foreach ($this->__tables as $otherTable) { foreach ($this->__tables as $otherTable) {
@ -596,7 +596,7 @@ class ModelTask extends Shell {
* @param array $model Temporary Model instance. * @param array $model Temporary Model instance.
* @param array $associations Array of associations to be confirmed. * @param array $associations Array of associations to be confirmed.
* @return array Array of confirmed associations * @return array Array of confirmed associations
**/ */
function confirmAssociations(&$model, $associations) { function confirmAssociations(&$model, $associations) {
foreach ($associations as $type => $settings) { foreach ($associations as $type => $settings) {
if (!empty($associations[$type])) { if (!empty($associations[$type])) {
@ -624,7 +624,7 @@ class ModelTask extends Shell {
* @param object $model Temporary model instance * @param object $model Temporary model instance
* @param array $associations Array of associations. * @param array $associations Array of associations.
* @return array Array of associations. * @return array Array of associations.
**/ */
function doMoreAssociations($model, $associations) { function doMoreAssociations($model, $associations) {
$prompt = __('Would you like to define some additional model associations?', true); $prompt = __('Would you like to define some additional model associations?', true);
$wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n'); $wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n');
@ -689,7 +689,7 @@ class ModelTask extends Shell {
* Finds all possible keys to use on custom associations. * Finds all possible keys to use on custom associations.
* *
* @return array array of tables and possible keys * @return array array of tables and possible keys
**/ */
function _generatePossibleKeys() { function _generatePossibleKeys() {
$possible = array(); $possible = array();
foreach ($this->__tables as $otherTable) { foreach ($this->__tables as $otherTable) {
@ -782,7 +782,7 @@ class ModelTask extends Shell {
* @param string $modelName Name of the model you want a table for. * @param string $modelName Name of the model you want a table for.
* @param string $useDbConfig Name of the database config you want to get tables from. * @param string $useDbConfig Name of the database config you want to get tables from.
* @return void * @return void
**/ */
function getTable($modelName, $useDbConfig = null) { function getTable($modelName, $useDbConfig = null) {
if (!isset($useDbConfig)) { if (!isset($useDbConfig)) {
$useDbConfig = $this->connection; $useDbConfig = $this->connection;
@ -811,7 +811,7 @@ class ModelTask extends Shell {
* *
* @param string $useDbConfig Connection name to scan. * @param string $useDbConfig Connection name to scan.
* @return array Array of tables in the database. * @return array Array of tables in the database.
**/ */
function getAllTables($useDbConfig = null) { function getAllTables($useDbConfig = null) {
if (!isset($useDbConfig)) { if (!isset($useDbConfig)) {
$useDbConfig = $this->connection; $useDbConfig = $this->connection;
@ -906,7 +906,7 @@ class ModelTask extends Shell {
* @access public * @access public
* @return void * @return void
* @see FixtureTask::bake * @see FixtureTask::bake
**/ */
function bakeFixture($className, $useTable = null) { function bakeFixture($className, $useTable = null) {
$this->Fixture->connection = $this->connection; $this->Fixture->connection = $this->connection;
$this->Fixture->plugin = $this->plugin; $this->Fixture->plugin = $this->plugin;

View file

@ -204,7 +204,7 @@ class PluginTask extends Shell {
* find and change $this->path to the user selection * find and change $this->path to the user selection
* *
* @return void * @return void
**/ */
function findPath($pathOptions) { function findPath($pathOptions) {
$valid = false; $valid = false;
$max = count($pathOptions); $max = count($pathOptions);

View file

@ -30,7 +30,7 @@ class ProjectTask extends Shell {
* configs path (used in testing). * configs path (used in testing).
* *
* @var string * @var string
**/ */
var $configPath = null; var $configPath = null;
/** /**

View file

@ -23,7 +23,7 @@ class TemplateTask extends Shell {
* variables to add to template scope * variables to add to template scope
* *
* @var array * @var array
**/ */
var $templateVars = array(); var $templateVars = array();
/** /**
@ -31,7 +31,7 @@ class TemplateTask extends Shell {
* Contains a list of $theme => $path * Contains a list of $theme => $path
* *
* @var array * @var array
**/ */
var $templatePaths = array(); var $templatePaths = array();
/** /**
@ -39,7 +39,7 @@ class TemplateTask extends Shell {
* *
* @access public * @access public
* @return void * @return void
**/ */
function initialize() { function initialize() {
$this->templatePaths = $this->_findThemes(); $this->templatePaths = $this->_findThemes();
} }
@ -50,7 +50,7 @@ class TemplateTask extends Shell {
* Bake themes are directories not named `skel` inside a `vendors/shells/templates` path. * Bake themes are directories not named `skel` inside a `vendors/shells/templates` path.
* *
* @return array Array of bake themes that are installed. * @return array Array of bake themes that are installed.
**/ */
function _findThemes() { function _findThemes() {
$paths = App::path('shells'); $paths = App::path('shells');
$core = array_pop($paths); $core = array_pop($paths);
@ -128,7 +128,7 @@ class TemplateTask extends Shell {
* @param string $vars Additional vars to set to template scope. * @param string $vars Additional vars to set to template scope.
* @access public * @access public
* @return contents of generated code template * @return contents of generated code template
**/ */
function generate($directory, $filename, $vars = null) { function generate($directory, $filename, $vars = null) {
if ($vars !== null) { if ($vars !== null) {
$this->set($vars); $this->set($vars);
@ -156,7 +156,7 @@ class TemplateTask extends Shell {
* If there is more than one installed theme user interaction will happen * If there is more than one installed theme user interaction will happen
* *
* @return string returns the path to the selected theme. * @return string returns the path to the selected theme.
**/ */
function getThemePath() { function getThemePath() {
if (count($this->templatePaths) == 1) { if (count($this->templatePaths) == 1) {
$paths = array_values($this->templatePaths); $paths = array_values($this->templatePaths);
@ -193,7 +193,7 @@ class TemplateTask extends Shell {
* @param string $filename lower_case_underscored filename you want. * @param string $filename lower_case_underscored filename you want.
* @access public * @access public
* @return string filename will exit program if template is not found. * @return string filename will exit program if template is not found.
**/ */
function _findTemplate($path, $directory, $filename) { function _findTemplate($path, $directory, $filename) {
$themeFile = $path . $directory . DS . $filename . '.ctp'; $themeFile = $path . $directory . DS . $filename . '.ctp';
if (file_exists($themeFile)) { if (file_exists($themeFile)) {

View file

@ -46,28 +46,28 @@ class TestTask extends Shell {
* Tasks used. * Tasks used.
* *
* @var array * @var array
**/ */
var $tasks = array('Template'); var $tasks = array('Template');
/** /**
* class types that methods can be generated for * class types that methods can be generated for
* *
* @var array * @var array
**/ */
var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper'); var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper');
/** /**
* Internal list of fixtures that have been added so far. * Internal list of fixtures that have been added so far.
* *
* @var string * @var string
**/ */
var $_fixtures = array(); var $_fixtures = array();
/** /**
* Flag for interactive mode * Flag for interactive mode
* *
* @var boolean * @var boolean
**/ */
var $interactive = false; var $interactive = false;
/** /**
@ -164,7 +164,7 @@ class TestTask extends Shell {
* Interact with the user and get their chosen type. Can exit the script. * Interact with the user and get their chosen type. Can exit the script.
* *
* @return string Users chosen type. * @return string Users chosen type.
**/ */
function getObjectType() { function getObjectType() {
$this->hr(); $this->hr();
$this->out(__("Select an object type:", true)); $this->out(__("Select an object type:", true));
@ -188,7 +188,7 @@ class TestTask extends Shell {
* *
* @param string $objectType Type of object to list classes for i.e. Model, Controller. * @param string $objectType Type of object to list classes for i.e. Model, Controller.
* @return string Class name the user chose. * @return string Class name the user chose.
**/ */
function getClassName($objectType) { function getClassName($objectType) {
$options = App::objects(strtolower($objectType)); $options = App::objects(strtolower($objectType));
$this->out(sprintf(__('Choose a %s class', true), $objectType)); $this->out(sprintf(__('Choose a %s class', true), $objectType));
@ -209,7 +209,7 @@ class TestTask extends Shell {
* Currently only model, and controller are supported * Currently only model, and controller are supported
* *
* @return boolean * @return boolean
**/ */
function typeCanDetectFixtures($type) { function typeCanDetectFixtures($type) {
$type = strtolower($type); $type = strtolower($type);
return ($type == 'controller' || $type == 'model'); return ($type == 'controller' || $type == 'model');
@ -219,7 +219,7 @@ class TestTask extends Shell {
* Check if a class with the given type is loaded or can be loaded. * Check if a class with the given type is loaded or can be loaded.
* *
* @return boolean * @return boolean
**/ */
function isLoadableClass($type, $class) { function isLoadableClass($type, $class) {
return App::import($type, $class); return App::import($type, $class);
} }
@ -229,7 +229,7 @@ class TestTask extends Shell {
* So that fixtures can be detected * So that fixtures can be detected
* *
* @return object * @return object
**/ */
function &buildTestSubject($type, $class) { function &buildTestSubject($type, $class) {
ClassRegistry::flush(); ClassRegistry::flush();
App::import($type, $class); App::import($type, $class);
@ -246,7 +246,7 @@ class TestTask extends Shell {
* Gets the real class name from the cake short form. * Gets the real class name from the cake short form.
* *
* @return string Real classname * @return string Real classname
**/ */
function getRealClassName($type, $class) { function getRealClassName($type, $class) {
if (strtolower($type) == 'model') { if (strtolower($type) == 'model') {
return $class; return $class;
@ -260,7 +260,7 @@ class TestTask extends Shell {
* *
* @param string $className Name of class to look at. * @param string $className Name of class to look at.
* @return array Array of method names. * @return array Array of method names.
**/ */
function getTestableMethods($className) { function getTestableMethods($className) {
$classMethods = get_class_methods($className); $classMethods = get_class_methods($className);
$parentMethods = get_class_methods(get_parent_class($className)); $parentMethods = get_class_methods(get_parent_class($className));
@ -280,7 +280,7 @@ class TestTask extends Shell {
* *
* @param object The object you want to generate fixtures for. * @param object The object you want to generate fixtures for.
* @return array Array of fixtures to be included in the test. * @return array Array of fixtures to be included in the test.
**/ */
function generateFixtureList(&$subject) { function generateFixtureList(&$subject) {
$this->_fixtures = array(); $this->_fixtures = array();
if (is_a($subject, 'Model')) { if (is_a($subject, 'Model')) {
@ -297,7 +297,7 @@ class TestTask extends Shell {
* *
* @return void * @return void
* @access protected * @access protected
**/ */
function _processModel(&$subject) { function _processModel(&$subject) {
$this->_addFixture($subject->name); $this->_addFixture($subject->name);
$associated = $subject->getAssociated(); $associated = $subject->getAssociated();
@ -321,7 +321,7 @@ class TestTask extends Shell {
* *
* @return void * @return void
* @access protected * @access protected
**/ */
function _processController(&$subject) { function _processController(&$subject) {
$subject->constructClasses(); $subject->constructClasses();
$models = array(Inflector::classify($subject->name)); $models = array(Inflector::classify($subject->name));
@ -339,7 +339,7 @@ class TestTask extends Shell {
* *
* @return void * @return void
* @access protected * @access protected
**/ */
function _addFixture($name) { function _addFixture($name) {
$parent = get_parent_class($name); $parent = get_parent_class($name);
$prefix = 'app.'; $prefix = 'app.';
@ -355,7 +355,7 @@ class TestTask extends Shell {
* Interact with the user to get additional fixtures they want to use. * Interact with the user to get additional fixtures they want to use.
* *
* @return void * @return void
**/ */
function getUserFixtures() { function getUserFixtures() {
$proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n'); $proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n');
$fixtures = array(); $fixtures = array();
@ -373,7 +373,7 @@ class TestTask extends Shell {
* Controllers require a mock class. * Controllers require a mock class.
* *
* @return boolean * @return boolean
**/ */
function hasMockClass($type) { function hasMockClass($type) {
$type = strtolower($type); $type = strtolower($type);
return $type == 'controller'; return $type == 'controller';
@ -383,7 +383,7 @@ class TestTask extends Shell {
* Generate a constructor code snippet for the type and classname * Generate a constructor code snippet for the type and classname
* *
* @return string Constructor snippet for the thing you are building. * @return string Constructor snippet for the thing you are building.
**/ */
function generateConstructor($type, $fullClassName) { function generateConstructor($type, $fullClassName) {
$type = strtolower($type); $type = strtolower($type);
if ($type == 'model') { if ($type == 'model') {
@ -401,7 +401,7 @@ class TestTask extends Shell {
* and get the plugin path if needed. * and get the plugin path if needed.
* *
* @return string filename the test should be created on * @return string filename the test should be created on
**/ */
function testCaseFileName($type, $className) { function testCaseFileName($type, $className) {
$path = $this->path; $path = $this->path;
if (isset($this->plugin)) { if (isset($this->plugin)) {
@ -418,7 +418,7 @@ class TestTask extends Shell {
* Show help file. * Show help file.
* *
* @return void * @return void
**/ */
function help() { function help() {
$this->hr(); $this->hr();
$this->out("Usage: cake bake test <type> <class>"); $this->out("Usage: cake bake test <type> <class>");

View file

@ -144,7 +144,7 @@ class ViewTask extends Shell {
* Get a list of actions that can / should have views baked for them. * Get a list of actions that can / should have views baked for them.
* *
* @return array Array of action names that should be baked * @return array Array of action names that should be baked
**/ */
function _methodsToBake() { function _methodsToBake() {
$methods = array_diff( $methods = array_diff(
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')), array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
@ -176,7 +176,7 @@ class ViewTask extends Shell {
* Bake All views for All controllers. * Bake All views for All controllers.
* *
* @return void * @return void
**/ */
function all() { function all() {
$this->Controller->interactive = false; $this->Controller->interactive = false;
$tables = $this->Controller->listAll($this->connection, false); $tables = $this->Controller->listAll($this->connection, false);
@ -308,7 +308,7 @@ class ViewTask extends Shell {
* *
* @param array $actions Array of actions to make files for. * @param array $actions Array of actions to make files for.
* @return void * @return void
**/ */
function bakeActions($actions, $vars) { function bakeActions($actions, $vars) {
foreach ($actions as $action) { foreach ($actions as $action) {
$content = $this->getContent($action, $vars); $content = $this->getContent($action, $vars);
@ -320,7 +320,7 @@ class ViewTask extends Shell {
* handle creation of baking a custom action view file * handle creation of baking a custom action view file
* *
* @return void * @return void
**/ */
function customAction() { function customAction() {
$action = ''; $action = '';
while ($action == '') { while ($action == '') {

View file

@ -60,7 +60,7 @@ class CakeLog {
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_streams = array(); var $_streams = array();
/** /**
@ -68,7 +68,7 @@ class CakeLog {
* *
* @return void * @return void
* @static * @static
**/ */
function &getInstance() { function &getInstance() {
static $instance = array(); static $instance = array();
if (!isset($instance[0])) { if (!isset($instance[0])) {
@ -85,7 +85,7 @@ class CakeLog {
* @param array $config Array of configuration information for the logger * @param array $config Array of configuration information for the logger
* @return boolean success of configuration. * @return boolean success of configuration.
* @static * @static
**/ */
function config($key, $config) { function config($key, $config) {
if (empty($config['engine'])) { if (empty($config['engine'])) {
trigger_error(__('Missing logger classname', true), E_USER_WARNING); trigger_error(__('Missing logger classname', true), E_USER_WARNING);
@ -107,7 +107,7 @@ class CakeLog {
* *
* @return mixed boolean false on any failures, string of classname to use if search was successful.\ * @return mixed boolean false on any failures, string of classname to use if search was successful.\
* @access protected * @access protected
**/ */
function _getLogger($loggerName) { function _getLogger($loggerName) {
$plugin = null; $plugin = null;
if (strpos($loggerName, '.') !== false) { if (strpos($loggerName, '.') !== false) {
@ -139,7 +139,7 @@ class CakeLog {
* *
* @return array * @return array
* @static * @static
**/ */
function streams() { function streams() {
$self = CakeLog::getInstance(); $self = CakeLog::getInstance();
return array_keys($self->_streams); return array_keys($self->_streams);
@ -152,7 +152,7 @@ class CakeLog {
* @param string $keyname Key name of callable to remove. * @param string $keyname Key name of callable to remove.
* @return void * @return void
* @static * @static
**/ */
function remove($streamName) { function remove($streamName) {
$self = CakeLog::getInstance(); $self = CakeLog::getInstance();
unset($self->_streams[$streamName]); unset($self->_streams[$streamName]);
@ -167,7 +167,7 @@ class CakeLog {
* @param array $config Array of config information for the LogStream * @param array $config Array of config information for the LogStream
* @return boolean success * @return boolean success
* @static * @static
**/ */
function addStream($key, $config) { function addStream($key, $config) {
$self = CakeLog::getInstance(); $self = CakeLog::getInstance();
$self->_streams[$key] = $config; $self->_streams[$key] = $config;
@ -178,7 +178,7 @@ class CakeLog {
* *
* @return void * @return void
* @access protected * @access protected
**/ */
function _autoConfig() { function _autoConfig() {
if (!class_exists('FileLog')) { if (!class_exists('FileLog')) {
App::import('Core', 'log/FileLog'); App::import('Core', 'log/FileLog');
@ -235,7 +235,7 @@ class CakeLog {
* @param integer $line Line that triggered the error * @param integer $line Line that triggered the error
* @param array $context Context * @param array $context Context
* @return void * @return void
**/ */
function handleError($code, $description, $file = null, $line = null, $context = null) { function handleError($code, $description, $file = null, $line = null, $context = null) {
if ($code === 2048 || $code === 8192) { if ($code === 2048 || $code === 8192) {
return; return;

View file

@ -244,7 +244,7 @@ class CakeSession extends Object {
* *
* @return boolean * @return boolean
* @deprecated Use CakeSession::delete instead * @deprecated Use CakeSession::delete instead
**/ */
function del($name) { function del($name) {
trigger_error('CakeSession::del() is deprecated, use CakeSession::delete() instead.', E_USER_WARNING); trigger_error('CakeSession::del() is deprecated, use CakeSession::delete() instead.', E_USER_WARNING);
return $this->delete($name); return $this->delete($name);

View file

@ -685,7 +685,7 @@ class App extends Object {
* *
* @param string $plugin CamelCased plugin name to find the path of. * @param string $plugin CamelCased plugin name to find the path of.
* @return string full path to the plugin. * @return string full path to the plugin.
**/ */
function pluginPath($plugin) { function pluginPath($plugin) {
$_this =& App::getInstance(); $_this =& App::getInstance();
$pluginDir = Inflector::underscore($plugin); $pluginDir = Inflector::underscore($plugin);

View file

@ -56,7 +56,7 @@ class Component extends Object {
* *
* @var array * @var array
* @access private * @access private
**/ */
var $__settings = array(); var $__settings = array();
/** /**

View file

@ -263,7 +263,7 @@ class CookieComponent extends Object {
/** /**
* @deprecated use delete() * @deprecated use delete()
**/ */
function del($key) { function del($key) {
trigger_error('Deprecated method, use CookieComponent::delete instead', E_USER_WARNING); trigger_error('Deprecated method, use CookieComponent::delete instead', E_USER_WARNING);
return $this->delete($key); return $this->delete($key);

View file

@ -37,7 +37,7 @@ class Inflector {
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_plural = array( var $_plural = array(
'rules' => array( 'rules' => array(
'/(s)tatus$/i' => '\1\2tatuses', '/(s)tatus$/i' => '\1\2tatuses',
@ -105,7 +105,7 @@ class Inflector {
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_singular = array( var $_singular = array(
'rules' => array( 'rules' => array(
'/(s)tatuses$/i' => '\1\2tatus', '/(s)tatuses$/i' => '\1\2tatus',
@ -155,7 +155,7 @@ class Inflector {
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_uninflected = array( var $_uninflected = array(
'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus',
'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps',
@ -176,7 +176,7 @@ class Inflector {
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_pluralized = array(); var $_pluralized = array();
/** /**
@ -184,7 +184,7 @@ class Inflector {
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_singularized = array(); var $_singularized = array();
/** /**

View file

@ -31,7 +31,7 @@ class FileLog {
* Path to save log files on. * Path to save log files on.
* *
* @var string * @var string
**/ */
var $_path = null; var $_path = null;
/** /**
@ -43,7 +43,7 @@ class FileLog {
* *
* @param array $options Options for the FileLog, see above. * @param array $options Options for the FileLog, see above.
* @return void * @return void
**/ */
function FileLog($options = array()) { function FileLog($options = array()) {
$options += array('path' => LOGS); $options += array('path' => LOGS);
$this->_path = $options['path']; $this->_path = $options['path'];
@ -55,7 +55,7 @@ class FileLog {
* @param string $type The type of log you are making. * @param string $type The type of log you are making.
* @param string $message The message you want to log. * @param string $message The message you want to log.
* @return boolean success of write. * @return boolean success of write.
**/ */
function write($type, $message) { function write($type, $message) {
$debugTypes = array('notice', 'info', 'debug'); $debugTypes = array('notice', 'info', 'debug');

View file

@ -36,7 +36,7 @@ class MagicDb extends Object {
* Holds the parsed MagicDb for this class instance * Holds the parsed MagicDb for this class instance
* *
* @var array * @var array
**/ */
var $db = array(); var $db = array();
/** /**
@ -45,7 +45,7 @@ class MagicDb extends Object {
* @var $magicDb mixed Can be an array containing the db, a magic db as a string, or a filename pointing to a magic db in .db or magic.db.php format * @var $magicDb mixed Can be an array containing the db, a magic db as a string, or a filename pointing to a magic db in .db or magic.db.php format
* @return boolean Returns false if reading / validation failed or true on success. * @return boolean Returns false if reading / validation failed or true on success.
* @author Felix * @author Felix
**/ */
function read($magicDb = null) { function read($magicDb = null) {
if (!is_string($magicDb) && !is_array($magicDb)) { if (!is_string($magicDb) && !is_array($magicDb)) {
return false; return false;

View file

@ -63,7 +63,7 @@ class CakeSchema extends Object {
* plugin name. * plugin name.
* *
* @var string * @var string
**/ */
var $plugin = null; var $plugin = null;
/** /**
@ -382,7 +382,7 @@ class CakeSchema extends Object {
* @param string $table Table name you want returned. * @param string $table Table name you want returned.
* @param array $fields Array of field information to generate the table with. * @param array $fields Array of field information to generate the table with.
* @return string Variable declaration for a schema class * @return string Variable declaration for a schema class
**/ */
function generateTable($table, $fields) { function generateTable($table, $fields) {
$out = "\tvar \${$table} = array(\n"; $out = "\tvar \${$table} = array(\n";
if (is_array($fields)) { if (is_array($fields)) {
@ -573,7 +573,7 @@ class CakeSchema extends Object {
* @param array $new New indexes * @param array $new New indexes
* @param array $old Old indexes * @param array $old Old indexes
* @return mixed False on failure, or an array of parameters to add & drop. * @return mixed False on failure, or an array of parameters to add & drop.
**/ */
function _compareTableParameters($new, $old) { function _compareTableParameters($new, $old) {
if (!is_array($new) || !is_array($old)) { if (!is_array($new) || !is_array($old)) {
return false; return false;

View file

@ -404,7 +404,7 @@ class DataSource extends Object {
* before establishing a connection. * before establishing a connection.
* *
* @return boolean Whether or not the Datasources conditions for use are met. * @return boolean Whether or not the Datasources conditions for use are met.
**/ */
function enabled() { function enabled() {
return true; return true;
} }

View file

@ -123,7 +123,7 @@ class DboAdodb extends DboSource {
* Check that AdoDB is available. * Check that AdoDB is available.
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return function_exists('NewADOConnection'); return function_exists('NewADOConnection');
} }

View file

@ -144,7 +144,7 @@ class DboDb2 extends DboSource {
* Check that the DB2 extension is installed/loaded * Check that the DB2 extension is installed/loaded
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('ibm_db2'); return extension_loaded('ibm_db2');
} }

View file

@ -117,7 +117,7 @@ class DboFirebird extends DboSource {
* Firebird Transaction commands. * Firebird Transaction commands.
* *
* @var array * @var array
**/ */
var $_commands = array( var $_commands = array(
'begin' => 'SET TRANSACTION', 'begin' => 'SET TRANSACTION',
'commit' => 'COMMIT', 'commit' => 'COMMIT',
@ -143,7 +143,7 @@ class DboFirebird extends DboSource {
* Check that the interbase extension is loaded * Check that the interbase extension is loaded
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('interbase'); return extension_loaded('interbase');
} }

View file

@ -162,7 +162,7 @@ class DboMssql extends DboSource {
* Check that MsSQL is installed/loaded * Check that MsSQL is installed/loaded
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('mssql'); return extension_loaded('mssql');
} }

View file

@ -352,7 +352,7 @@ class DboMysqlBase extends DboSource {
* @param array $parameters Parameters to add & drop. * @param array $parameters Parameters to add & drop.
* @return array Array of table property alteration statementes. * @return array Array of table property alteration statementes.
* @todo Implement this method. * @todo Implement this method.
**/ */
function _alterTableParameters($table, $parameters) { function _alterTableParameters($table, $parameters) {
if (isset($parameters['change'])) { if (isset($parameters['change'])) {
return $this->buildTableParameters($parameters['change']); return $this->buildTableParameters($parameters['change']);
@ -530,7 +530,7 @@ class DboMysql extends DboMysqlBase {
* Check whether the MySQL extension is installed/loaded * Check whether the MySQL extension is installed/loaded
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('mysql'); return extension_loaded('mysql');
} }

View file

@ -87,7 +87,7 @@ class DboMysqli extends DboMysqlBase {
* Check that MySQLi is installed/enabled * Check that MySQLi is installed/enabled
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('mysqli'); return extension_loaded('mysqli');
} }

View file

@ -110,7 +110,7 @@ class DboOdbc extends DboSource {
* Check if the ODBC extension is installed/loaded * Check if the ODBC extension is installed/loaded
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('odbc'); return extension_loaded('odbc');
} }

View file

@ -127,7 +127,7 @@ class DboPostgres extends DboSource {
* Check if PostgreSQL is enabled/loaded * Check if PostgreSQL is enabled/loaded
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('pgsql'); return extension_loaded('pgsql');
} }

View file

@ -141,7 +141,7 @@ class DboSqlite extends DboSource {
* Check that SQLite is enabled/installed * Check that SQLite is enabled/installed
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('sqlite'); return extension_loaded('sqlite');
} }

View file

@ -109,7 +109,7 @@ class DboSybase extends DboSource {
* Check that one of the sybase extensions is installed * Check that one of the sybase extensions is installed
* *
* @return boolean * @return boolean
**/ */
function enabled() { function enabled() {
return extension_loaded('sybase') || extension_loaded('sybase_ct'); return extension_loaded('sybase') || extension_loaded('sybase_ct');
} }

View file

@ -495,7 +495,7 @@ class DboSource extends DataSource {
* *
* @param boolean $sorted Get the queries sorted by time taken, defaults to false. * @param boolean $sorted Get the queries sorted by time taken, defaults to false.
* @return array Array of queries run as an array * @return array Array of queries run as an array
**/ */
function getLog($sorted = false) { function getLog($sorted = false) {
if ($sorted) { if ($sorted) {
$log = sortByKey($this->_queriesLog, 'took', 'desc', SORT_NUMERIC); $log = sortByKey($this->_queriesLog, 'took', 'desc', SORT_NUMERIC);
@ -967,7 +967,7 @@ class DboSource extends DataSource {
* @param object $model Model being merged onto * @param object $model Model being merged onto
* @param object $linkModel Model being merged * @param object $linkModel Model being merged
* @return void * @return void
**/ */
function __mergeHasMany(&$resultSet, $merge, $association, &$model, &$linkModel) { function __mergeHasMany(&$resultSet, $merge, $association, &$model, &$linkModel) {
foreach ($resultSet as $i => $value) { foreach ($resultSet as $i => $value) {
$count = 0; $count = 0;
@ -2483,7 +2483,7 @@ class DboSource extends DataSource {
* @param array $columnData The array of column data. * @param array $columnData The array of column data.
* @param string $position The position type to use. 'beforeDefault' or 'afterDefault' are common * @param string $position The position type to use. 'beforeDefault' or 'afterDefault' are common
* @return string a built column with the field parameters added. * @return string a built column with the field parameters added.
**/ */
function _buildFieldParameters($columnString, $columnData, $position) { function _buildFieldParameters($columnString, $columnData, $position) {
foreach ($this->fieldParameters as $paramName => $value) { foreach ($this->fieldParameters as $paramName => $value) {
if (isset($columnData[$paramName]) && $value['position'] == $position) { if (isset($columnData[$paramName]) && $value['position'] == $position) {

View file

@ -161,7 +161,7 @@ class Router {
* Builds __prefixes * Builds __prefixes
* *
* @return void * @return void
**/ */
function Router() { function Router() {
$this->__setPrefixes(); $this->__setPrefixes();
} }
@ -173,7 +173,7 @@ class Router {
* @return void * @return void
* @access private * @access private
* @todo Remove support for Routing.admin in future versions. * @todo Remove support for Routing.admin in future versions.
**/ */
function __setPrefixes() { function __setPrefixes() {
$routing = Configure::read('Routing'); $routing = Configure::read('Routing');
if (!empty($routing['admin'])) { if (!empty($routing['admin'])) {

View file

@ -225,7 +225,7 @@ class Helper extends Overloadable {
* *
* @param string $path The file path to timestamp, the path must be inside WWW_ROOT * @param string $path The file path to timestamp, the path must be inside WWW_ROOT
* @return string Path with a timestamp added, or not. * @return string Path with a timestamp added, or not.
**/ */
function assetTimestamp($path) { function assetTimestamp($path) {
$timestampEnabled = ( $timestampEnabled = (
(Configure::read('Asset.timestamp') === true && Configure::read() > 0) || (Configure::read('Asset.timestamp') === true && Configure::read() > 0) ||

View file

@ -143,14 +143,14 @@ class HtmlHelper extends AppHelper {
* *
* @var array * @var array
* @access private * @access private
**/ */
var $__includedScripts = array(); var $__includedScripts = array();
/** /**
* Options for the currently opened script block buffer if any. * Options for the currently opened script block buffer if any.
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_scriptBlockOptions = array(); var $_scriptBlockOptions = array();
/** /**
* Document type definitions * Document type definitions
@ -436,7 +436,7 @@ class HtmlHelper extends AppHelper {
* @param mixed $options Array of options, and html attributes see above. If boolean sets $options['inline'] = value * @param mixed $options Array of options, and html attributes see above. If boolean sets $options['inline'] = value
* @return mixed String of <script /> tags or null if $inline is false or if $once is true and the file has been * @return mixed String of <script /> tags or null if $inline is false or if $once is true and the file has been
* included before. * included before.
**/ */
function script($url, $options = array()) { function script($url, $options = array()) {
if (is_bool($options)) { if (is_bool($options)) {
list($inline, $options) = array($options, array()); list($inline, $options) = array($options, array());
@ -492,7 +492,7 @@ class HtmlHelper extends AppHelper {
* @param string $script The script to wrap * @param string $script The script to wrap
* @param array $options The options to use. * @param array $options The options to use.
* @return mixed string or null depending on the value of `$options['inline']` * @return mixed string or null depending on the value of `$options['inline']`
**/ */
function scriptBlock($script, $options = array()) { function scriptBlock($script, $options = array()) {
$options += array('safe' => true, 'inline' => true); $options += array('safe' => true, 'inline' => true);
if ($options['safe']) { if ($options['safe']) {
@ -521,7 +521,7 @@ class HtmlHelper extends AppHelper {
* *
* @param array $options Options for the code block. * @param array $options Options for the code block.
* @return void * @return void
**/ */
function scriptStart($options = array()) { function scriptStart($options = array()) {
$options += array('safe' => true, 'inline' => true); $options += array('safe' => true, 'inline' => true);
$this->_scriptBlockOptions = $options; $this->_scriptBlockOptions = $options;
@ -534,7 +534,7 @@ class HtmlHelper extends AppHelper {
* used when the scriptBlock was started * used when the scriptBlock was started
* *
* @return mixed depending on the settings of scriptStart() either a script tag or null * @return mixed depending on the settings of scriptStart() either a script tag or null
**/ */
function scriptEnd() { function scriptEnd() {
$buffer = ob_get_clean(); $buffer = ob_get_clean();
$options = $this->_scriptBlockOptions; $options = $this->_scriptBlockOptions;

View file

@ -319,7 +319,7 @@ class JavascriptHelper extends AppHelper {
* Encode a string into JSON. Converts and escapes necessary characters. * Encode a string into JSON. Converts and escapes necessary characters.
* *
* @return void * @return void
**/ */
function _utf8ToHex($string) { function _utf8ToHex($string) {
$length = strlen($string); $length = strlen($string);
$return = ''; $return = '';

View file

@ -27,7 +27,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* Option mappings for jQuery * Option mappings for jQuery
* *
* @var array * @var array
**/ */
var $_optionMap = array( var $_optionMap = array(
'request' => array( 'request' => array(
'type' => 'dataType', 'type' => 'dataType',
@ -55,7 +55,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* callback arguments lists * callback arguments lists
* *
* @var string * @var string
**/ */
var $_callbackArguments = array( var $_callbackArguments = array(
'slider' => array( 'slider' => array(
'start' => 'event, ui', 'start' => 'event, ui',
@ -103,7 +103,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* when jQuery is put into noConflict() mode. * when jQuery is put into noConflict() mode.
* *
* @var string * @var string
**/ */
var $jQueryObject = '$'; var $jQueryObject = '$';
/** /**
@ -116,7 +116,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param string $callbacks Array of callback / special options. * @param string $callbacks Array of callback / special options.
* @access public * @access public
* @return string * @return string
**/ */
function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) { function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) {
$options = $this->_mapOptions($method, $options); $options = $this->_mapOptions($method, $options);
$options = $this->_prepareCallbacks($method, $options); $options = $this->_prepareCallbacks($method, $options);
@ -133,7 +133,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* *
* @param string $selector The selector that is targeted * @param string $selector The selector that is targeted
* @return object instance of $this. Allows chained methods. * @return object instance of $this. Allows chained methods.
**/ */
function get($selector) { function get($selector) {
if ($selector == 'window' || $selector == 'document') { if ($selector == 'window' || $selector == 'document') {
$this->selection = $this->jQueryObject . '(' . $selector .')'; $this->selection = $this->jQueryObject . '(' . $selector .')';
@ -155,7 +155,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param string $callback The Javascript function you wish to trigger or the function literal * @param string $callback The Javascript function you wish to trigger or the function literal
* @param array $options Options for the event. * @param array $options Options for the event.
* @return string completed event handler * @return string completed event handler
**/ */
function event($type, $callback, $options = array()) { function event($type, $callback, $options = array()) {
$defaults = array('wrap' => true, 'stop' => true); $defaults = array('wrap' => true, 'stop' => true);
$options = array_merge($defaults, $options); $options = array_merge($defaults, $options);
@ -175,7 +175,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* *
* @param string $functionBody The code to run on domReady * @param string $functionBody The code to run on domReady
* @return string completed domReady method * @return string completed domReady method
**/ */
function domReady($functionBody) { function domReady($functionBody) {
$this->get('document'); $this->get('document');
return $this->event('ready', $functionBody, array('stop' => false)); return $this->event('ready', $functionBody, array('stop' => false));
@ -187,7 +187,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param string $method The method you want to apply to the selection * @param string $method The method you want to apply to the selection
* @param string $callback The function body you wish to apply during the iteration. * @param string $callback The function body you wish to apply during the iteration.
* @return string completed iteration * @return string completed iteration
**/ */
function each($callback) { function each($callback) {
return $this->selection . '.each(function () {' . $callback . '});'; return $this->selection . '.each(function () {' . $callback . '});';
} }
@ -199,7 +199,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the effect. * @param array $options Array of options for the effect.
* @return string completed string with effect. * @return string completed string with effect.
* @see JsBaseEngineHelper::effect() * @see JsBaseEngineHelper::effect()
**/ */
function effect($name, $options = array()) { function effect($name, $options = array()) {
$speed = null; $speed = null;
if (isset($options['speed']) && in_array($options['speed'], array('fast', 'slow'))) { if (isset($options['speed']) && in_array($options['speed'], array('fast', 'slow'))) {
@ -230,7 +230,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param mixed $url * @param mixed $url
* @param array $options * @param array $options
* @return string The completed ajax call. * @return string The completed ajax call.
**/ */
function request($url, $options = array()) { function request($url, $options = array()) {
$url = $this->url($url); $url = $this->url($url);
$options = $this->_mapOptions('request', $options); $options = $this->_mapOptions('request', $options);
@ -266,7 +266,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the sortable. * @param array $options Array of options for the sortable.
* @return string Completed sortable script. * @return string Completed sortable script.
* @see JsHelper::sortable() for options list. * @see JsHelper::sortable() for options list.
**/ */
function sortable($options = array()) { function sortable($options = array()) {
$template = '%s.sortable({%s});'; $template = '%s.sortable({%s});';
return $this->_methodTemplate('sortable', $template, $options); return $this->_methodTemplate('sortable', $template, $options);
@ -280,7 +280,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the draggable element. * @param array $options Array of options for the draggable element.
* @return string Completed Draggable script. * @return string Completed Draggable script.
* @see JsHelper::drag() for options list. * @see JsHelper::drag() for options list.
**/ */
function drag($options = array()) { function drag($options = array()) {
$template = '%s.draggable({%s});'; $template = '%s.draggable({%s});';
return $this->_methodTemplate('drag', $template, $options); return $this->_methodTemplate('drag', $template, $options);
@ -294,7 +294,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the droppable element. * @param array $options Array of options for the droppable element.
* @return string Completed Droppable script. * @return string Completed Droppable script.
* @see JsHelper::drop() for options list. * @see JsHelper::drop() for options list.
**/ */
function drop($options = array()) { function drop($options = array()) {
$template = '%s.droppable({%s});'; $template = '%s.droppable({%s});';
return $this->_methodTemplate('drop', $template, $options); return $this->_methodTemplate('drop', $template, $options);
@ -308,7 +308,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the droppable element. * @param array $options Array of options for the droppable element.
* @return string Completed Slider script. * @return string Completed Slider script.
* @see JsHelper::slider() for options list. * @see JsHelper::slider() for options list.
**/ */
function slider($options = array()) { function slider($options = array()) {
$callbacks = array('start', 'change', 'slide', 'stop'); $callbacks = array('start', 'change', 'slide', 'stop');
$template = '%s.slider({%s});'; $template = '%s.slider({%s});';
@ -322,7 +322,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
* @param array $options Options for the serialization * @param array $options Options for the serialization
* @return string completed form serialization script * @return string completed form serialization script
* @see JsHelper::serializeForm() for option list. * @see JsHelper::serializeForm() for option list.
**/ */
function serializeForm($options = array()) { function serializeForm($options = array()) {
$options = array_merge(array('isForm' => false, 'inline' => false), $options); $options = array_merge(array('isForm' => false, 'inline' => false), $options);
$selector = $this->selection; $selector = $this->selection;

View file

@ -26,20 +26,20 @@
* *
* @package cake * @package cake
* @subpackage cake.cake.libs.view.helpers * @subpackage cake.cake.libs.view.helpers
**/ */
class JsHelper extends AppHelper { class JsHelper extends AppHelper {
/** /**
* Whether or not you want scripts to be buffered or output. * Whether or not you want scripts to be buffered or output.
* *
* @var boolean * @var boolean
**/ */
var $bufferScripts = true; var $bufferScripts = true;
/** /**
* helpers * helpers
* *
* @var array * @var array
**/ */
var $helpers = array('Html', 'Form'); var $helpers = array('Html', 'Form');
/** /**
@ -47,14 +47,14 @@ class JsHelper extends AppHelper {
* *
* @var array * @var array
* @see JsHelper::set() * @see JsHelper::set()
**/ */
var $__jsVars = array(); var $__jsVars = array();
/** /**
* Scripts that are queued for output * Scripts that are queued for output
* *
* @var array * @var array
**/ */
var $__bufferedScripts = array(); var $__bufferedScripts = array();
/** /**
@ -62,14 +62,14 @@ class JsHelper extends AppHelper {
* *
* @var string * @var string
* @access private * @access private
**/ */
var $__engineName; var $__engineName;
/** /**
* The javascript variable created by set() variables. * The javascript variable created by set() variables.
* *
* @var string * @var string
**/ */
var $setVariable = APP_DIR; var $setVariable = APP_DIR;
/** /**
@ -78,7 +78,7 @@ class JsHelper extends AppHelper {
* @param array $settings Settings array contains name of engine helper. * @param array $settings Settings array contains name of engine helper.
* @access public * @access public
* @return void * @return void
**/ */
function __construct($settings = array()) { function __construct($settings = array()) {
$className = 'Jquery'; $className = 'Jquery';
if (is_array($settings) && isset($settings[0])) { if (is_array($settings) && isset($settings[0])) {
@ -115,7 +115,7 @@ class JsHelper extends AppHelper {
* @param array $params Parameters for the method being called. * @param array $params Parameters for the method being called.
* @access public * @access public
* @return mixed Depends on the return of the dispatched method, or it could be an instance of the EngineHelper * @return mixed Depends on the return of the dispatched method, or it could be an instance of the EngineHelper
**/ */
function call__($method, $params) { function call__($method, $params) {
if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) { if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) {
$buffer = false; $buffer = false;
@ -158,7 +158,7 @@ class JsHelper extends AppHelper {
* @param array $options Options to use for encoding JSON. See JsBaseEngineHelper::object() for more details. * @param array $options Options to use for encoding JSON. See JsBaseEngineHelper::object() for more details.
* @return string encoded JSON * @return string encoded JSON
* @deprecated Remove when support for PHP4 and Object::object are removed. * @deprecated Remove when support for PHP4 and Object::object are removed.
**/ */
function object($data = array(), $options = array()) { function object($data = array(), $options = array()) {
return $this->{$this->__engineName}->object($data, $options); return $this->{$this->__engineName}->object($data, $options);
} }
@ -178,7 +178,7 @@ class JsHelper extends AppHelper {
* *
* @param array $options options for the code block * @param array $options options for the code block
* @return string completed javascript tag. * @return string completed javascript tag.
**/ */
function writeBuffer($options = array()) { function writeBuffer($options = array()) {
$defaults = array('onDomReady' => true, 'inline' => true, 'cache' => false, 'clear' => true, 'safe' => true); $defaults = array('onDomReady' => true, 'inline' => true, 'cache' => false, 'clear' => true, 'safe' => true);
$options = array_merge($defaults, $options); $options = array_merge($defaults, $options);
@ -208,7 +208,7 @@ class JsHelper extends AppHelper {
* Write a script to the cached scripts. * Write a script to the cached scripts.
* *
* @return void * @return void
**/ */
function buffer($script) { function buffer($script) {
$this->__bufferedScripts[] = $script; $this->__bufferedScripts[] = $script;
} }
@ -218,7 +218,7 @@ class JsHelper extends AppHelper {
* *
* @param boolean $clear Whether or not to clear the script caches (default true) * @param boolean $clear Whether or not to clear the script caches (default true)
* @return array Array of scripts added to the request. * @return array Array of scripts added to the request.
**/ */
function getBuffer($clear = true) { function getBuffer($clear = true) {
$this->_createVars(); $this->_createVars();
$scripts = $this->__bufferedScripts; $scripts = $this->__bufferedScripts;
@ -233,7 +233,7 @@ class JsHelper extends AppHelper {
* Generates the object string for variables passed to javascript. * Generates the object string for variables passed to javascript.
* *
* @return string * @return string
**/ */
function _createVars() { function _createVars() {
if (!empty($this->__jsVars)) { if (!empty($this->__jsVars)) {
$setVar = (strpos($this->setVariable, '.')) ? $this->setVariable : 'var ' . $this->setVariable; $setVar = (strpos($this->setVariable, '.')) ? $this->setVariable : 'var ' . $this->setVariable;
@ -258,7 +258,7 @@ class JsHelper extends AppHelper {
* @param mixed $url Mixed either a string URL or an cake url array. * @param mixed $url Mixed either a string URL or an cake url array.
* @param array $options Options for both the HTML element and Js::request() * @param array $options Options for both the HTML element and Js::request()
* @return string Completed link. If buffering is disabled a script tag will be returned as well. * @return string Completed link. If buffering is disabled a script tag will be returned as well.
**/ */
function link($title, $url = null, $options = array()) { function link($title, $url = null, $options = array()) {
if (!isset($options['id'])) { if (!isset($options['id'])) {
$options['id'] = 'link-' . intval(mt_rand()); $options['id'] = 'link-' . intval(mt_rand());
@ -293,7 +293,7 @@ class JsHelper extends AppHelper {
* @param mixed $one * @param mixed $one
* @param mixed $two * @param mixed $two
* @return void * @return void
**/ */
function set($one, $two = null) { function set($one, $two = null) {
$data = null; $data = null;
if (is_array($one)) { if (is_array($one)) {
@ -322,7 +322,7 @@ class JsHelper extends AppHelper {
* @param string $title The display text of the submit button. * @param string $title The display text of the submit button.
* @param array $options Array of options to use. * @param array $options Array of options to use.
* @return string Completed submit button. * @return string Completed submit button.
**/ */
function submit($caption = null, $options = array()) { function submit($caption = null, $options = array()) {
if (!isset($options['id'])) { if (!isset($options['id'])) {
$options['id'] = 'submit-' . intval(mt_rand()); $options['id'] = 'submit-' . intval(mt_rand());
@ -364,7 +364,7 @@ class JsHelper extends AppHelper {
* @param array $options Options to filter. * @param array $options Options to filter.
* @param array $additional Array of additional keys to extract and include in the return options array. * @param array $additional Array of additional keys to extract and include in the return options array.
* @return array Array of options for non-js. * @return array Array of options for non-js.
**/ */
function _getHtmlOptions(&$options, $additional = array()) { function _getHtmlOptions(&$options, $additional = array()) {
$htmlKeys = array_merge(array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'), $additional); $htmlKeys = array_merge(array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'), $additional);
$htmlOptions = array(); $htmlOptions = array();
@ -388,14 +388,14 @@ class JsHelper extends AppHelper {
* Abstract Base Class for All JsEngines to extend. Provides generic methods. * Abstract Base Class for All JsEngines to extend. Provides generic methods.
* *
* @package cake.view.helpers * @package cake.view.helpers
**/ */
class JsBaseEngineHelper extends AppHelper { class JsBaseEngineHelper extends AppHelper {
/** /**
* Determines whether native JSON extension is used for encoding. Set by object constructor. * Determines whether native JSON extension is used for encoding. Set by object constructor.
* *
* @var boolean * @var boolean
* @access public * @access public
**/ */
var $useNative = false; var $useNative = false;
/** /**
@ -403,7 +403,7 @@ class JsBaseEngineHelper extends AppHelper {
* *
* @var string * @var string
* @access public * @access public
**/ */
var $selection; var $selection;
/** /**
@ -412,7 +412,7 @@ class JsBaseEngineHelper extends AppHelper {
* for end user use though. * for end user use though.
* *
* @var array * @var array
**/ */
var $_optionMap = array(); var $_optionMap = array();
/** /**
@ -420,21 +420,21 @@ class JsBaseEngineHelper extends AppHelper {
* This allows specific 'end point' methods to be automatically buffered by the JsHelper. * This allows specific 'end point' methods to be automatically buffered by the JsHelper.
* *
* @var array * @var array
**/ */
var $bufferedMethods = array('event', 'sortable', 'drag', 'drop', 'slider'); var $bufferedMethods = array('event', 'sortable', 'drag', 'drop', 'slider');
/** /**
* Contains a list of callback names -> default arguments. * Contains a list of callback names -> default arguments.
* *
* @var array * @var array
**/ */
var $_callbackArguments = array(); var $_callbackArguments = array();
/** /**
* Constructor. * Constructor.
* *
* @return void * @return void
**/ */
function __construct() { function __construct() {
$this->useNative = function_exists('json_encode'); $this->useNative = function_exists('json_encode');
} }
@ -445,7 +445,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $message Message you want to alter. * @param string $message Message you want to alter.
* @access public * @access public
* @return string completed alert() * @return string completed alert()
**/ */
function alert($message) { function alert($message) {
return 'alert("' . $this->escape($message) . '");'; return 'alert("' . $this->escape($message) . '");';
} }
@ -456,7 +456,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param mixed $url * @param mixed $url
* @param array $options * @param array $options
* @return string completed redirect in javascript * @return string completed redirect in javascript
**/ */
function redirect($url = null) { function redirect($url = null) {
return 'window.location = "' . Router::url($url) . '";'; return 'window.location = "' . Router::url($url) . '";';
} }
@ -467,7 +467,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $message Message you want confirmed. * @param string $message Message you want confirmed.
* @access public * @access public
* @return string completed confirm() * @return string completed confirm()
**/ */
function confirm($message) { function confirm($message) {
return 'confirm("' . $this->escape($message) . '");'; return 'confirm("' . $this->escape($message) . '");';
} }
@ -479,7 +479,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $message Message to use in the confirm dialog. * @param string $message Message to use in the confirm dialog.
* @access public * @access public
* @return string * @return string
**/ */
function confirmReturn($message) { function confirmReturn($message) {
$out = 'var _confirm = ' . $this->confirm($message); $out = 'var _confirm = ' . $this->confirm($message);
$out .= "if (!_confirm) {\n\treturn false;\n}"; $out .= "if (!_confirm) {\n\treturn false;\n}";
@ -493,7 +493,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $default Default message * @param string $default Default message
* @access public * @access public
* @return string completed prompt() * @return string completed prompt()
**/ */
function prompt($message, $default = '') { function prompt($message, $default = '') {
return 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '");'; return 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '");';
} }
@ -511,7 +511,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param array $options Set of options, see above. * @param array $options Set of options, see above.
* @return string A JSON code block * @return string A JSON code block
* @access public * @access public
**/ */
function object($data = array(), $options = array()) { function object($data = array(), $options = array()) {
$defaultOptions = array( $defaultOptions = array(
'prefix' => '', 'postfix' => '', 'prefix' => '', 'postfix' => '',
@ -571,7 +571,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param boolean $quoteStrings If false, leaves string values unquoted * @param boolean $quoteStrings If false, leaves string values unquoted
* @return string a JavaScript-safe/JSON representation of $val * @return string a JavaScript-safe/JSON representation of $val
* @access public * @access public
**/ */
function value($val, $quoteString = true) { function value($val, $quoteString = true) {
switch (true) { switch (true) {
case (is_array($val) || is_object($val)): case (is_array($val) || is_object($val)):
@ -611,7 +611,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $script String that needs to get escaped. * @param string $script String that needs to get escaped.
* @return string Escaped string. * @return string Escaped string.
* @access public * @access public
**/ */
function escape($string) { function escape($string) {
App::import('Core', 'Multibyte'); App::import('Core', 'Multibyte');
return $this->_utf8ToHex($string); return $this->_utf8ToHex($string);
@ -621,7 +621,7 @@ class JsBaseEngineHelper extends AppHelper {
* Encode a string into JSON. Converts and escapes necessary characters. * Encode a string into JSON. Converts and escapes necessary characters.
* *
* @return void * @return void
**/ */
function _utf8ToHex($string) { function _utf8ToHex($string) {
$length = strlen($string); $length = strlen($string);
$return = ''; $return = '';
@ -716,7 +716,7 @@ class JsBaseEngineHelper extends AppHelper {
* *
* @param string $selector The selector that is targeted * @param string $selector The selector that is targeted
* @return object instance of $this. Allows chained methods. * @return object instance of $this. Allows chained methods.
**/ */
function get($selector) { function get($selector) {
trigger_error(sprintf(__('%s does not have get() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have get() implemented', true), get_class($this)), E_USER_WARNING);
return $this; return $this;
@ -734,7 +734,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $callback The Javascript function you wish to trigger or the function literal * @param string $callback The Javascript function you wish to trigger or the function literal
* @param array $options Options for the event. * @param array $options Options for the event.
* @return string completed event handler * @return string completed event handler
**/ */
function event($type, $callback, $options = array()) { function event($type, $callback, $options = array()) {
trigger_error(sprintf(__('%s does not have event() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have event() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -744,7 +744,7 @@ class JsBaseEngineHelper extends AppHelper {
* *
* @param string $functionBody The code to run on domReady * @param string $functionBody The code to run on domReady
* @return string completed domReady method * @return string completed domReady method
**/ */
function domReady($functionBody) { function domReady($functionBody) {
trigger_error(sprintf(__('%s does not have domReady() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have domReady() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -754,7 +754,7 @@ class JsBaseEngineHelper extends AppHelper {
* *
* @param string $callback The function body you wish to apply during the iteration. * @param string $callback The function body you wish to apply during the iteration.
* @return string completed iteration * @return string completed iteration
**/ */
function each($callback) { function each($callback) {
trigger_error(sprintf(__('%s does not have each() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have each() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -781,7 +781,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $name The name of the effect to trigger. * @param string $name The name of the effect to trigger.
* @param array $options Array of options for the effect. * @param array $options Array of options for the effect.
* @return string completed string with effect. * @return string completed string with effect.
**/ */
function effect($name, $options) { function effect($name, $options) {
trigger_error(sprintf(__('%s does not have effect() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have effect() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -810,7 +810,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param mixed $url Array or String URL to target with the request. * @param mixed $url Array or String URL to target with the request.
* @param array $options Array of options. See above for cross library supported options * @param array $options Array of options. See above for cross library supported options
* @return string XHR request. * @return string XHR request.
**/ */
function request($url, $options = array()) { function request($url, $options = array()) {
trigger_error(sprintf(__('%s does not have request() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have request() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -833,7 +833,7 @@ class JsBaseEngineHelper extends AppHelper {
* *
* @param array $options Options array see above. * @param array $options Options array see above.
* @return string Completed drag script * @return string Completed drag script
**/ */
function drag($options = array()) { function drag($options = array()) {
trigger_error(sprintf(__('%s does not have drag() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have drag() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -854,7 +854,7 @@ class JsBaseEngineHelper extends AppHelper {
* - `leave` - Event fired when a drag is removed from a drop zone without being dropped. * - `leave` - Event fired when a drag is removed from a drop zone without being dropped.
* *
* @return string Completed drop script * @return string Completed drop script
**/ */
function drop($options = array()) { function drop($options = array()) {
trigger_error(sprintf(__('%s does not have drop() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have drop() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -878,7 +878,7 @@ class JsBaseEngineHelper extends AppHelper {
* *
* @param array $options Array of options for the sortable. See above. * @param array $options Array of options for the sortable. See above.
* @return string Completed sortable script. * @return string Completed sortable script.
**/ */
function sortable() { function sortable() {
trigger_error(sprintf(__('%s does not have sortable() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have sortable() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -901,7 +901,7 @@ class JsBaseEngineHelper extends AppHelper {
* - `complete` - Fired when the user stops sliding the handle * - `complete` - Fired when the user stops sliding the handle
* *
* @return string Completed slider script * @return string Completed slider script
**/ */
function slider() { function slider() {
trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING);
} }
@ -919,7 +919,7 @@ class JsBaseEngineHelper extends AppHelper {
* *
* @param array $options options for serialization generation. * @param array $options options for serialization generation.
* @return string completed form serialization script * @return string completed form serialization script
**/ */
function serializeForm() { function serializeForm() {
trigger_error( trigger_error(
sprintf(__('%s does not have serializeForm() implemented', true), get_class($this)), E_USER_WARNING sprintf(__('%s does not have serializeForm() implemented', true), get_class($this)), E_USER_WARNING
@ -935,7 +935,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param array $safeKeys Keys that should not be escaped. * @param array $safeKeys Keys that should not be escaped.
* @return string * @return string
* @access protected * @access protected
**/ */
function _parseOptions($options, $safeKeys = array()) { function _parseOptions($options, $safeKeys = array()) {
$out = array(); $out = array();
$safeKeys = array_flip($safeKeys); $safeKeys = array_flip($safeKeys);
@ -957,7 +957,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param array $options Array of options to map. * @param array $options Array of options to map.
* @return array Array of mapped options. * @return array Array of mapped options.
* @access protected * @access protected
**/ */
function _mapOptions($method, $options) { function _mapOptions($method, $options) {
if (!isset($this->_optionMap[$method])) { if (!isset($this->_optionMap[$method])) {
return $options; return $options;
@ -980,7 +980,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $callbacks Additional Keys that contain callbacks * @param string $callbacks Additional Keys that contain callbacks
* @access protected * @access protected
* @return array Array of options with callbacks added. * @return array Array of options with callbacks added.
**/ */
function _prepareCallbacks($method, $options, $callbacks = array()) { function _prepareCallbacks($method, $options, $callbacks = array()) {
$wrapCallbacks = true; $wrapCallbacks = true;
if (isset($options['wrapCallbacks'])) { if (isset($options['wrapCallbacks'])) {
@ -1016,7 +1016,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param string $method Name of method processing options for. * @param string $method Name of method processing options for.
* @param array $options Array of options to process. * @param array $options Array of options to process.
* @return string Parsed options string. * @return string Parsed options string.
**/ */
function _processOptions($method, $options) { function _processOptions($method, $options) {
$options = $this->_mapOptions($method, $options); $options = $this->_mapOptions($method, $options);
$options = $this->_prepareCallbacks($method, $options); $options = $this->_prepareCallbacks($method, $options);
@ -1030,7 +1030,7 @@ class JsBaseEngineHelper extends AppHelper {
* @param array $parameters Array of parameters to convert to a query string * @param array $parameters Array of parameters to convert to a query string
* @return string Querystring fragment * @return string Querystring fragment
* @access protected * @access protected
**/ */
function _toQuerystring($parameters) { function _toQuerystring($parameters) {
$out = ''; $out = '';
$keys = array_keys($parameters); $keys = array_keys($parameters);

View file

@ -32,7 +32,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* Option mappings for MooTools * Option mappings for MooTools
* *
* @var array * @var array
**/ */
var $_optionMap = array( var $_optionMap = array(
'request' => array( 'request' => array(
'complete' => 'onComplete', 'complete' => 'onComplete',
@ -70,7 +70,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* Contains a list of callback names -> default arguments. * Contains a list of callback names -> default arguments.
* *
* @var array * @var array
**/ */
var $_callbackArguments = array( var $_callbackArguments = array(
'slider' => array( 'slider' => array(
'onTick' => 'position', 'onTick' => 'position',
@ -116,7 +116,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* *
* @param string $selector The selector that is targeted * @param string $selector The selector that is targeted
* @return object instance of $this. Allows chained methods. * @return object instance of $this. Allows chained methods.
**/ */
function get($selector) { function get($selector) {
$this->_multipleSelection = false; $this->_multipleSelection = false;
if ($selector == 'window' || $selector == 'document') { if ($selector == 'window' || $selector == 'document') {
@ -144,7 +144,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param string $callback The Javascript function you wish to trigger or the function literal * @param string $callback The Javascript function you wish to trigger or the function literal
* @param array $options Options for the event. * @param array $options Options for the event.
* @return string completed event handler * @return string completed event handler
**/ */
function event($type, $callback, $options = array()) { function event($type, $callback, $options = array()) {
$defaults = array('wrap' => true, 'stop' => true); $defaults = array('wrap' => true, 'stop' => true);
$options = array_merge($defaults, $options); $options = array_merge($defaults, $options);
@ -165,7 +165,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* *
* @param string $functionBody The code to run on domReady * @param string $functionBody The code to run on domReady
* @return string completed domReady method * @return string completed domReady method
**/ */
function domReady($functionBody) { function domReady($functionBody) {
$this->selection = 'window'; $this->selection = 'window';
return $this->event('domready', $functionBody, array('stop' => false)); return $this->event('domready', $functionBody, array('stop' => false));
@ -177,7 +177,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param string $method The method you want to apply to the selection * @param string $method The method you want to apply to the selection
* @param string $callback The function body you wish to apply during the iteration. * @param string $callback The function body you wish to apply during the iteration.
* @return string completed iteration * @return string completed iteration
**/ */
function each($callback) { function each($callback) {
return $this->selection . '.each(function (item, index) {' . $callback . '});'; return $this->selection . '.each(function (item, index) {' . $callback . '});';
} }
@ -189,7 +189,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the effect. * @param array $options Array of options for the effect.
* @return string completed string with effect. * @return string completed string with effect.
* @see JsBaseEngineHelper::effect() * @see JsBaseEngineHelper::effect()
**/ */
function effect($name, $options = array()) { function effect($name, $options = array()) {
$speed = null; $speed = null;
if (isset($options['speed']) && in_array($options['speed'], array('fast', 'slow'))) { if (isset($options['speed']) && in_array($options['speed'], array('fast', 'slow'))) {
@ -231,7 +231,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param mixed $url * @param mixed $url
* @param array $options * @param array $options
* @return string The completed ajax call. * @return string The completed ajax call.
**/ */
function request($url, $options = array()) { function request($url, $options = array()) {
$url = $this->url($url); $url = $this->url($url);
$options = $this->_mapOptions('request', $options); $options = $this->_mapOptions('request', $options);
@ -270,7 +270,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the sortable. * @param array $options Array of options for the sortable.
* @return string Completed sortable script. * @return string Completed sortable script.
* @see JsHelper::sortable() for options list. * @see JsHelper::sortable() for options list.
**/ */
function sortable($options = array()) { function sortable($options = array()) {
$options = $this->_processOptions('sortable', $options); $options = $this->_processOptions('sortable', $options);
return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});';
@ -284,7 +284,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the draggable. * @param array $options Array of options for the draggable.
* @return string Completed draggable script. * @return string Completed draggable script.
* @see JsHelper::drag() for options list. * @see JsHelper::drag() for options list.
**/ */
function drag($options = array()) { function drag($options = array()) {
$options = $this->_processOptions('drag', $options); $options = $this->_processOptions('drag', $options);
return $this->selection . '.makeDraggable({' . $options . '});'; return $this->selection . '.makeDraggable({' . $options . '});';
@ -303,7 +303,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the droppable. * @param array $options Array of options for the droppable.
* @return string Completed droppable script. * @return string Completed droppable script.
* @see JsHelper::drop() for options list. * @see JsHelper::drop() for options list.
**/ */
function drop($options = array()) { function drop($options = array()) {
if (empty($options['drag'])) { if (empty($options['drag'])) {
trigger_error( trigger_error(
@ -333,7 +333,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the slider. * @param array $options Array of options for the slider.
* @return string Completed slider script. * @return string Completed slider script.
* @see JsHelper::slider() for options list. * @see JsHelper::slider() for options list.
**/ */
function slider($options = array()) { function slider($options = array()) {
$slider = $this->selection; $slider = $this->selection;
$this->get($options['handle']); $this->get($options['handle']);
@ -358,7 +358,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options. * @param array $options Array of options.
* @return string Completed serializeForm() snippet * @return string Completed serializeForm() snippet
* @see JsHelper::serializeForm() * @see JsHelper::serializeForm()
**/ */
function serializeForm($options = array()) { function serializeForm($options = array()) {
$options = array_merge(array('isForm' => false, 'inline' => false), $options); $options = array_merge(array('isForm' => false, 'inline' => false), $options);
$selection = $this->selection; $selection = $this->selection;

View file

@ -36,7 +36,7 @@ class NumberHelper extends AppHelper {
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_currencies = array( var $_currencies = array(
'USD' => array( 'USD' => array(
'before' => '$', 'after' => 'c', 'zero' => 0, 'places' => 2, 'thousands' => ',', 'before' => '$', 'after' => 'c', 'zero' => 0, 'places' => 2, 'thousands' => ',',
@ -57,7 +57,7 @@ class NumberHelper extends AppHelper {
* *
* @var array * @var array
* @access protected * @access protected
**/ */
var $_currencyDefaults = array( var $_currencyDefaults = array(
'before'=>'', 'after' => '', 'zero' => '0', 'places' => 2, 'thousands' => ',', 'before'=>'', 'after' => '', 'zero' => '0', 'places' => 2, 'thousands' => ',',
'decimals' => '.','negative' => '()', 'escape' => true 'decimals' => '.','negative' => '()', 'escape' => true
@ -222,7 +222,7 @@ class NumberHelper extends AppHelper {
* @param string $formatName The format name to be used in the future. * @param string $formatName The format name to be used in the future.
* @param array $options The array of options for this format. * @param array $options The array of options for this format.
* @return void * @return void
**/ */
function addFormat($formatName, $options) { function addFormat($formatName, $options) {
$this->_currencies[$formatName] = $options + $this->_currencyDefaults; $this->_currencies[$formatName] = $options + $this->_currencyDefaults;
} }

View file

@ -46,7 +46,7 @@ class PaginatorHelper extends AppHelper {
* The class used for 'Ajax' pagination links. * The class used for 'Ajax' pagination links.
* *
* @var string * @var string
**/ */
var $_ajaxHelperClass = 'Js'; var $_ajaxHelperClass = 'Js';
/** /**
@ -83,7 +83,7 @@ class PaginatorHelper extends AppHelper {
* The chosen custom helper must implement a `link()` method. * The chosen custom helper must implement a `link()` method.
* *
* @return void * @return void
**/ */
function __construct($config = array()) { function __construct($config = array()) {
$ajaxProvider = isset($config['ajax']) ? $config['ajax'] : 'Js'; $ajaxProvider = isset($config['ajax']) ? $config['ajax'] : 'Js';
$this->helpers[] = $ajaxProvider; $this->helpers[] = $ajaxProvider;

View file

@ -27,13 +27,13 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* Is the current selection a multiple selection? or is it just a single element. * Is the current selection a multiple selection? or is it just a single element.
* *
* @var boolean * @var boolean
**/ */
var $_multiple = false; var $_multiple = false;
/** /**
* Option mappings for Prototype * Option mappings for Prototype
* *
* @var array * @var array
**/ */
var $_optionMap = array( var $_optionMap = array(
'request' => array( 'request' => array(
'async' => 'asynchronous', 'async' => 'asynchronous',
@ -73,7 +73,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* Contains a list of callback names -> default arguments. * Contains a list of callback names -> default arguments.
* *
* @var array * @var array
**/ */
var $_callbackArguments = array( var $_callbackArguments = array(
'slider' => array( 'slider' => array(
'onSlide' => 'value', 'onSlide' => 'value',
@ -108,7 +108,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* *
* @param string $selector The selector that is targeted * @param string $selector The selector that is targeted
* @return object instance of $this. Allows chained methods. * @return object instance of $this. Allows chained methods.
**/ */
function get($selector) { function get($selector) {
$this->_multiple = false; $this->_multiple = false;
if ($selector == 'window' || $selector == 'document') { if ($selector == 'window' || $selector == 'document') {
@ -135,7 +135,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param string $callback The Javascript function you wish to trigger or the function literal * @param string $callback The Javascript function you wish to trigger or the function literal
* @param array $options Options for the event. * @param array $options Options for the event.
* @return string completed event handler * @return string completed event handler
**/ */
function event($type, $callback, $options = array()) { function event($type, $callback, $options = array()) {
$defaults = array('wrap' => true, 'stop' => true); $defaults = array('wrap' => true, 'stop' => true);
$options = array_merge($defaults, $options); $options = array_merge($defaults, $options);
@ -155,7 +155,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* *
* @param string $functionBody The code to run on domReady * @param string $functionBody The code to run on domReady
* @return string completed domReady method * @return string completed domReady method
**/ */
function domReady($functionBody) { function domReady($functionBody) {
$this->selection = 'document'; $this->selection = 'document';
return $this->event('dom:loaded', $functionBody, array('stop' => false)); return $this->event('dom:loaded', $functionBody, array('stop' => false));
@ -166,7 +166,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param string $method The method you want to apply to the selection * @param string $method The method you want to apply to the selection
* @param string $callback The function body you wish to apply during the iteration. * @param string $callback The function body you wish to apply during the iteration.
* @return string completed iteration * @return string completed iteration
**/ */
function each($callback) { function each($callback) {
return $this->selection . '.each(function (item, index) {' . $callback . '});'; return $this->selection . '.each(function (item, index) {' . $callback . '});';
} }
@ -179,7 +179,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the effect. * @param array $options Array of options for the effect.
* @return string completed string with effect. * @return string completed string with effect.
* @see JsBaseEngineHelper::effect() * @see JsBaseEngineHelper::effect()
**/ */
function effect($name, $options = array()) { function effect($name, $options = array()) {
$effect = ''; $effect = '';
$optionString = null; $optionString = null;
@ -220,7 +220,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param mixed $url * @param mixed $url
* @param array $options * @param array $options
* @return string The completed ajax call. * @return string The completed ajax call.
**/ */
function request($url, $options = array()) { function request($url, $options = array()) {
$url = '"'. $this->url($url) . '"'; $url = '"'. $this->url($url) . '"';
$options = $this->_mapOptions('request', $options); $options = $this->_mapOptions('request', $options);
@ -255,7 +255,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the sortable. * @param array $options Array of options for the sortable.
* @return string Completed sortable script. * @return string Completed sortable script.
* @see JsHelper::sortable() for options list. * @see JsHelper::sortable() for options list.
**/ */
function sortable($options = array()) { function sortable($options = array()) {
$options = $this->_processOptions('sortable', $options); $options = $this->_processOptions('sortable', $options);
if (!empty($options)) { if (!empty($options)) {
@ -271,7 +271,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the draggable. * @param array $options Array of options for the draggable.
* @return string Completed draggable script. * @return string Completed draggable script.
* @see JsHelper::draggable() for options list. * @see JsHelper::draggable() for options list.
**/ */
function drag($options = array()) { function drag($options = array()) {
$options = $this->_processOptions('drag', $options); $options = $this->_processOptions('drag', $options);
if (!empty($options)) { if (!empty($options)) {
@ -290,7 +290,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the droppable. * @param array $options Array of options for the droppable.
* @return string Completed droppable script. * @return string Completed droppable script.
* @see JsHelper::droppable() for options list. * @see JsHelper::droppable() for options list.
**/ */
function drop($options = array()) { function drop($options = array()) {
$options = $this->_processOptions('drop', $options); $options = $this->_processOptions('drop', $options);
if (!empty($options)) { if (!empty($options)) {
@ -306,7 +306,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options for the slider. * @param array $options Array of options for the slider.
* @return string Completed slider script. * @return string Completed slider script.
* @see JsHelper::slider() for options list. * @see JsHelper::slider() for options list.
**/ */
function slider($options = array()) { function slider($options = array()) {
$slider = $this->selection; $slider = $this->selection;
$this->get($options['handle']); $this->get($options['handle']);
@ -330,7 +330,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
* @param array $options Array of options. * @param array $options Array of options.
* @return string Completed serializeForm() snippet * @return string Completed serializeForm() snippet
* @see JsHelper::serializeForm() * @see JsHelper::serializeForm()
**/ */
function serializeForm($options = array()) { function serializeForm($options = array()) {
$options = array_merge(array('isForm' => false, 'inline' => false), $options); $options = array_merge(array('isForm' => false, 'inline' => false), $options);
$selection = $this->selection; $selection = $this->selection;

View file

@ -34,7 +34,7 @@ class RssHelper extends XmlHelper {
* *
* @var array * @var array
* @access public * @access public
**/ */
var $helpers = array('Time'); var $helpers = array('Time');
/** /**

View file

@ -252,7 +252,7 @@ class View extends Object {
* Holds View output. * Holds View output.
* *
* @var string * @var string
**/ */
var $output = false; var $output = false;
/** /**

View file

@ -33,8 +33,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* setUp method * setUp method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function setUp() { function setUp() {
App::build(array( App::build(array(
@ -46,8 +46,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* tearDown method * tearDown method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function tearDown() { function tearDown() {
App::build(); App::build();
@ -58,7 +58,8 @@ class BasicsTest extends CakeTestCase {
* test the array_diff_key compatibility function. * test the array_diff_key compatibility function.
* *
* @return void * @return void
**/ * @access public
*/
function testArrayDiffKey() { function testArrayDiffKey() {
$one = array('one' => 1, 'two' => 2, 'three' => 3); $one = array('one' => 1, 'two' => 2, 'three' => 3);
$two = array('one' => 'one', 'two' => 'two'); $two = array('one' => 'one', 'two' => 'two');
@ -175,8 +176,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test uses() * test uses()
* *
* @access public
* @return void * @return void
* @access public
* @deprecated * @deprecated
*/ */
function testUses() { function testUses() {
@ -194,8 +195,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* Test h() * Test h()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testH() { function testH() {
$string = '<foo>'; $string = '<foo>';
@ -211,8 +212,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* Test a() * Test a()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testA() { function testA() {
$result = a('this', 'that', 'bar'); $result = a('this', 'that', 'bar');
@ -222,8 +223,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* Test aa() * Test aa()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testAa() { function testAa() {
$result = aa('a', 'b', 'c', 'd'); $result = aa('a', 'b', 'c', 'd');
@ -238,8 +239,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* Test am() * Test am()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testAm() { function testAm() {
$result = am(array('one', 'two'), 2, 3, 4); $result = am(array('one', 'two'), 2, 3, 4);
@ -254,8 +255,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test cache() * test cache()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testCache() { function testCache() {
$_cacheDisable = Configure::read('Cache.disable'); $_cacheDisable = Configure::read('Cache.disable');
@ -290,8 +291,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test clearCache() * test clearCache()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testClearCache() { function testClearCache() {
$cacheOff = Configure::read('Cache.disable'); $cacheOff = Configure::read('Cache.disable');
@ -338,8 +339,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test __() * test __()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function test__() { function test__() {
Configure::write('Config.language', 'rule_1_po'); Configure::write('Config.language', 'rule_1_po');
@ -362,8 +363,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test __n() * test __n()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function test__n() { function test__n() {
Configure::write('Config.language', 'rule_1_po'); Configure::write('Config.language', 'rule_1_po');
@ -390,8 +391,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test __d() * test __d()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function test__d() { function test__d() {
Configure::write('Config.language', 'rule_1_po'); Configure::write('Config.language', 'rule_1_po');
@ -418,8 +419,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test __dn() * test __dn()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function test__dn() { function test__dn() {
Configure::write('Config.language', 'rule_1_po'); Configure::write('Config.language', 'rule_1_po');
@ -450,8 +451,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test __c() * test __c()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function test__c() { function test__c() {
Configure::write('Config.language', 'rule_1_po'); Configure::write('Config.language', 'rule_1_po');
@ -474,8 +475,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test __dc() * test __dc()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function test__dc() { function test__dc() {
Configure::write('Config.language', 'rule_1_po'); Configure::write('Config.language', 'rule_1_po');
@ -506,8 +507,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test __dcn() * test __dcn()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function test__dcn() { function test__dcn() {
Configure::write('Config.language', 'rule_1_po'); Configure::write('Config.language', 'rule_1_po');
@ -534,8 +535,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test LogError() * test LogError()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testLogError() { function testLogError() {
@unlink(LOGS . 'error.log'); @unlink(LOGS . 'error.log');
@ -552,8 +553,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test fileExistsInPath() * test fileExistsInPath()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testFileExistsInPath() { function testFileExistsInPath() {
$this->skipUnless(function_exists('ini_set'), '%s ini_set function not available'); $this->skipUnless(function_exists('ini_set'), '%s ini_set function not available');
@ -597,8 +598,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test convertSlash() * test convertSlash()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testConvertSlash() { function testConvertSlash() {
$result = convertSlash('\path\to\location\\'); $result = convertSlash('\path\to\location\\');
@ -613,8 +614,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test debug() * test debug()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testDebug() { function testDebug() {
ob_start(); ob_start();
@ -637,8 +638,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test pr() * test pr()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testPr() { function testPr() {
ob_start(); ob_start();
@ -657,8 +658,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test params() * test params()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testParams() { function testParams() {
$this->assertNull(params('weekend')); $this->assertNull(params('weekend'));
@ -675,8 +676,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test stripslashes_deep() * test stripslashes_deep()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testStripslashesDeep() { function testStripslashesDeep() {
$this->skipIf(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is on'); $this->skipIf(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is on');
@ -713,8 +714,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test stripslashes_deep() with magic_quotes_sybase on * test stripslashes_deep() with magic_quotes_sybase on
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testStripslashesDeepSybase() { function testStripslashesDeepSybase() {
$this->skipUnless(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is off'); $this->skipUnless(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is off');
@ -747,8 +748,8 @@ class BasicsTest extends CakeTestCase {
/** /**
* test ife() * test ife()
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testIfe() { function testIfe() {
$this->assertEqual(ife(true, 'a', 'b'), 'a'); $this->assertEqual(ife(true, 'a', 'b'), 'a');

View file

@ -41,8 +41,8 @@ class TestDispatcher extends Dispatcher {
* @param mixed $controller * @param mixed $controller
* @param mixed $params * @param mixed $params
* @param mixed $missingAction * @param mixed $missingAction
* @access protected
* @return void * @return void
* @access protected
*/ */
function _invoke(&$controller, $params) { function _invoke(&$controller, $params) {
restore_error_handler(); restore_error_handler();
@ -60,8 +60,8 @@ class TestDispatcher extends Dispatcher {
* cakeError method * cakeError method
* *
* @param mixed $filename * @param mixed $filename
* @access public
* @return void * @return void
* @access public
*/ */
function cakeError($filename, $params) { function cakeError($filename, $params) {
return array($filename, $params); return array($filename, $params);
@ -70,8 +70,8 @@ class TestDispatcher extends Dispatcher {
/** /**
* _stop method * _stop method
* *
* @access protected
* @return void * @return void
* @access protected
*/ */
function _stop() { function _stop() {
return true; return true;
@ -114,8 +114,8 @@ class MyPluginController extends MyPluginAppController {
/** /**
* index method * index method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function index() { function index() {
return true; return true;
@ -124,8 +124,8 @@ class MyPluginController extends MyPluginAppController {
/** /**
* add method * add method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function add() { function add() {
return true; return true;
@ -135,8 +135,8 @@ class MyPluginController extends MyPluginAppController {
* admin_add method * admin_add method
* *
* @param mixed $id * @param mixed $id
* @access public
* @return void * @return void
* @access public
*/ */
function admin_add($id = null) { function admin_add($id = null) {
return $id; return $id;
@ -171,8 +171,8 @@ class SomePagesController extends AppController {
* display method * display method
* *
* @param mixed $page * @param mixed $page
* @access public
* @return void * @return void
* @access public
*/ */
function display($page = null) { function display($page = null) {
return $page; return $page;
@ -181,8 +181,8 @@ class SomePagesController extends AppController {
/** /**
* index method * index method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function index() { function index() {
return true; return true;
@ -191,8 +191,8 @@ class SomePagesController extends AppController {
/** /**
* protected method * protected method
* *
* @access protected
* @return void * @return void
* @access protected
*/ */
function _protected() { function _protected() {
return true; return true;
@ -201,8 +201,8 @@ class SomePagesController extends AppController {
/** /**
* redirect method overriding * redirect method overriding
* *
* @access public
* @return void * @return void
* @access public
*/ */
function redirect() { function redirect() {
echo 'this should not be accessible'; echo 'this should not be accessible';
@ -237,8 +237,8 @@ class OtherPagesController extends MyPluginAppController {
* display method * display method
* *
* @param mixed $page * @param mixed $page
* @access public
* @return void * @return void
* @access public
*/ */
function display($page = null) { function display($page = null) {
return $page; return $page;
@ -247,8 +247,8 @@ class OtherPagesController extends MyPluginAppController {
/** /**
* index method * index method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function index() { function index() {
return true; return true;
@ -282,8 +282,8 @@ class TestDispatchPagesController extends AppController {
/** /**
* admin_index method * admin_index method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function admin_index() { function admin_index() {
return true; return true;
@ -292,8 +292,8 @@ class TestDispatchPagesController extends AppController {
/** /**
* camelCased method * camelCased method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function camelCased() { function camelCased() {
return true; return true;
@ -336,8 +336,8 @@ class ArticlesTestController extends ArticlesTestAppController {
/** /**
* admin_index method * admin_index method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function admin_index() { function admin_index() {
return true; return true;
@ -379,8 +379,8 @@ class SomePostsController extends AppController {
/** /**
* beforeFilter method * beforeFilter method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function beforeFilter() { function beforeFilter() {
if ($this->params['action'] == 'index') { if ($this->params['action'] == 'index') {
@ -394,8 +394,8 @@ class SomePostsController extends AppController {
/** /**
* index method * index method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function index() { function index() {
return true; return true;
@ -404,8 +404,8 @@ class SomePostsController extends AppController {
/** /**
* change method * change method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function change() { function change() {
return true; return true;
@ -466,8 +466,8 @@ class TestCachedPagesController extends AppController {
/** /**
* index method * index method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function index() { function index() {
$this->render(); $this->render();
@ -476,8 +476,8 @@ class TestCachedPagesController extends AppController {
/** /**
* test_nocache_tags method * test_nocache_tags method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function test_nocache_tags() { function test_nocache_tags() {
$this->render(); $this->render();
@ -486,8 +486,8 @@ class TestCachedPagesController extends AppController {
/** /**
* view method * view method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function view($id = null) { function view($id = null) {
$this->render('index'); $this->render('index');
@ -521,8 +521,8 @@ class TimesheetsController extends AppController {
/** /**
* index method * index method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function index() { function index() {
return true; return true;
@ -540,8 +540,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* setUp method * setUp method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function startTest() { function startTest() {
$this->_get = $_GET; $this->_get = $_GET;
@ -567,8 +567,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* tearDown method * tearDown method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function endTest() { function endTest() {
$_GET = $this->_get; $_GET = $this->_get;
@ -584,8 +584,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testParseParamsWithoutZerosAndEmptyPost method * testParseParamsWithoutZerosAndEmptyPost method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testParseParamsWithoutZerosAndEmptyPost() { function testParseParamsWithoutZerosAndEmptyPost() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -601,8 +601,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testParseParamsReturnsPostedData method * testParseParamsReturnsPostedData method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testParseParamsReturnsPostedData() { function testParseParamsReturnsPostedData() {
$_POST['testdata'] = "My Posted Content"; $_POST['testdata'] = "My Posted Content";
@ -615,8 +615,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testParseParamsWithSingleZero method * testParseParamsWithSingleZero method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testParseParamsWithSingleZero() { function testParseParamsWithSingleZero() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -631,8 +631,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testParseParamsWithManySingleZeros method * testParseParamsWithManySingleZeros method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testParseParamsWithManySingleZeros() { function testParseParamsWithManySingleZeros() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -648,8 +648,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testParseParamsWithManyZerosInEachSectionOfUrl method * testParseParamsWithManyZerosInEachSectionOfUrl method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testParseParamsWithManyZerosInEachSectionOfUrl() { function testParseParamsWithManyZerosInEachSectionOfUrl() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -665,8 +665,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl method * testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() { function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -682,8 +682,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testQueryStringOnRoot method * testQueryStringOnRoot method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testQueryStringOnRoot() { function testQueryStringOnRoot() {
Router::reload(); Router::reload();
@ -712,8 +712,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testFileUploadArrayStructure method * testFileUploadArrayStructure method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testFileUploadArrayStructure() { function testFileUploadArrayStructure() {
$_FILES = array('data' => array('name' => array( $_FILES = array('data' => array('name' => array(
@ -965,8 +965,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testGetUrl method * testGetUrl method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testGetUrl() { function testGetUrl() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -1005,8 +1005,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testBaseUrlAndWebrootWithModRewrite method * testBaseUrlAndWebrootWithModRewrite method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testBaseUrlAndWebrootWithModRewrite() { function testBaseUrlAndWebrootWithModRewrite() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -1081,8 +1081,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testBaseUrlwithModRewriteAlias method * testBaseUrlwithModRewriteAlias method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testBaseUrlwithModRewriteAlias() { function testBaseUrlwithModRewriteAlias() {
$_SERVER['DOCUMENT_ROOT'] = '/home/aplusnur/public_html'; $_SERVER['DOCUMENT_ROOT'] = '/home/aplusnur/public_html';
@ -1116,8 +1116,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testBaseUrlAndWebrootWithBaseUrl method * testBaseUrlAndWebrootWithBaseUrl method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testBaseUrlAndWebrootWithBaseUrl() { function testBaseUrlAndWebrootWithBaseUrl() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -1186,8 +1186,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testBaseUrlAndWebrootWithBase method * testBaseUrlAndWebrootWithBase method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testBaseUrlAndWebrootWithBase() { function testBaseUrlAndWebrootWithBase() {
$Dispatcher =& new Dispatcher(); $Dispatcher =& new Dispatcher();
@ -1217,8 +1217,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testMissingController method * testMissingController method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testMissingController() { function testMissingController() {
$Dispatcher =& new TestDispatcher(); $Dispatcher =& new TestDispatcher();
@ -1237,8 +1237,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testPrivate method * testPrivate method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testPrivate() { function testPrivate() {
$Dispatcher =& new TestDispatcher(); $Dispatcher =& new TestDispatcher();
@ -1260,8 +1260,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testMissingAction method * testMissingAction method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testMissingAction() { function testMissingAction() {
$Dispatcher =& new TestDispatcher(); $Dispatcher =& new TestDispatcher();
@ -1298,8 +1298,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testDispatch method * testDispatch method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testDispatch() { function testDispatch() {
$Dispatcher =& new TestDispatcher(); $Dispatcher =& new TestDispatcher();
@ -1353,8 +1353,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testDispatchWithArray method * testDispatchWithArray method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testDispatchWithArray() { function testDispatchWithArray() {
$Dispatcher =& new TestDispatcher(); $Dispatcher =& new TestDispatcher();
@ -1373,8 +1373,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testAdminDispatch method * testAdminDispatch method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testAdminDispatch() { function testAdminDispatch() {
$_POST = array(); $_POST = array();
@ -1404,8 +1404,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testPluginDispatch method * testPluginDispatch method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testPluginDispatch() { function testPluginDispatch() {
$_POST = array(); $_POST = array();
@ -1453,8 +1453,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testAutomaticPluginDispatch method * testAutomaticPluginDispatch method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testAutomaticPluginDispatch() { function testAutomaticPluginDispatch() {
$_POST = array(); $_POST = array();
@ -1491,8 +1491,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testAutomaticPluginControllerDispatch method * testAutomaticPluginControllerDispatch method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testAutomaticPluginControllerDispatch() { function testAutomaticPluginControllerDispatch() {
$_POST = array(); $_POST = array();
@ -1594,7 +1594,8 @@ class DispatcherTest extends CakeTestCase {
* plugin short form instead. * plugin short form instead.
* *
* @return void * @return void
**/ * @access public
*/
function testAutomaticPluginDispatchWithShortAccess() { function testAutomaticPluginDispatchWithShortAccess() {
$_POST = array(); $_POST = array();
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
@ -1642,8 +1643,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testAutomaticPluginControllerMissingActionDispatch method * testAutomaticPluginControllerMissingActionDispatch method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testAutomaticPluginControllerMissingActionDispatch() { function testAutomaticPluginControllerMissingActionDispatch() {
$_POST = array(); $_POST = array();
@ -1685,8 +1686,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testPrefixProtection method * testPrefixProtection method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testPrefixProtection() { function testPrefixProtection() {
$_POST = array(); $_POST = array();
@ -1715,7 +1716,8 @@ class DispatcherTest extends CakeTestCase {
* undocumented function * undocumented function
* *
* @return void * @return void
**/ * @access public
*/
function testTestPluginDispatch() { function testTestPluginDispatch() {
$Dispatcher =& new TestDispatcher(); $Dispatcher =& new TestDispatcher();
App::build(array( App::build(array(
@ -1734,8 +1736,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testChangingParamsFromBeforeFilter method * testChangingParamsFromBeforeFilter method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testChangingParamsFromBeforeFilter() { function testChangingParamsFromBeforeFilter() {
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
@ -1768,8 +1770,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testStaticAssets method * testStaticAssets method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testStaticAssets() { function testStaticAssets() {
Router::reload(); Router::reload();
@ -1845,8 +1847,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testFullPageCachingDispatch method * testFullPageCachingDispatch method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testFullPageCachingDispatch() { function testFullPageCachingDispatch() {
Configure::write('Cache.disable', false); Configure::write('Cache.disable', false);
@ -1981,8 +1983,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testHttpMethodOverrides method * testHttpMethodOverrides method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testHttpMethodOverrides() { function testHttpMethodOverrides() {
Router::reload(); Router::reload();
@ -2036,6 +2038,7 @@ class DispatcherTest extends CakeTestCase {
* Tests that invalid characters cannot be injected into the application base path. * Tests that invalid characters cannot be injected into the application base path.
* *
* @return void * @return void
* @access public
*/ */
function testBasePathInjection() { function testBasePathInjection() {
$self = $_SERVER['PHP_SELF']; $self = $_SERVER['PHP_SELF'];
@ -2052,8 +2055,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* testEnvironmentDetection method * testEnvironmentDetection method
* *
* @access public
* @return void * @return void
* @access public
*/ */
function testEnvironmentDetection() { function testEnvironmentDetection() {
$dispatcher =& new Dispatcher(); $dispatcher =& new Dispatcher();
@ -2158,8 +2161,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* Tests that the Dispatcher does not return an empty action * Tests that the Dispatcher does not return an empty action
* *
* @access private
* @return void * @return void
* @access public
*/ */
function testTrailingSlash() { function testTrailingSlash() {
$_POST = array(); $_POST = array();
@ -2184,8 +2187,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* backupEnvironment method * backupEnvironment method
* *
* @access private
* @return void * @return void
* @access private
*/ */
function __backupEnvironment() { function __backupEnvironment() {
return array( return array(
@ -2199,8 +2202,8 @@ class DispatcherTest extends CakeTestCase {
/** /**
* reloadEnvironment method * reloadEnvironment method
* *
* @access private
* @return void * @return void
* @access private
*/ */
function __reloadEnvironment() { function __reloadEnvironment() {
foreach ($_GET as $key => $val) { foreach ($_GET as $key => $val) {
@ -2219,8 +2222,8 @@ class DispatcherTest extends CakeTestCase {
* loadEnvironment method * loadEnvironment method
* *
* @param mixed $env * @param mixed $env
* @access private
* @return void * @return void
* @access private
*/ */
function __loadEnvironment($env) { function __loadEnvironment($env) {
if ($env['reload']) { if ($env['reload']) {
@ -2254,8 +2257,8 @@ class DispatcherTest extends CakeTestCase {
* cachePath method * cachePath method
* *
* @param mixed $her * @param mixed $her
* @access private
* @return string * @return string
* @access private
*/ */
function __cachePath($here) { function __cachePath($here) {
$path = $here; $path = $here;

View file

@ -32,7 +32,7 @@ class CakeLogTest extends CakeTestCase {
* Start test callback, clears all streams enabled. * Start test callback, clears all streams enabled.
* *
* @return void * @return void
**/ */
function startTest() { function startTest() {
$streams = CakeLog::streams(); $streams = CakeLog::streams();
foreach ($streams as $stream) { foreach ($streams as $stream) {
@ -44,7 +44,7 @@ class CakeLogTest extends CakeTestCase {
* test importing loggers from app/libs and plugins. * test importing loggers from app/libs and plugins.
* *
* @return void * @return void
**/ */
function testImportingLoggers() { function testImportingLoggers() {
App::build(array( App::build(array(
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS), 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
@ -70,7 +70,7 @@ class CakeLogTest extends CakeTestCase {
* test all the errors from failed logger imports * test all the errors from failed logger imports
* *
* @return void * @return void
**/ */
function testImportingLoggerFailure() { function testImportingLoggerFailure() {
$this->expectError('Missing logger classname'); $this->expectError('Missing logger classname');
CakeLog::config('fail', array()); CakeLog::config('fail', array());
@ -87,7 +87,7 @@ class CakeLogTest extends CakeTestCase {
* When no streams are there. * When no streams are there.
* *
* @return void * @return void
**/ */
function testAutoConfig() { function testAutoConfig() {
@unlink(LOGS . 'error.log'); @unlink(LOGS . 'error.log');
CakeLog::write(LOG_WARNING, 'Test warning'); CakeLog::write(LOG_WARNING, 'Test warning');
@ -102,7 +102,7 @@ class CakeLogTest extends CakeTestCase {
* test configuring log streams * test configuring log streams
* *
* @return void * @return void
**/ */
function testConfig() { function testConfig() {
CakeLog::config('file', array( CakeLog::config('file', array(
'engine' => 'FileLog', 'engine' => 'FileLog',
@ -145,7 +145,7 @@ class CakeLogTest extends CakeTestCase {
* Test logging with the error handler. * Test logging with the error handler.
* *
* @return void * @return void
**/ */
function testLoggingWithErrorHandling() { function testLoggingWithErrorHandling() {
@unlink(LOGS . 'debug.log'); @unlink(LOGS . 'debug.log');
Configure::write('log', E_ALL & ~E_DEPRECATED); Configure::write('log', E_ALL & ~E_DEPRECATED);

View file

@ -257,7 +257,7 @@ class CakeTestCaseTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testTestAction() { function testTestAction() {
App::build(array( App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
@ -389,7 +389,7 @@ class CakeTestCaseTest extends CakeTestCase {
* testSkipIf * testSkipIf
* *
* @return void * @return void
**/ */
function testSkipIf() { function testSkipIf() {
$this->assertTrue($this->Case->skipIf(true)); $this->assertTrue($this->Case->skipIf(true));
$this->assertFalse($this->Case->skipIf(false)); $this->assertFalse($this->Case->skipIf(false));

View file

@ -110,7 +110,7 @@ class CakeTestFixtureDefaultImportFixture extends CakeTestFixture {
* *
* @package default * @package default
* @subpackage cake.cake.tests.cases.libs. * @subpackage cake.cake.tests.cases.libs.
**/ */
class FixtureImportTestModel extends Model { class FixtureImportTestModel extends Model {
var $name = 'FixtureImport'; var $name = 'FixtureImport';
var $useTable = 'fixture_tests'; var $useTable = 'fixture_tests';

View file

@ -45,7 +45,7 @@ class CodeCoverageManagerTest extends CakeTestCase {
* Store reference of $_GET to restore later. * Store reference of $_GET to restore later.
* *
* @return void * @return void
**/ */
function startCase() { function startCase() {
$this->_get = $_GET; $this->_get = $_GET;
} }
@ -54,7 +54,7 @@ class CodeCoverageManagerTest extends CakeTestCase {
* End Case - restore GET vars. * End Case - restore GET vars.
* *
* @return void * @return void
**/ */
function endCase() { function endCase() {
$_GET = $this->_get; $_GET = $this->_get;
} }

View file

@ -136,7 +136,7 @@ class ConfigureTest extends CakeTestCase {
* testSetErrorReporting Level * testSetErrorReporting Level
* *
* @return void * @return void
**/ */
function testSetErrorReportingLevel() { function testSetErrorReportingLevel() {
Configure::write('log', false); Configure::write('log', false);
@ -160,7 +160,7 @@ class ConfigureTest extends CakeTestCase {
* test that log and debug configure values interact well. * test that log and debug configure values interact well.
* *
* @return void * @return void
**/ */
function testInteractionOfDebugAndLog() { function testInteractionOfDebugAndLog() {
Configure::write('log', false); Configure::write('log', false);

View file

@ -477,7 +477,7 @@ class ComponentTest extends CakeTestCase {
* Ensure that settings are not duplicated when passed into component initialize. * Ensure that settings are not duplicated when passed into component initialize.
* *
* @return void * @return void
**/ */
function testComponentParamsNoDuplication() { function testComponentParamsNoDuplication() {
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) { if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
return; return;

View file

@ -767,7 +767,7 @@ class AuthTest extends CakeTestCase {
* test authorize = 'actions' setting. * test authorize = 'actions' setting.
* *
* @return void * @return void
**/ */
function testAuthorizeActions() { function testAuthorizeActions() {
$this->AuthUser =& new AuthUser(); $this->AuthUser =& new AuthUser();
$user = $this->AuthUser->find(); $user = $this->AuthUser->find();
@ -827,7 +827,7 @@ class AuthTest extends CakeTestCase {
* test the action() method * test the action() method
* *
* @return void * @return void
**/ */
function testActionMethod() { function testActionMethod() {
$this->Controller->params['controller'] = 'auth_test'; $this->Controller->params['controller'] = 'auth_test';
$this->Controller->params['action'] = 'add'; $this->Controller->params['action'] = 'add';
@ -856,7 +856,7 @@ class AuthTest extends CakeTestCase {
* test that deny() converts camel case inputs to lowercase. * test that deny() converts camel case inputs to lowercase.
* *
* @return void * @return void
**/ */
function testDenyWithCamelCaseMethods() { function testDenyWithCamelCaseMethods() {
$this->Controller->Auth->initialize($this->Controller); $this->Controller->Auth->initialize($this->Controller);
$this->Controller->Auth->allow('*'); $this->Controller->Auth->allow('*');
@ -873,7 +873,7 @@ class AuthTest extends CakeTestCase {
* test that allow() and allowedActions work with camelCase method names. * test that allow() and allowedActions work with camelCase method names.
* *
* @return void * @return void
**/ */
function testAllowedActionsWithCamelCaseMethods() { function testAllowedActionsWithCamelCaseMethods() {
$url = '/auth_test/camelCase'; $url = '/auth_test/camelCase';
$this->Controller->params = Router::parse($url); $this->Controller->params = Router::parse($url);
@ -1099,7 +1099,7 @@ class AuthTest extends CakeTestCase {
* And the user doesn't have a session. * And the user doesn't have a session.
* *
* @return void * @return void
**/ */
function testNoRedirectOn404() { function testNoRedirectOn404() {
$this->Controller->Session->delete('Auth'); $this->Controller->Session->delete('Auth');
$this->Controller->Auth->initialize($this->Controller); $this->Controller->Auth->initialize($this->Controller);
@ -1201,7 +1201,7 @@ class AuthTest extends CakeTestCase {
* test Hashing of passwords * test Hashing of passwords
* *
* @return void * @return void
**/ */
function testHashPasswords() { function testHashPasswords() {
$this->Controller->Auth->userModel = 'AuthUser'; $this->Controller->Auth->userModel = 'AuthUser';

View file

@ -37,7 +37,7 @@ class RequestHandlerTestController extends Controller {
* *
* @var string * @var string
* @access public * @access public
**/ */
var $name = 'RequestHandlerTest'; var $name = 'RequestHandlerTest';
/** /**
@ -66,7 +66,7 @@ class RequestHandlerTestController extends Controller {
* test method for ajax redirection * test method for ajax redirection
* *
* @return void * @return void
**/ */
function destination() { function destination() {
$this->viewPath = 'posts'; $this->viewPath = 'posts';
$this->render('index'); $this->render('index');
@ -245,7 +245,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
* testStartupCallback with charset. * testStartupCallback with charset.
* *
* @return void * @return void
**/ */
function testStartupCallbackCharset() { function testStartupCallbackCharset() {
$_SERVER['REQUEST_METHOD'] = 'PUT'; $_SERVER['REQUEST_METHOD'] = 'PUT';
$_SERVER['CONTENT_TYPE'] = 'application/xml; charset=UTF-8'; $_SERVER['CONTENT_TYPE'] = 'application/xml; charset=UTF-8';
@ -287,7 +287,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
* *
* @link #6466 * @link #6466
* @return void * @return void
**/ */
function testRenderAsCalledTwice() { function testRenderAsCalledTwice() {
$this->RequestHandler->renderAs($this->Controller, 'xml'); $this->RequestHandler->renderAs($this->Controller, 'xml');
$this->assertEqual($this->Controller->viewPath, 'request_handler_test' . DS . 'xml'); $this->assertEqual($this->Controller->viewPath, 'request_handler_test' . DS . 'xml');
@ -551,7 +551,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
* test that ajax requests involving redirects trigger requestAction instead. * test that ajax requests involving redirects trigger requestAction instead.
* *
* @return void * @return void
**/ */
function testAjaxRedirectAsRequestAction() { function testAjaxRedirectAsRequestAction() {
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
$this->_init(); $this->_init();

View file

@ -564,7 +564,7 @@ DIGEST;
* test that validatePost fails if any of its required fields are missing. * test that validatePost fails if any of its required fields are missing.
* *
* @return void * @return void
**/ */
function testValidatePostFormHacking() { function testValidatePostFormHacking() {
$this->Controller->Security->startup($this->Controller); $this->Controller->Security->startup($this->Controller);
$key = $this->Controller->params['_Token']['key']; $key = $this->Controller->params['_Token']['key'];
@ -676,7 +676,7 @@ DIGEST;
* test ValidatePost with multiple select elements. * test ValidatePost with multiple select elements.
* *
* @return void * @return void
**/ */
function testValidatePostMultipleSelect() { function testValidatePostMultipleSelect() {
$this->Controller->Security->startup($this->Controller); $this->Controller->Security->startup($this->Controller);
$key = $this->Controller->params['_Token']['key']; $key = $this->Controller->params['_Token']['key'];

View file

@ -252,7 +252,7 @@ class ControllerPaginateModel extends CakeTestModel {
* *
* @return void * @return void
* @access public * @access public
**/ */
function paginate($conditions, $fields, $order, $limit, $page, $recursive, $extra) { function paginate($conditions, $fields, $order, $limit, $page, $recursive, $extra) {
$this->extra = $extra; $this->extra = $extra;
} }
@ -673,7 +673,7 @@ class ControllerTest extends CakeTestCase {
* Test that special paginate types are called and that the type param doesn't leak out into defaults or options. * Test that special paginate types are called and that the type param doesn't leak out into defaults or options.
* *
* @return void * @return void
**/ */
function testPaginateSpecialType() { function testPaginateSpecialType() {
$Controller =& new Controller(); $Controller =& new Controller();
$Controller->uses = array('ControllerPost', 'ControllerComment'); $Controller->uses = array('ControllerPost', 'ControllerComment');
@ -1029,7 +1029,7 @@ class ControllerTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testChildComponentOptionsSupercedeParents() { function testChildComponentOptionsSupercedeParents() {
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) { if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
return; return;
@ -1046,7 +1046,7 @@ class ControllerTest extends CakeTestCase {
* AppController when you make an instance of Controller * AppController when you make an instance of Controller
* *
* @return void * @return void
**/ */
function testMergeVarsNotGreedy() { function testMergeVarsNotGreedy() {
$Controller =& new Controller(); $Controller =& new Controller();
$Controller->components = array(); $Controller->components = array();

View file

@ -20,23 +20,26 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/ */
if (!class_exists('AppController')) { if (!class_exists('AppController')) {
/**
* Test case AppController requred /**
* Test case AppController
* *
* @package cake.tests.cases.libs.controller * @package cake
**/ * @subpackage cake.tests.cases.libs.controller
*/
class AppController extends Controller { class AppController extends Controller {
/**
/**
* components * components
* *
* @var array * @var array
**/ */
var $components = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false)); var $components = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false));
/** /**
* helpers * helpers
* *
* @var array * @var array
**/ */
var $helpers = array('MergeVar' => array('format' => 'html', 'terse')); var $helpers = array('MergeVar' => array('format' => 'html', 'terse'));
} }
} elseif (!defined('APP_CONTROLLER_EXISTS')) { } elseif (!defined('APP_CONTROLLER_EXISTS')) {
@ -47,7 +50,7 @@ if (!class_exists('AppController')) {
* MergeVar Component * MergeVar Component
* *
* @package cake.tests.cases.libs.controller * @package cake.tests.cases.libs.controller
**/ */
class MergeVarComponent extends Object { class MergeVarComponent extends Object {
} }
@ -56,21 +59,21 @@ class MergeVarComponent extends Object {
* Additional controller for testing * Additional controller for testing
* *
* @package cake.tests.cases.libs.controller * @package cake.tests.cases.libs.controller
**/ */
class MergeVariablesController extends AppController { class MergeVariablesController extends AppController {
/** /**
* name * name
* *
* @var string * @var string
**/ */
var $name = 'MergeVariables'; var $name = 'MergeVariables';
/** /**
* uses * uses
* *
* @var arrays * @var arrays
**/ */
var $uses = array(); var $uses = array();
} }
@ -78,21 +81,21 @@ class MergeVariablesController extends AppController {
* MergeVarPlugin App Controller * MergeVarPlugin App Controller
* *
* @package cake.tests.cases.libs.controller * @package cake.tests.cases.libs.controller
**/ */
class MergeVarPluginAppController extends AppController { class MergeVarPluginAppController extends AppController {
/** /**
* components * components
* *
* @var array * @var array
**/ */
var $components = array('Auth' => array('setting' => 'val', 'otherVal')); var $components = array('Auth' => array('setting' => 'val', 'otherVal'));
/** /**
* helpers * helpers
* *
* @var array * @var array
**/ */
var $helpers = array('Javascript'); var $helpers = array('Javascript');
} }
@ -100,21 +103,21 @@ class MergeVarPluginAppController extends AppController {
* MergePostsController * MergePostsController
* *
* @package cake.tests.cases.libs.controller * @package cake.tests.cases.libs.controller
**/ */
class MergePostsController extends MergeVarPluginAppController { class MergePostsController extends MergeVarPluginAppController {
/** /**
* name * name
* *
* @var string * @var string
**/ */
var $name = 'MergePosts'; var $name = 'MergePosts';
/** /**
* uses * uses
* *
* @var array * @var array
**/ */
var $uses = array(); var $uses = array();
} }
@ -123,13 +126,13 @@ class MergePostsController extends MergeVarPluginAppController {
* Test Case for Controller Merging of Vars. * Test Case for Controller Merging of Vars.
* *
* @package cake.tests.cases.libs.controller * @package cake.tests.cases.libs.controller
**/ */
class ControllerMergeVarsTestCase extends CakeTestCase { class ControllerMergeVarsTestCase extends CakeTestCase {
/** /**
* Skips the case if APP_CONTROLLER_EXISTS is defined * Skips the case if APP_CONTROLLER_EXISTS is defined
* *
* @return void * @return void
**/ */
function skip() { function skip() {
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), 'APP_CONTROLLER_EXISTS cannot run. %s'); $this->skipIf(defined('APP_CONTROLLER_EXISTS'), 'APP_CONTROLLER_EXISTS cannot run. %s');
} }
@ -137,7 +140,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* end test * end test
* *
* @return void * @return void
**/ */
function endTest() { function endTest() {
ClassRegistry::flush(); ClassRegistry::flush();
} }
@ -146,7 +149,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* test that component settings are not duplicated when merging component settings * test that component settings are not duplicated when merging component settings
* *
* @return void * @return void
**/ */
function testComponentParamMergingNoDuplication() { function testComponentParamMergingNoDuplication() {
$Controller =& new MergeVariablesController(); $Controller =& new MergeVariablesController();
$Controller->constructClasses(); $Controller->constructClasses();
@ -159,7 +162,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* test component merges with redeclared components * test component merges with redeclared components
* *
* @return void * @return void
**/ */
function testComponentMergingWithRedeclarations() { function testComponentMergingWithRedeclarations() {
$Controller =& new MergeVariablesController(); $Controller =& new MergeVariablesController();
$Controller->components['MergeVar'] = array('remote', 'redirect' => true); $Controller->components['MergeVar'] = array('remote', 'redirect' => true);
@ -173,7 +176,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* test merging of helpers array, ensure no duplication occurs * test merging of helpers array, ensure no duplication occurs
* *
* @return void * @return void
**/ */
function testHelperSettingMergingNoDuplication() { function testHelperSettingMergingNoDuplication() {
$Controller =& new MergeVariablesController(); $Controller =& new MergeVariablesController();
$Controller->constructClasses(); $Controller->constructClasses();
@ -186,7 +189,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* test merging of vars with plugin * test merging of vars with plugin
* *
* @return void * @return void
**/ */
function testMergeVarsWithPlugin() { function testMergeVarsWithPlugin() {
$Controller =& new MergePostsController(); $Controller =& new MergePostsController();
$Controller->components = array('Email' => array('ports' => 'open')); $Controller->components = array('Email' => array('ports' => 'open'));
@ -223,7 +226,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
* AppController when you make an instance of Controller * AppController when you make an instance of Controller
* *
* @return void * @return void
**/ */
function testMergeVarsNotGreedy() { function testMergeVarsNotGreedy() {
$Controller =& new Controller(); $Controller =& new Controller();
$Controller->components = array(); $Controller->components = array();

View file

@ -153,7 +153,7 @@ class ScaffoldMock extends CakeTestModel {
* hasAndBelongsToMany property * hasAndBelongsToMany property
* *
* @var string * @var string
**/ */
var $hasAndBelongsToMany = array( var $hasAndBelongsToMany = array(
'ScaffoldTag' => array( 'ScaffoldTag' => array(
'className' => 'ScaffoldTag', 'className' => 'ScaffoldTag',
@ -387,7 +387,7 @@ class ScaffoldViewTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testIndexScaffold() { function testIndexScaffold() {
$this->Controller->action = 'index'; $this->Controller->action = 'index';
$this->Controller->here = '/scaffold_mock'; $this->Controller->here = '/scaffold_mock';
@ -426,7 +426,7 @@ class ScaffoldViewTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testViewScaffold() { function testViewScaffold() {
$this->Controller->action = 'view'; $this->Controller->action = 'view';
$this->Controller->here = '/scaffold_mock'; $this->Controller->here = '/scaffold_mock';
@ -468,7 +468,7 @@ class ScaffoldViewTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testEditScaffold() { function testEditScaffold() {
$this->Controller->action = 'edit'; $this->Controller->action = 'edit';
$this->Controller->here = '/scaffold_mock'; $this->Controller->here = '/scaffold_mock';
@ -509,7 +509,7 @@ class ScaffoldViewTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testAdminIndexScaffold() { function testAdminIndexScaffold() {
$_backAdmin = Configure::read('Routing.prefixes'); $_backAdmin = Configure::read('Routing.prefixes');
@ -554,7 +554,7 @@ class ScaffoldViewTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testAdminEditScaffold() { function testAdminEditScaffold() {
$_backAdmin = Configure::read('Routing.prefixes'); $_backAdmin = Configure::read('Routing.prefixes');
@ -597,7 +597,7 @@ class ScaffoldViewTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testMultiplePrefixScaffold() { function testMultiplePrefixScaffold() {
$_backAdmin = Configure::read('Routing.prefixes'); $_backAdmin = Configure::read('Routing.prefixes');
@ -718,7 +718,7 @@ class ScaffoldTest extends CakeTestCase {
* test that the proper names and variable values are set by Scaffold * test that the proper names and variable values are set by Scaffold
* *
* @return void * @return void
**/ */
function testScaffoldVariableSetting() { function testScaffoldVariableSetting() {
$this->Controller->action = 'admin_edit'; $this->Controller->action = 'admin_edit';
$this->Controller->here = '/admin/scaffold_mock/edit'; $this->Controller->here = '/admin/scaffold_mock/edit';
@ -757,7 +757,7 @@ class ScaffoldTest extends CakeTestCase {
* test that scaffold outputs flash messages when sessions are unset. * test that scaffold outputs flash messages when sessions are unset.
* *
* @return void * @return void
**/ */
function testScaffoldFlashMessages() { function testScaffoldFlashMessages() {
$this->Controller->action = 'edit'; $this->Controller->action = 'edit';
$this->Controller->here = '/scaffold_mock'; $this->Controller->here = '/scaffold_mock';
@ -797,7 +797,7 @@ class ScaffoldTest extends CakeTestCase {
* *
* @see http://code.cakephp.org/tickets/view/48 * @see http://code.cakephp.org/tickets/view/48
* @return void * @return void
**/ */
function testHabtmFieldAdditionWithScaffoldForm() { function testHabtmFieldAdditionWithScaffoldForm() {
$this->Controller->action = 'edit'; $this->Controller->action = 'edit';
$this->Controller->here = '/scaffold_mock'; $this->Controller->here = '/scaffold_mock';
@ -830,7 +830,7 @@ class ScaffoldTest extends CakeTestCase {
* test that the proper names and variable values are set by Scaffold * test that the proper names and variable values are set by Scaffold
* *
* @return void * @return void
**/ */
function testEditScaffoldWithScaffoldFields() { function testEditScaffoldWithScaffoldFields() {
$this->Controller = new ScaffoldMockControllerWithFields(); $this->Controller = new ScaffoldMockControllerWithFields();
$this->Controller->action = 'edit'; $this->Controller->action = 'edit';

View file

@ -218,7 +218,7 @@ class MyCustomErrorHandler extends ErrorHandler {
* custom error message type. * custom error message type.
* *
* @return void * @return void
**/ */
function missingWidgetThing() { function missingWidgetThing() {
echo 'widget thing is missing'; echo 'widget thing is missing';
} }
@ -276,7 +276,7 @@ class ErrorHandlerTest extends CakeTestCase {
* into error404 when debug == 0 * into error404 when debug == 0
* *
* @return void * @return void
**/ */
function testSubclassMethodsNotBeingConvertedToError() { function testSubclassMethodsNotBeingConvertedToError() {
$back = Configure::read('debug'); $back = Configure::read('debug');
Configure::write('debug', 2); Configure::write('debug', 2);

View file

@ -222,7 +222,7 @@ class FolderTest extends CakeTestCase {
* test Adding path elements to a path * test Adding path elements to a path
* *
* @return void * @return void
**/ */
function testAddPathElement() { function testAddPathElement() {
$result = Folder::addPathElement(DS . 'some' . DS . 'dir', 'another_path'); $result = Folder::addPathElement(DS . 'some' . DS . 'dir', 'another_path');
$this->assertEqual($result, DS . 'some' . DS . 'dir' . DS . 'another_path'); $this->assertEqual($result, DS . 'some' . DS . 'dir' . DS . 'another_path');

View file

@ -67,7 +67,7 @@ class FileLogTest extends CakeTestCase {
* test using the path setting to write logs in other places. * test using the path setting to write logs in other places.
* *
* @return void * @return void
**/ */
function testPathSetting() { function testPathSetting() {
$path = TMP . 'tests' . DS; $path = TMP . 'tests' . DS;
@unlink($path . 'error.log'); @unlink($path . 'error.log');

View file

@ -172,7 +172,7 @@ class MagicDbTestData extends Object {
* *
* @param string $key * @param string $key
* @access public * @access public
**/ */
function get($key) { function get($key) {
/** /**
* data property * data property

View file

@ -463,7 +463,7 @@ class CakeSchemaTest extends CakeTestCase {
* test reading schema from plugins. * test reading schema from plugins.
* *
* @return void * @return void
**/ */
function testSchemaReadWithPlugins() { function testSchemaReadWithPlugins() {
App::objects('model', null, false); App::objects('model', null, false);
App::build(array( App::build(array(
@ -489,7 +489,7 @@ class CakeSchemaTest extends CakeTestCase {
* test that tables are generated correctly * test that tables are generated correctly
* *
* @return void * @return void
**/ */
function testGenerateTable() { function testGenerateTable() {
$fields = array( $fields = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'),
@ -567,7 +567,7 @@ class CakeSchemaTest extends CakeTestCase {
* Test comparing tableParameters and indexes. * Test comparing tableParameters and indexes.
* *
* @return void * @return void
**/ */
function testTableParametersAndIndexComparison() { function testTableParametersAndIndexComparison() {
$old = array( $old = array(
'posts' => array( 'posts' => array(
@ -670,7 +670,7 @@ class CakeSchemaTest extends CakeTestCase {
* test loading schema files inside of plugins. * test loading schema files inside of plugins.
* *
* @return void * @return void
**/ */
function testSchemaLoadingFromPlugin() { function testSchemaLoadingFromPlugin() {
App::build(array( App::build(array(
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)

View file

@ -196,7 +196,7 @@ class DboAdodbTest extends CakeTestCase {
* *
* @var string * @var string
* @access public * @access public
**/ */
var $fixtures = array('core.article'); var $fixtures = array('core.article');
/** /**

View file

@ -203,7 +203,7 @@ class DboMysqlTest extends CakeTestCase {
* startCase * startCase
* *
* @return void * @return void
**/ */
function startCase() { function startCase() {
$this->_debug = Configure::read('debug'); $this->_debug = Configure::read('debug');
Configure::write('debug', 1); Configure::write('debug', 1);
@ -213,7 +213,7 @@ class DboMysqlTest extends CakeTestCase {
* endCase * endCase
* *
* @return void * @return void
**/ */
function endCase() { function endCase() {
Configure::write('debug', $this->_debug); Configure::write('debug', $this->_debug);
} }
@ -418,7 +418,7 @@ class DboMysqlTest extends CakeTestCase {
* Using a mock ensure that MySQL 4.x output is properly parsed. * Using a mock ensure that MySQL 4.x output is properly parsed.
* *
* @return void * @return void
**/ */
function testIndexOnMySQL4Output() { function testIndexOnMySQL4Output() {
$name = $this->db->fullTableName('simple'); $name = $this->db->fullTableName('simple');
@ -631,7 +631,7 @@ class DboMysqlTest extends CakeTestCase {
* test saving and retrieval of blobs * test saving and retrieval of blobs
* *
* @return void * @return void
**/ */
function testBlobSaving() { function testBlobSaving() {
$this->db->cacheSources = false; $this->db->cacheSources = false;
$data = "GIF87ab $data = "GIF87ab
@ -650,7 +650,7 @@ class DboMysqlTest extends CakeTestCase {
* test altering the table settings with schema. * test altering the table settings with schema.
* *
* @return void * @return void
**/ */
function testAlteringTableParameters() { function testAlteringTableParameters() {
App::import('Model', 'CakeSchema'); App::import('Model', 'CakeSchema');
$this->db->cacheSources = $this->db->testing = false; $this->db->cacheSources = $this->db->testing = false;

View file

@ -303,7 +303,7 @@ class DboMysqliTest extends CakeTestCase {
* test that float values are correctly identified * test that float values are correctly identified
* *
* @return void * @return void
**/ */
function testFloatParsing() { function testFloatParsing() {
$model =& new Model(array('ds' => 'test_suite', 'table' => 'datatypes', 'name' => 'Datatype')); $model =& new Model(array('ds' => 'test_suite', 'table' => 'datatypes', 'name' => 'Datatype'));
$result = $this->db->describe($model); $result = $this->db->describe($model);

View file

@ -312,7 +312,7 @@ class DboPostgresTest extends CakeTestCase {
* test that date and time columns do not generate errors with null and nullish values. * test that date and time columns do not generate errors with null and nullish values.
* *
* @return void * @return void
**/ */
function testDateAndTimeAsNull() { function testDateAndTimeAsNull() {
$this->assertEqual($this->db2->value(null, 'date'), 'NULL'); $this->assertEqual($this->db2->value(null, 'date'), 'NULL');
$this->assertEqual($this->db2->value('', 'date'), 'NULL'); $this->assertEqual($this->db2->value('', 'date'), 'NULL');
@ -523,7 +523,7 @@ class DboPostgresTest extends CakeTestCase {
* Test index generation from table info. * Test index generation from table info.
* *
* @return void * @return void
**/ */
function testIndexGeneration() { function testIndexGeneration() {
$name = $this->db->fullTableName('index_test', false); $name = $this->db->fullTableName('index_test', false);
$this->db->query('CREATE TABLE ' . $name . ' ("id" serial NOT NULL PRIMARY KEY, "bool" integer, "small_char" varchar(50), "description" varchar(40) )'); $this->db->query('CREATE TABLE ' . $name . ' ("id" serial NOT NULL PRIMARY KEY, "bool" integer, "small_char" varchar(50), "description" varchar(40) )');

View file

@ -220,7 +220,7 @@ class DboSqliteTest extends CakeTestCase {
* test building columns with SQLite * test building columns with SQLite
* *
* @return void * @return void
**/ */
function testBuildColumn() { function testBuildColumn() {
$data = array( $data = array(
'name' => 'int_field', 'name' => 'int_field',
@ -292,7 +292,7 @@ class DboSqliteTest extends CakeTestCase {
* test describe() and normal results. * test describe() and normal results.
* *
* @return void * @return void
**/ */
function testDescribe() { function testDescribe() {
$Model =& new Model(array('name' => 'User', 'ds' => 'test_suite', 'table' => 'users')); $Model =& new Model(array('name' => 'User', 'ds' => 'test_suite', 'table' => 'users'));
$result = $this->db->describe($Model); $result = $this->db->describe($Model);
@ -336,7 +336,7 @@ class DboSqliteTest extends CakeTestCase {
* test that describe does not corrupt UUID primary keys * test that describe does not corrupt UUID primary keys
* *
* @return void * @return void
**/ */
function testDescribeWithUuidPrimaryKey() { function testDescribeWithUuidPrimaryKey() {
$tableName = 'uuid_tests'; $tableName = 'uuid_tests';
$this->db->query("CREATE TABLE {$tableName} (id VARCHAR(36) PRIMARY KEY, name VARCHAR, created DATETIME, modified DATETIME)"); $this->db->query("CREATE TABLE {$tableName} (id VARCHAR(36) PRIMARY KEY, name VARCHAR, created DATETIME, modified DATETIME)");

View file

@ -3643,7 +3643,7 @@ class DboSourceTest extends CakeTestCase {
* test hasAny() * test hasAny()
* *
* @return void * @return void
**/ */
function testHasAny() { function testHasAny() {
$this->testDb->hasAny($this->Model, array()); $this->testDb->hasAny($this->Model, array());
$expected = 'SELECT COUNT(`TestModel`.`id`) AS count FROM `test_models` AS `TestModel` WHERE 1 = 1'; $expected = 'SELECT COUNT(`TestModel`.`id`) AS count FROM `test_models` AS `TestModel` WHERE 1 = 1';
@ -4000,7 +4000,7 @@ class DboSourceTest extends CakeTestCase {
* test getting the query log as an array. * test getting the query log as an array.
* *
* @return void * @return void
**/ */
function testGetLog() { function testGetLog() {
$this->testDb->logQuery('Query 1'); $this->testDb->logQuery('Query 1');
$this->testDb->logQuery('Query 2'); $this->testDb->logQuery('Query 2');
@ -4024,7 +4024,7 @@ class DboSourceTest extends CakeTestCase {
* test that execute runs queries. * test that execute runs queries.
* *
* @return void * @return void
**/ */
function testExecute() { function testExecute() {
$query = 'SELECT * FROM ' . $this->testDb->fullTableName('articles') . ' WHERE 1 = 1'; $query = 'SELECT * FROM ' . $this->testDb->fullTableName('articles') . ' WHERE 1 = 1';
@ -4046,7 +4046,7 @@ class DboSourceTest extends CakeTestCase {
* test that query() returns boolean values from operations like CREATE TABLE * test that query() returns boolean values from operations like CREATE TABLE
* *
* @return void * @return void
**/ */
function testFetchAllBooleanReturns() { function testFetchAllBooleanReturns() {
$name = $this->db->fullTableName('test_query'); $name = $this->db->fullTableName('test_query');
$query = "CREATE TABLE {$name} (name varchar(10));"; $query = "CREATE TABLE {$name} (name varchar(10));";
@ -4062,7 +4062,7 @@ class DboSourceTest extends CakeTestCase {
* test ShowQuery generation of regular and error messages * test ShowQuery generation of regular and error messages
* *
* @return void * @return void
**/ */
function testShowQuery() { function testShowQuery() {
$this->testDb->error = false; $this->testDb->error = false;
ob_start(); ob_start();

View file

@ -508,7 +508,7 @@ class BehaviorTest extends CakeTestCase {
* test that attaching a non existant Behavior triggers a cake error. * test that attaching a non existant Behavior triggers a cake error.
* *
* @return void * @return void
**/ */
function testInvalidBehaviorCausingCakeError() { function testInvalidBehaviorCausingCakeError() {
$Apple =& new Apple(); $Apple =& new Apple();
$Apple->Behaviors =& new MockModelBehaviorCollection(); $Apple->Behaviors =& new MockModelBehaviorCollection();
@ -1103,7 +1103,7 @@ class BehaviorTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testBehaviorAttachAndDetach() { function testBehaviorAttachAndDetach() {
$Sample =& new Sample(); $Sample =& new Sample();
$Sample->actsAs = array('Test3' => array('bar'), 'Test2' => array('foo', 'bar')); $Sample->actsAs = array('Test3' => array('bar'), 'Test2' => array('foo', 'bar'));

View file

@ -572,7 +572,7 @@ class ModelDeleteTest extends BaseModelTest {
* test that beforeDelete returning false can abort deletion. * test that beforeDelete returning false can abort deletion.
* *
* @return void * @return void
**/ */
function testBeforeDeleteDeleteAbortion() { function testBeforeDeleteDeleteAbortion() {
$this->loadFixtures('Post'); $this->loadFixtures('Post');
$Model =& new CallbackPostTestModel(); $Model =& new CallbackPostTestModel();

View file

@ -536,7 +536,7 @@ class ModelIntegrationTest extends BaseModelTest {
* test deconstruct() with time fields. * test deconstruct() with time fields.
* *
* @return void * @return void
**/ */
function testDeconstructFieldsTime() { function testDeconstructFieldsTime() {
$this->loadFixtures('Apple'); $this->loadFixtures('Apple');
$TestModel =& new Apple(); $TestModel =& new Apple();
@ -881,7 +881,7 @@ class ModelIntegrationTest extends BaseModelTest {
* ensure that __exists is reset on create * ensure that __exists is reset on create
* *
* @return void * @return void
**/ */
function testResetOfExistsOnCreate() { function testResetOfExistsOnCreate() {
$this->loadFixtures('Article'); $this->loadFixtures('Article');
$Article =& new Article(); $Article =& new Article();
@ -1179,7 +1179,7 @@ class ModelIntegrationTest extends BaseModelTest {
* ensure that $actsAS and $_findMethods are merged. * ensure that $actsAS and $_findMethods are merged.
* *
* @return void * @return void
**/ */
function testConstruct() { function testConstruct() {
$this->loadFixtures('Post', 'Comment'); $this->loadFixtures('Post', 'Comment');
@ -1200,7 +1200,7 @@ class ModelIntegrationTest extends BaseModelTest {
* ensure that $actsAS and $_findMethods are merged. * ensure that $actsAS and $_findMethods are merged.
* *
* @return void * @return void
**/ */
function testConstructWithAlternateDataSource() { function testConstructWithAlternateDataSource() {
$TestModel =& ClassRegistry::init(array( $TestModel =& ClassRegistry::init(array(
'class' => 'DoesntMatter', 'ds' => 'test_suite', 'table' => false 'class' => 'DoesntMatter', 'ds' => 'test_suite', 'table' => false

View file

@ -4734,7 +4734,7 @@ class ModelReadTest extends BaseModelTest {
* test that bindModel behaves with Custom primary Key associations * test that bindModel behaves with Custom primary Key associations
* *
* @return void * @return void
**/ */
function bindWithCustomPrimaryKey() { function bindWithCustomPrimaryKey() {
$this->loadFixtures('Story', 'StoriesTag', 'Tag'); $this->loadFixtures('Story', 'StoriesTag', 'Tag');
$Model =& ClassRegistry::init('StoriesTag'); $Model =& ClassRegistry::init('StoriesTag');
@ -6400,7 +6400,7 @@ class ModelReadTest extends BaseModelTest {
* test find with COUNT(DISTINCT field) * test find with COUNT(DISTINCT field)
* *
* @return void * @return void
**/ */
function testFindCountDistinct() { function testFindCountDistinct() {
$skip = $this->skipIf( $skip = $this->skipIf(
$this->db->config['driver'] == 'sqlite', $this->db->config['driver'] == 'sqlite',

View file

@ -126,7 +126,7 @@ class ModelValidationTest extends BaseModelTest {
* Helps to make developement easier. * Helps to make developement easier.
* *
* @return void * @return void
**/ */
function testMissingValidationErrorTriggering() { function testMissingValidationErrorTriggering() {
$restore = Configure::read('debug'); $restore = Configure::read('debug');
Configure::write('debug', 2); Configure::write('debug', 2);

View file

@ -313,7 +313,7 @@ class ModelWriteTest extends BaseModelTest {
* as url for controller could be either overallFavorites/index or overall_favorites/index * as url for controller could be either overallFavorites/index or overall_favorites/index
* *
* @return void * @return void
**/ */
function testCacheClearOnSave() { function testCacheClearOnSave() {
$_back = array( $_back = array(
'check' => Configure::read('Cache.check'), 'check' => Configure::read('Cache.check'),
@ -620,7 +620,7 @@ class ModelWriteTest extends BaseModelTest {
* test that beforeValidate returning false can abort saves. * test that beforeValidate returning false can abort saves.
* *
* @return void * @return void
**/ */
function testBeforeValidateSaveAbortion() { function testBeforeValidateSaveAbortion() {
$Model =& new CallbackPostTestModel(); $Model =& new CallbackPostTestModel();
$Model->beforeValidateReturn = false; $Model->beforeValidateReturn = false;
@ -637,7 +637,7 @@ class ModelWriteTest extends BaseModelTest {
* test that beforeSave returning false can abort saves. * test that beforeSave returning false can abort saves.
* *
* @return void * @return void
**/ */
function testBeforeSaveSaveAbortion() { function testBeforeSaveSaveAbortion() {
$Model =& new CallbackPostTestModel(); $Model =& new CallbackPostTestModel();
$Model->beforeSaveReturn = false; $Model->beforeSaveReturn = false;
@ -2622,7 +2622,7 @@ class ModelWriteTest extends BaseModelTest {
* test HABTM saving when join table has no primary key and only 2 columns. * test HABTM saving when join table has no primary key and only 2 columns.
* *
* @return void * @return void
**/ */
function testHabtmSavingWithNoPrimaryKeyUuidJoinTable() { function testHabtmSavingWithNoPrimaryKeyUuidJoinTable() {
$this->loadFixtures('UuidTag', 'Fruit', 'FruitsUuidTag'); $this->loadFixtures('UuidTag', 'Fruit', 'FruitsUuidTag');
$Fruit =& new Fruit(); $Fruit =& new Fruit();
@ -2646,7 +2646,7 @@ class ModelWriteTest extends BaseModelTest {
* test HABTM saving when join table has no primary key and only 2 columns, no with model is used. * test HABTM saving when join table has no primary key and only 2 columns, no with model is used.
* *
* @return void * @return void
**/ */
function testHabtmSavingWithNoPrimaryKeyUuidJoinTableNoWith() { function testHabtmSavingWithNoPrimaryKeyUuidJoinTableNoWith() {
$this->loadFixtures('UuidTag', 'Fruit', 'FruitsUuidTag'); $this->loadFixtures('UuidTag', 'Fruit', 'FruitsUuidTag');
$Fruit =& new FruitNoWith(); $Fruit =& new FruitNoWith();

View file

@ -542,7 +542,7 @@ class ModifiedComment extends CakeTestModel {
* afterFind callback * afterFind callback
* *
* @return void * @return void
**/ */
function afterFind($results) { function afterFind($results) {
if (isset($results[0])) { if (isset($results[0])) {
$results[0]['Comment']['callback'] = 'Fire'; $results[0]['Comment']['callback'] = 'Fire';
@ -587,7 +587,7 @@ class AgainModifiedComment extends CakeTestModel {
* afterFind callback * afterFind callback
* *
* @return void * @return void
**/ */
function afterFind($results) { function afterFind($results) {
if (isset($results[0])) { if (isset($results[0])) {
$results[0]['Comment']['querytype'] = $this->findQueryType; $results[0]['Comment']['querytype'] = $this->findQueryType;
@ -2057,7 +2057,7 @@ class CallbackPostTestModel extends CakeTestModel {
* beforeSave callback * beforeSave callback
* *
* @return void * @return void
**/ */
function beforeSave($options) { function beforeSave($options) {
return $this->beforeSaveReturn; return $this->beforeSaveReturn;
} }
@ -2065,7 +2065,7 @@ class CallbackPostTestModel extends CakeTestModel {
* beforeValidate callback * beforeValidate callback
* *
* @return void * @return void
**/ */
function beforeValidate($options) { function beforeValidate($options) {
return $this->beforeValidateReturn; return $this->beforeValidateReturn;
} }
@ -2073,7 +2073,7 @@ class CallbackPostTestModel extends CakeTestModel {
* beforeDelete callback * beforeDelete callback
* *
* @return void * @return void
**/ */
function beforeDelete($cascade = true) { function beforeDelete($cascade = true) {
return $this->beforeDeleteReturn; return $this->beforeDeleteReturn;
} }

View file

@ -109,7 +109,7 @@ class RequestActionController extends Controller {
* post pass, testing post passing * post pass, testing post passing
* *
* @return array * @return array
**/ */
function post_pass() { function post_pass() {
return $this->data; return $this->data;
} }
@ -152,7 +152,7 @@ class RequestActionPersistentController extends Controller {
* post pass, testing post passing * post pass, testing post passing
* *
* @return array * @return array
**/ */
function index() { function index() {
return 'This is a test'; return 'This is a test';
} }
@ -295,7 +295,7 @@ class TestObject extends Object {
* testPersist * testPersist
* *
* @return void * @return void
**/ */
function testPersist($name, $return = null, &$object, $type = null) { function testPersist($name, $return = null, &$object, $type = null) {
return $this->_persist($name, $return, $object, $type); return $this->_persist($name, $return, $object, $type);
} }
@ -324,7 +324,7 @@ class ObjectTest extends CakeTestCase {
* fixtures * fixtures
* *
* @var string * @var string
**/ */
var $fixtures = array('core.post', 'core.comment'); var $fixtures = array('core.post', 'core.comment');
/** /**
@ -774,7 +774,7 @@ class ObjectTest extends CakeTestCase {
* testCakeError * testCakeError
* *
* @return void * @return void
**/ */
function testCakeError() { function testCakeError() {
} }

View file

@ -50,7 +50,7 @@ class RouterTest extends CakeTestCase {
* end the test and reset the environment * end the test and reset the environment
* *
* @return void * @return void
**/ */
function endTest() { function endTest() {
Configure::write('Routing', $this->_routing); Configure::write('Routing', $this->_routing);
} }
@ -1031,7 +1031,7 @@ class RouterTest extends CakeTestCase {
* or reset * or reset
* *
* @return void * @return void
**/ */
function testRoutingPrefixesSetting() { function testRoutingPrefixesSetting() {
$restore = Configure::read('Routing'); $restore = Configure::read('Routing');
@ -1120,7 +1120,7 @@ class RouterTest extends CakeTestCase {
* Test prefix routing and plugin combinations * Test prefix routing and plugin combinations
* *
* @return void * @return void
**/ */
function testPrefixRoutingAndPlugins() { function testPrefixRoutingAndPlugins() {
Configure::write('Routing.prefixes', array('admin')); Configure::write('Routing.prefixes', array('admin'));
$paths = App::path('plugins'); $paths = App::path('plugins');
@ -1461,7 +1461,7 @@ class RouterTest extends CakeTestCase {
* test newer style automatically generated prefix routes. * test newer style automatically generated prefix routes.
* *
* @return void * @return void
**/ */
function testUrlGenerationWithAutoPrefixes() { function testUrlGenerationWithAutoPrefixes() {
Configure::write('Routing.prefixes', array('protected')); Configure::write('Routing.prefixes', array('protected'));
Router::reload(); Router::reload();
@ -1518,7 +1518,7 @@ class RouterTest extends CakeTestCase {
* test that auto-generated prefix routes persist * test that auto-generated prefix routes persist
* *
* @return void * @return void
**/ */
function testAutoPrefixRoutePersistence() { function testAutoPrefixRoutePersistence() {
Configure::write('Routing.prefixes', array('protected')); Configure::write('Routing.prefixes', array('protected'));
Router::reload(); Router::reload();

View file

@ -208,7 +208,7 @@ class StringTest extends CakeTestCase {
* test Clean Insert * test Clean Insert
* *
* @return void * @return void
**/ */
function testCleanInsert() { function testCleanInsert() {
$result = String::cleanInsert(':incomplete', array( $result = String::cleanInsert(':incomplete', array(
'clean' => true, 'before' => ':', 'after' => '' 'clean' => true, 'before' => ':', 'after' => ''

View file

@ -1861,7 +1861,7 @@ class ValidationTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testMultiple() { function testMultiple() {
$this->assertTrue(Validation::multiple(array(0, 1, 2, 3))); $this->assertTrue(Validation::multiple(array(0, 1, 2, 3)));
$this->assertTrue(Validation::multiple(array(50, 32, 22, 0))); $this->assertTrue(Validation::multiple(array(50, 32, 22, 0)));

View file

@ -341,7 +341,7 @@ class HelperTest extends CakeTestCase {
* test getting values from Helper * test getting values from Helper
* *
* @return void * @return void
**/ */
function testValue() { function testValue() {
$this->Helper->data = array('fullname' => 'This is me'); $this->Helper->data = array('fullname' => 'This is me');
$this->Helper->setEntity('fullname'); $this->Helper->setEntity('fullname');
@ -393,7 +393,7 @@ class HelperTest extends CakeTestCase {
* Ensure HTML escaping of url params. So link addresses are valid and not exploited * Ensure HTML escaping of url params. So link addresses are valid and not exploited
* *
* @return void * @return void
**/ */
function testUrlConversion() { function testUrlConversion() {
$result = $this->Helper->url('/controller/action/1'); $result = $this->Helper->url('/controller/action/1');
$this->assertEqual($result, '/controller/action/1'); $this->assertEqual($result, '/controller/action/1');
@ -429,7 +429,7 @@ class HelperTest extends CakeTestCase {
* test assetTimestamp application * test assetTimestamp application
* *
* @return void * @return void
**/ */
function testAssetTimestamp() { function testAssetTimestamp() {
$_timestamp = Configure::read('Asset.timestamp'); $_timestamp = Configure::read('Asset.timestamp');
$_debug = Configure::read('debug'); $_debug = Configure::read('debug');

View file

@ -69,7 +69,7 @@ class CacheHelperTest extends CakeTestCase {
* Checks if TMP/views is writable, and skips the case if it is not. * Checks if TMP/views is writable, and skips the case if it is not.
* *
* @return void * @return void
**/ */
function skip() { function skip() {
$this->skipUnless(is_writable(TMP . 'cache' . DS . 'views' . DS), 'TMP/views is not writable %s'); $this->skipUnless(is_writable(TMP . 'cache' . DS . 'views' . DS), 'TMP/views is not writable %s');
} }
@ -202,7 +202,7 @@ class CacheHelperTest extends CakeTestCase {
* test that multiple <cake:nocache> tags function with multiple nocache tags in the layout. * test that multiple <cake:nocache> tags function with multiple nocache tags in the layout.
* *
* @return void * @return void
**/ */
function testMultipleNoCacheTagsInViewfile() { function testMultipleNoCacheTagsInViewfile() {
$this->Controller->cache_parsing(); $this->Controller->cache_parsing();
$this->Controller->cacheAction = 21600; $this->Controller->cacheAction = 21600;
@ -282,7 +282,7 @@ class CacheHelperTest extends CakeTestCase {
* test cacheAction set to a boolean * test cacheAction set to a boolean
* *
* @return void * @return void
**/ */
function testCacheActionArray() { function testCacheActionArray() {
$this->Controller->cache_parsing(); $this->Controller->cache_parsing();
$this->Controller->cacheAction = array( $this->Controller->cacheAction = array(

View file

@ -1758,7 +1758,7 @@ class FormHelperTest extends CakeTestCase {
* test form->input() with datetime, date and time types * test form->input() with datetime, date and time types
* *
* @return void * @return void
**/ */
function testInputDatetime() { function testInputDatetime() {
extract($this->dateRegex); extract($this->dateRegex);
$result = $this->Form->input('Contact.created', array('type' => 'time', 'timeFormat' => 24)); $result = $this->Form->input('Contact.created', array('type' => 'time', 'timeFormat' => 24));
@ -1874,7 +1874,7 @@ class FormHelperTest extends CakeTestCase {
* Test generating checkboxes in a loop. * Test generating checkboxes in a loop.
* *
* @return void * @return void
**/ */
function testInputCheckboxesInLoop() { function testInputCheckboxesInLoop() {
for ($i = 1; $i < 5; $i++) { for ($i = 1; $i < 5; $i++) {
$result = $this->Form->input("Contact.{$i}.email", array('type' => 'checkbox', 'value' => $i)); $result = $this->Form->input("Contact.{$i}.email", array('type' => 'checkbox', 'value' => $i));
@ -1894,7 +1894,7 @@ class FormHelperTest extends CakeTestCase {
* test form->input() with select type inputs. * test form->input() with select type inputs.
* *
* @return void * @return void
**/ */
function testInputSelectType() { function testInputSelectType() {
$result = $this->Form->input('email', array( $result = $this->Form->input('email', array(
'options' => array('è' => 'Firést', 'é' => 'Secoènd'), 'empty' => true) 'options' => array('è' => 'Firést', 'é' => 'Secoènd'), 'empty' => true)
@ -2040,7 +2040,7 @@ class FormHelperTest extends CakeTestCase {
* test that overriding the magic select type widget is possible * test that overriding the magic select type widget is possible
* *
* @return void * @return void
**/ */
function testInputOverridingMagicSelectType() { function testInputOverridingMagicSelectType() {
$view =& ClassRegistry::getObject('view'); $view =& ClassRegistry::getObject('view');
$view->viewVars['users'] = array('value' => 'good', 'other' => 'bad'); $view->viewVars['users'] = array('value' => 'good', 'other' => 'bad');
@ -2743,7 +2743,7 @@ class FormHelperTest extends CakeTestCase {
* test disabling the hidden input for radio buttons * test disabling the hidden input for radio buttons
* *
* @return void * @return void
**/ */
function testRadioHiddenInputDisabling() { function testRadioHiddenInputDisabling() {
$result = $this->Form->input('Model.1.field', array( $result = $this->Form->input('Model.1.field', array(
'type' => 'radio', 'type' => 'radio',
@ -3043,7 +3043,7 @@ class FormHelperTest extends CakeTestCase {
* test generation of habtm select boxes. * test generation of habtm select boxes.
* *
* @return void * @return void
**/ */
function testHabtmSelectBox() { function testHabtmSelectBox() {
$view =& ClassRegistry::getObject('view'); $view =& ClassRegistry::getObject('view');
$view->viewVars['contactTags'] = array( $view->viewVars['contactTags'] = array(
@ -3427,7 +3427,7 @@ class FormHelperTest extends CakeTestCase {
* Test that disabling a checkbox also disables the hidden input so no value is submitted * Test that disabling a checkbox also disables the hidden input so no value is submitted
* *
* @return void * @return void
**/ */
function testCheckboxDisabling() { function testCheckboxDisabling() {
$result = $this->Form->checkbox('Account.show_name', array('disabled' => 'disabled')); $result = $this->Form->checkbox('Account.show_name', array('disabled' => 'disabled'));
$expected = array( $expected = array(
@ -3441,7 +3441,7 @@ class FormHelperTest extends CakeTestCase {
* Test that specifying false in the 'disabled' option will not disable either the hidden input or the checkbox input * Test that specifying false in the 'disabled' option will not disable either the hidden input or the checkbox input
* *
* @return void * @return void
**/ */
function testCheckboxHiddenDisabling() { function testCheckboxHiddenDisabling() {
$result = $this->Form->checkbox('Account.show_name', array('disabled' => false)); $result = $this->Form->checkbox('Account.show_name', array('disabled' => false));
$expected = array( $expected = array(
@ -4685,7 +4685,7 @@ class FormHelperTest extends CakeTestCase {
* test File upload input on a model not used in create(); * test File upload input on a model not used in create();
* *
* @return void * @return void
**/ */
function testFileUploadOnOtherModel() { function testFileUploadOnOtherModel() {
ClassRegistry::removeObject('view'); ClassRegistry::removeObject('view');
$controller =& new Controller(); $controller =& new Controller();
@ -4816,7 +4816,7 @@ class FormHelperTest extends CakeTestCase {
* test image submit types. * test image submit types.
* *
* @return void * @return void
**/ */
function testSubmitImage() { function testSubmitImage() {
$result = $this->Form->submit('http://example.com/cake.power.gif'); $result = $this->Form->submit('http://example.com/cake.power.gif');
$expected = array( $expected = array(
@ -5055,7 +5055,7 @@ class FormHelperTest extends CakeTestCase {
* test that inputDefaults are stored and used. * test that inputDefaults are stored and used.
* *
* @return void * @return void
**/ */
function testCreateWithInputDefaults() { function testCreateWithInputDefaults() {
$this->Form->create('User', array( $this->Form->create('User', array(
'inputDefaults' => array('div' => false, 'label' => false) 'inputDefaults' => array('div' => false, 'label' => false)
@ -5080,7 +5080,7 @@ class FormHelperTest extends CakeTestCase {
* test automatic accept-charset overriding * test automatic accept-charset overriding
* *
* @return void * @return void
**/ */
function testCreateWithAcceptCharset() { function testCreateWithAcceptCharset() {
$result = $this->Form->create('UserForm', array( $result = $this->Form->create('UserForm', array(
'type' => 'post', 'action' => 'login','encoding' => 'iso-8859-1' 'type' => 'post', 'action' => 'login','encoding' => 'iso-8859-1'

View file

@ -302,7 +302,7 @@ class HtmlHelperTest extends CakeTestCase {
* test image() with Asset.timestamp * test image() with Asset.timestamp
* *
* @return void * @return void
**/ */
function testImageTagWithTimestampping() { function testImageTagWithTimestampping() {
Configure::write('Asset.timestamp', 'force'); Configure::write('Asset.timestamp', 'force');
@ -438,7 +438,7 @@ class HtmlHelperTest extends CakeTestCase {
* test use of css() and timestamping * test use of css() and timestamping
* *
* @return void * @return void
**/ */
function testCssTimestamping() { function testCssTimestamping() {
Configure::write('debug', 2); Configure::write('debug', 2);
Configure::write('Asset.timestamp', true); Configure::write('Asset.timestamp', true);
@ -482,7 +482,7 @@ class HtmlHelperTest extends CakeTestCase {
* test timestamp enforcement for script tags. * test timestamp enforcement for script tags.
* *
* @return void * @return void
**/ */
function testScriptTimestamping() { function testScriptTimestamping() {
$skip = $this->skipIf(!is_writable(JS), 'webroot/js is not Writable, timestamp testing has been skipped'); $skip = $this->skipIf(!is_writable(JS), 'webroot/js is not Writable, timestamp testing has been skipped');
if ($skip) { if ($skip) {
@ -510,7 +510,7 @@ class HtmlHelperTest extends CakeTestCase {
* test script tag generation * test script tag generation
* *
* @return void * @return void
**/ */
function testScript() { function testScript() {
$result = $this->Html->script('foo'); $result = $this->Html->script('foo');
$expected = array( $expected = array(
@ -565,7 +565,7 @@ class HtmlHelperTest extends CakeTestCase {
* test Script block generation * test Script block generation
* *
* @return void * @return void
**/ */
function testScriptBlock() { function testScriptBlock() {
$result = $this->Html->scriptBlock('window.foo = 2;'); $result = $this->Html->scriptBlock('window.foo = 2;');
$expected = array( $expected = array(
@ -615,7 +615,7 @@ class HtmlHelperTest extends CakeTestCase {
* test script tag output buffering when using scriptStart() and scriptEnd(); * test script tag output buffering when using scriptStart() and scriptEnd();
* *
* @return void * @return void
**/ */
function testScriptStartAndScriptEnd() { function testScriptStartAndScriptEnd() {
$result = $this->Html->scriptStart(array('safe' => true)); $result = $this->Html->scriptStart(array('safe' => true));
$this->assertNull($result); $this->assertNull($result);

View file

@ -792,7 +792,7 @@ class JavascriptTest extends CakeTestCase {
* test string escaping and compare to json_encode() * test string escaping and compare to json_encode()
* *
* @return void * @return void
**/ */
function testStringJsonEncodeCompliance() { function testStringJsonEncodeCompliance() {
if (!function_exists('json_encode')) { if (!function_exists('json_encode')) {
return; return;
@ -822,7 +822,7 @@ class JavascriptTest extends CakeTestCase {
* test that text encoded with Javascript::object decodes properly * test that text encoded with Javascript::object decodes properly
* *
* @return void * @return void
**/ */
function testObjectDecodeCompatibility() { function testObjectDecodeCompatibility() {
if (!function_exists('json_decode')) { if (!function_exists('json_decode')) {
return; return;

View file

@ -25,7 +25,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* startTest * startTest
* *
* @return void * @return void
**/ */
function startTest() { function startTest() {
$this->Jquery =& new JqueryEngineHelper(); $this->Jquery =& new JqueryEngineHelper();
} }
@ -34,7 +34,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* end test * end test
* *
* @return void * @return void
**/ */
function endTest() { function endTest() {
unset($this->Jquery); unset($this->Jquery);
} }
@ -43,7 +43,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test selector method * test selector method
* *
* @return void * @return void
**/ */
function testSelector() { function testSelector() {
$result = $this->Jquery->get('#content'); $result = $this->Jquery->get('#content');
$this->assertEqual($result, $this->Jquery); $this->assertEqual($result, $this->Jquery);
@ -66,7 +66,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test event binding * test event binding
* *
* @return void * @return void
**/ */
function testEvent() { function testEvent() {
$this->Jquery->get('#myLink'); $this->Jquery->get('#myLink');
$result = $this->Jquery->event('click', 'doClick', array('wrap' => false)); $result = $this->Jquery->event('click', 'doClick', array('wrap' => false));
@ -86,7 +86,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test dom ready event creation * test dom ready event creation
* *
* @return void * @return void
**/ */
function testDomReady() { function testDomReady() {
$result = $this->Jquery->domReady('foo.name = "bar";'); $result = $this->Jquery->domReady('foo.name = "bar";');
$expected = '$(document).bind("ready", function (event) {foo.name = "bar";});'; $expected = '$(document).bind("ready", function (event) {foo.name = "bar";});';
@ -97,7 +97,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test Each method * test Each method
* *
* @return void * @return void
**/ */
function testEach() { function testEach() {
$this->Jquery->get('#foo'); $this->Jquery->get('#foo');
$result = $this->Jquery->each('$(this).hide();'); $result = $this->Jquery->each('$(this).hide();');
@ -109,7 +109,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test Effect generation * test Effect generation
* *
* @return void * @return void
**/ */
function testEffect() { function testEffect() {
$this->Jquery->get('#foo'); $this->Jquery->get('#foo');
$result = $this->Jquery->effect('show'); $result = $this->Jquery->effect('show');
@ -153,7 +153,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* Test Request Generation * Test Request Generation
* *
* @return void * @return void
**/ */
function testRequest() { function testRequest() {
$result = $this->Jquery->request(array('controller' => 'posts', 'action' => 'view', 1)); $result = $this->Jquery->request(array('controller' => 'posts', 'action' => 'view', 1));
$expected = '$.ajax({url:"\\/posts\\/view\\/1"});'; $expected = '$.ajax({url:"\\/posts\\/view\\/1"});';
@ -213,7 +213,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test sortable list generation * test sortable list generation
* *
* @return void * @return void
**/ */
function testSortable() { function testSortable() {
$this->Jquery->get('#myList'); $this->Jquery->get('#myList');
$result = $this->Jquery->sortable(array( $result = $this->Jquery->sortable(array(
@ -242,7 +242,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test drag() method * test drag() method
* *
* @return void * @return void
**/ */
function testDrag() { function testDrag() {
$this->Jquery->get('#element'); $this->Jquery->get('#element');
$result = $this->Jquery->drag(array( $result = $this->Jquery->drag(array(
@ -271,7 +271,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test drop() method * test drop() method
* *
* @return void * @return void
**/ */
function testDrop() { function testDrop() {
$this->Jquery->get('#element'); $this->Jquery->get('#element');
$result = $this->Jquery->drop(array( $result = $this->Jquery->drop(array(
@ -298,7 +298,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test slider generation * test slider generation
* *
* @return void * @return void
**/ */
function testSlider() { function testSlider() {
$this->Jquery->get('#element'); $this->Jquery->get('#element');
$result = $this->Jquery->slider(array( $result = $this->Jquery->slider(array(
@ -329,7 +329,7 @@ class JqueryEngineHelperTestCase extends CakeTestCase {
* test the serializeForm method * test the serializeForm method
* *
* @return void * @return void
**/ */
function testSerializeForm() { function testSerializeForm() {
$this->Jquery->get('#element'); $this->Jquery->get('#element');
$result = $this->Jquery->serializeForm(array('isForm' => false)); $result = $this->Jquery->serializeForm(array('isForm' => false));

View file

@ -38,7 +38,7 @@ class OptionEngineHelper extends JsBaseEngineHelper {
* test method for testing option mapping * test method for testing option mapping
* *
* @return array * @return array
**/ */
function testMap($options = array()) { function testMap($options = array()) {
return $this->_mapOptions('request', $options); return $this->_mapOptions('request', $options);
} }
@ -46,7 +46,7 @@ class OptionEngineHelper extends JsBaseEngineHelper {
* test method for option parsing * test method for option parsing
* *
* @return void * @return void
**/ */
function testParseOptions($options, $safe = array()) { function testParseOptions($options, $safe = array()) {
return $this->_parseOptions($options, $safe); return $this->_parseOptions($options, $safe);
} }
@ -109,7 +109,7 @@ class JsHelperTestCase extends CakeTestCase {
* Switches $this->Js to a mocked engine. * Switches $this->Js to a mocked engine.
* *
* @return void * @return void
**/ */
function _useMock() { function _useMock() {
$this->Js =& new JsHelper(array('TestJs')); $this->Js =& new JsHelper(array('TestJs'));
$this->Js->TestJsEngine =& new TestJsEngineHelper($this); $this->Js->TestJsEngine =& new TestJsEngineHelper($this);
@ -122,7 +122,7 @@ class JsHelperTestCase extends CakeTestCase {
* test object construction * test object construction
* *
* @return void * @return void
**/ */
function testConstruction() { function testConstruction() {
$js =& new JsHelper(); $js =& new JsHelper();
$this->assertEqual($js->helpers, array('Html', 'Form', 'JqueryEngine')); $this->assertEqual($js->helpers, array('Html', 'Form', 'JqueryEngine'));
@ -141,7 +141,7 @@ class JsHelperTestCase extends CakeTestCase {
* test that methods dispatch internally and to the engine class * test that methods dispatch internally and to the engine class
* *
* @return void * @return void
**/ */
function testMethodDispatching() { function testMethodDispatching() {
$this->_useMock(); $this->_useMock();
$this->Js->TestJsEngine->expectOnce('dispatchMethod', array(new PatternExpectation('/methodOne/i'), array())); $this->Js->TestJsEngine->expectOnce('dispatchMethod', array(new PatternExpectation('/methodOne/i'), array()));
@ -157,7 +157,7 @@ class JsHelperTestCase extends CakeTestCase {
* Test that method dispatching respects buffer parameters and bufferedMethods Lists. * Test that method dispatching respects buffer parameters and bufferedMethods Lists.
* *
* @return void * @return void
**/ */
function testMethodDispatchWithBuffering() { function testMethodDispatchWithBuffering() {
$this->_useMock(); $this->_useMock();
@ -209,7 +209,7 @@ class JsHelperTestCase extends CakeTestCase {
* test that writeScripts generates scripts inline. * test that writeScripts generates scripts inline.
* *
* @return void * @return void
**/ */
function testWriteScriptsNoFile() { function testWriteScriptsNoFile() {
$this->_useMock(); $this->_useMock();
$this->Js->buffer('one = 1;'); $this->Js->buffer('one = 1;');
@ -236,7 +236,7 @@ class JsHelperTestCase extends CakeTestCase {
* test that writeScripts makes files, and puts the events into them. * test that writeScripts makes files, and puts the events into them.
* *
* @return void * @return void
**/ */
function testWriteScriptsInFile() { function testWriteScriptsInFile() {
if ($this->skipIf(!is_writable(JS), 'webroot/js is not Writable, script caching test has been skipped')) { if ($this->skipIf(!is_writable(JS), 'webroot/js is not Writable, script caching test has been skipped')) {
return; return;
@ -261,7 +261,7 @@ class JsHelperTestCase extends CakeTestCase {
* test link() * test link()
* *
* @return void * @return void
**/ */
function testLinkWithMock() { function testLinkWithMock() {
$this->_useMock(); $this->_useMock();
$options = array('update' => '#content'); $options = array('update' => '#content');
@ -322,7 +322,7 @@ CODE;
* test that link() and no buffering returns an <a> and <script> tags. * test that link() and no buffering returns an <a> and <script> tags.
* *
* @return void * @return void
**/ */
function testLinkWithNoBuffering() { function testLinkWithNoBuffering() {
$this->_useMock(); $this->_useMock();
$this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'ajax code', array('request', '*')); $this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'ajax code', array('request', '*'));
@ -359,7 +359,7 @@ CODE;
* test submit() with a Mock to check Engine method calls * test submit() with a Mock to check Engine method calls
* *
* @return void * @return void
**/ */
function testSubmitWithMock() { function testSubmitWithMock() {
$this->_useMock(); $this->_useMock();
@ -423,7 +423,7 @@ CODE;
* Test that Object::Object() is not breaking json output in JsHelper * Test that Object::Object() is not breaking json output in JsHelper
* *
* @return void * @return void
**/ */
function testObjectPassThrough() { function testObjectPassThrough() {
$result = $this->Js->object(array('one' => 'first', 'two' => 'second')); $result = $this->Js->object(array('one' => 'first', 'two' => 'second'));
$expected = '{"one":"first","two":"second"}'; $expected = '{"one":"first","two":"second"}';
@ -434,7 +434,7 @@ CODE;
* test set()'ing variables to the Javascript buffer and controlling the output var name. * test set()'ing variables to the Javascript buffer and controlling the output var name.
* *
* @return void * @return void
**/ */
function testSet() { function testSet() {
$this->Js->set('loggedIn', true); $this->Js->set('loggedIn', true);
$this->Js->set(array('height' => 'tall', 'color' => 'purple')); $this->Js->set(array('height' => 'tall', 'color' => 'purple'));
@ -463,7 +463,7 @@ CODE;
* JsBaseEngine Class Test case * JsBaseEngine Class Test case
* *
* @package cake.tests.view.helpers * @package cake.tests.view.helpers
**/ */
class JsBaseEngineTestCase extends CakeTestCase { class JsBaseEngineTestCase extends CakeTestCase {
/** /**
* startTest method * startTest method
@ -489,7 +489,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test escape string skills * test escape string skills
* *
* @return void * @return void
**/ */
function testEscaping() { function testEscaping() {
$result = $this->JsEngine->escape(''); $result = $this->JsEngine->escape('');
$expected = ''; $expected = '';
@ -520,7 +520,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test prompt() creation * test prompt() creation
* *
* @return void * @return void
**/ */
function testPrompt() { function testPrompt() {
$result = $this->JsEngine->prompt('Hey, hey you', 'hi!'); $result = $this->JsEngine->prompt('Hey, hey you', 'hi!');
$expected = 'prompt("Hey, hey you", "hi!");'; $expected = 'prompt("Hey, hey you", "hi!");';
@ -535,7 +535,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test alert generation * test alert generation
* *
* @return void * @return void
**/ */
function testAlert() { function testAlert() {
$result = $this->JsEngine->alert('Hey there'); $result = $this->JsEngine->alert('Hey there');
$expected = 'alert("Hey there");'; $expected = 'alert("Hey there");';
@ -550,7 +550,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test confirm generation * test confirm generation
* *
* @return void * @return void
**/ */
function testConfirm() { function testConfirm() {
$result = $this->JsEngine->confirm('Are you sure?'); $result = $this->JsEngine->confirm('Are you sure?');
$expected = 'confirm("Are you sure?");'; $expected = 'confirm("Are you sure?");';
@ -565,7 +565,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test Redirect * test Redirect
* *
* @return void * @return void
**/ */
function testRedirect() { function testRedirect() {
$result = $this->JsEngine->redirect(array('controller' => 'posts', 'action' => 'view', 1)); $result = $this->JsEngine->redirect(array('controller' => 'posts', 'action' => 'view', 1));
$expected = 'window.location = "/posts/view/1";'; $expected = 'window.location = "/posts/view/1";';
@ -576,7 +576,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* testObject encoding with non-native methods. * testObject encoding with non-native methods.
* *
* @return void * @return void
**/ */
function testObject() { function testObject() {
$this->JsEngine->useNative = false; $this->JsEngine->useNative = false;
@ -620,7 +620,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test compatibility of JsBaseEngineHelper::object() vs. json_encode() * test compatibility of JsBaseEngineHelper::object() vs. json_encode()
* *
* @return void * @return void
**/ */
function testObjectAgainstJsonEncode() { function testObjectAgainstJsonEncode() {
$skip = $this->skipIf(!function_exists('json_encode'), 'json_encode() not found, comparison tests skipped. %s'); $skip = $this->skipIf(!function_exists('json_encode'), 'json_encode() not found, comparison tests skipped. %s');
if ($skip) { if ($skip) {
@ -659,7 +659,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test that JSON made with JsBaseEngineHelper::object() against json_decode() * test that JSON made with JsBaseEngineHelper::object() against json_decode()
* *
* @return void * @return void
**/ */
function testObjectAgainstJsonDecode() { function testObjectAgainstJsonDecode() {
$skip = $this->skipIf(!function_exists('json_encode'), 'json_encode() not found, comparison tests skipped. %s'); $skip = $this->skipIf(!function_exists('json_encode'), 'json_encode() not found, comparison tests skipped. %s');
if ($skip) { if ($skip) {
@ -684,7 +684,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test Mapping of options. * test Mapping of options.
* *
* @return void * @return void
**/ */
function testOptionMapping() { function testOptionMapping() {
$JsEngine = new OptionEngineHelper(); $JsEngine = new OptionEngineHelper();
$result = $JsEngine->testMap(); $result = $JsEngine->testMap();
@ -704,7 +704,7 @@ class JsBaseEngineTestCase extends CakeTestCase {
* test that option parsing escapes strings and saves what is supposed to be saved. * test that option parsing escapes strings and saves what is supposed to be saved.
* *
* @return void * @return void
**/ */
function testOptionParsing() { function testOptionParsing() {
$JsEngine = new OptionEngineHelper(); $JsEngine = new OptionEngineHelper();

View file

@ -27,7 +27,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* startTest * startTest
* *
* @return void * @return void
**/ */
function startTest() { function startTest() {
$this->Moo =& new MootoolsEngineHelper(); $this->Moo =& new MootoolsEngineHelper();
} }
@ -35,7 +35,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* end test * end test
* *
* @return void * @return void
**/ */
function endTest() { function endTest() {
unset($this->Moo); unset($this->Moo);
} }
@ -43,7 +43,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test selector method * test selector method
* *
* @return void * @return void
**/ */
function testSelector() { function testSelector() {
$result = $this->Moo->get('#content'); $result = $this->Moo->get('#content');
$this->assertEqual($result, $this->Moo); $this->assertEqual($result, $this->Moo);
@ -73,7 +73,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test event binding * test event binding
* *
* @return void * @return void
**/ */
function testEvent() { function testEvent() {
$this->Moo->get('#myLink'); $this->Moo->get('#myLink');
$result = $this->Moo->event('click', 'doClick', array('wrap' => false)); $result = $this->Moo->event('click', 'doClick', array('wrap' => false));
@ -92,7 +92,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test dom ready event creation * test dom ready event creation
* *
* @return void * @return void
**/ */
function testDomReady() { function testDomReady() {
$result = $this->Moo->domReady('foo.name = "bar";'); $result = $this->Moo->domReady('foo.name = "bar";');
$expected = 'window.addEvent("domready", function (event) {foo.name = "bar";});'; $expected = 'window.addEvent("domready", function (event) {foo.name = "bar";});';
@ -102,7 +102,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test Each method * test Each method
* *
* @return void * @return void
**/ */
function testEach() { function testEach() {
$this->Moo->get('#foo'); $this->Moo->get('#foo');
$result = $this->Moo->each('item.setStyle("display", "none");'); $result = $this->Moo->each('item.setStyle("display", "none");');
@ -113,7 +113,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test Effect generation * test Effect generation
* *
* @return void * @return void
**/ */
function testEffect() { function testEffect() {
$this->Moo->get('#foo'); $this->Moo->get('#foo');
$result = $this->Moo->effect('show'); $result = $this->Moo->effect('show');
@ -152,7 +152,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* Test Request Generation * Test Request Generation
* *
* @return void * @return void
**/ */
function testRequest() { function testRequest() {
$result = $this->Moo->request(array('controller' => 'posts', 'action' => 'view', 1)); $result = $this->Moo->request(array('controller' => 'posts', 'action' => 'view', 1));
$expected = 'var jsRequest = new Request({url:"\\/posts\\/view\\/1"}).send();'; $expected = 'var jsRequest = new Request({url:"\\/posts\\/view\\/1"}).send();';
@ -222,7 +222,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test sortable list generation * test sortable list generation
* *
* @return void * @return void
**/ */
function testSortable() { function testSortable() {
$this->Moo->get('#myList'); $this->Moo->get('#myList');
$result = $this->Moo->sortable(array( $result = $this->Moo->sortable(array(
@ -240,7 +240,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test drag() method * test drag() method
* *
* @return void * @return void
**/ */
function testDrag() { function testDrag() {
$this->Moo->get('#drag-me'); $this->Moo->get('#drag-me');
$result = $this->Moo->drag(array( $result = $this->Moo->drag(array(
@ -257,7 +257,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test drop() method * test drop() method
* *
* @return void * @return void
**/ */
function testDrop() { function testDrop() {
$this->expectError(); $this->expectError();
$this->Moo->get('#drop-me'); $this->Moo->get('#drop-me');
@ -291,7 +291,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test slider generation * test slider generation
* *
* @return void * @return void
**/ */
function testSlider() { function testSlider() {
$this->Moo->get('#slider'); $this->Moo->get('#slider');
$result = $this->Moo->slider(array( $result = $this->Moo->slider(array(
@ -332,7 +332,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
* test the serializeForm implementation. * test the serializeForm implementation.
* *
* @return void * @return void
**/ */
function testSerializeForm() { function testSerializeForm() {
$this->Moo->get('#element'); $this->Moo->get('#element');
$result = $this->Moo->serializeForm(array('isForm' => true)); $result = $this->Moo->serializeForm(array('isForm' => true));

View file

@ -731,7 +731,7 @@ class PaginatorHelperTest extends CakeTestCase {
* allowing you to use shortcut syntax * allowing you to use shortcut syntax
* *
* @return void * @return void
**/ */
function testPagingLinksOptionsReplaceEmptyDisabledOptions() { function testPagingLinksOptionsReplaceEmptyDisabledOptions() {
$this->Paginator->params['paging'] = array( $this->Paginator->params['paging'] = array(
'Client' => array( 'Client' => array(
@ -1735,7 +1735,7 @@ class PaginatorHelperTest extends CakeTestCase {
* test that mock classes injected into paginatorHelper are called when using link() * test that mock classes injected into paginatorHelper are called when using link()
* *
* @return void * @return void
**/ */
function testMockAjaxProviderClassInjection() { function testMockAjaxProviderClassInjection() {
$Paginator =& new PaginatorHelper(array('ajax' => 'PaginatorMockJs')); $Paginator =& new PaginatorHelper(array('ajax' => 'PaginatorMockJs'));
$Paginator->params['paging'] = array( $Paginator->params['paging'] = array(

View file

@ -25,7 +25,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* startTest * startTest
* *
* @return void * @return void
**/ */
function startTest() { function startTest() {
$this->Proto =& new PrototypeEngineHelper(); $this->Proto =& new PrototypeEngineHelper();
} }
@ -34,7 +34,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* end test * end test
* *
* @return void * @return void
**/ */
function endTest() { function endTest() {
unset($this->Proto); unset($this->Proto);
} }
@ -43,7 +43,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* test selector method * test selector method
* *
* @return void * @return void
**/ */
function testSelector() { function testSelector() {
$result = $this->Proto->get('#content'); $result = $this->Proto->get('#content');
$this->assertEqual($result, $this->Proto); $this->assertEqual($result, $this->Proto);
@ -74,7 +74,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* test event binding * test event binding
* *
* @return void * @return void
**/ */
function testEvent() { function testEvent() {
$this->Proto->get('#myLink'); $this->Proto->get('#myLink');
$result = $this->Proto->event('click', 'doClick', array('wrap' => false)); $result = $this->Proto->event('click', 'doClick', array('wrap' => false));
@ -94,7 +94,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* test dom ready event creation * test dom ready event creation
* *
* @return void * @return void
**/ */
function testDomReady() { function testDomReady() {
$result = $this->Proto->domReady('foo.name = "bar";'); $result = $this->Proto->domReady('foo.name = "bar";');
$expected = 'document.observe("dom:loaded", function (event) {foo.name = "bar";});'; $expected = 'document.observe("dom:loaded", function (event) {foo.name = "bar";});';
@ -105,7 +105,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* test Each method * test Each method
* *
* @return void * @return void
**/ */
function testEach() { function testEach() {
$this->Proto->get('#foo li'); $this->Proto->get('#foo li');
$result = $this->Proto->each('item.hide();'); $result = $this->Proto->each('item.hide();');
@ -117,7 +117,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* test Effect generation * test Effect generation
* *
* @return void * @return void
**/ */
function testEffect() { function testEffect() {
$this->Proto->get('#foo'); $this->Proto->get('#foo');
$result = $this->Proto->effect('show'); $result = $this->Proto->effect('show');
@ -173,7 +173,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* Test Request Generation * Test Request Generation
* *
* @return void * @return void
**/ */
function testRequest() { function testRequest() {
$result = $this->Proto->request(array('controller' => 'posts', 'action' => 'view', 1)); $result = $this->Proto->request(array('controller' => 'posts', 'action' => 'view', 1));
$expected = 'var jsRequest = new Ajax.Request("/posts/view/1");'; $expected = 'var jsRequest = new Ajax.Request("/posts/view/1");';
@ -253,7 +253,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* test sortable list generation * test sortable list generation
* *
* @return void * @return void
**/ */
function testSortable() { function testSortable() {
$this->Proto->get('#myList'); $this->Proto->get('#myList');
$result = $this->Proto->sortable(array( $result = $this->Proto->sortable(array(
@ -272,7 +272,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* in new Drag() when selection is a multiple type. Iterate over the array. * in new Drag() when selection is a multiple type. Iterate over the array.
* *
* @return void * @return void
**/ */
function testDrag() { function testDrag() {
$this->Proto->get('#element'); $this->Proto->get('#element');
$result = $this->Proto->drag(array( $result = $this->Proto->drag(array(
@ -301,7 +301,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* test drop() method * test drop() method
* *
* @return void * @return void
**/ */
function testDrop() { function testDrop() {
$this->Proto->get('#element'); $this->Proto->get('#element');
$result = $this->Proto->drop(array( $result = $this->Proto->drop(array(
@ -318,7 +318,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* ensure that slider() method behaves properly * ensure that slider() method behaves properly
* *
* @return void * @return void
**/ */
function testSlider() { function testSlider() {
$this->Proto->get('#element'); $this->Proto->get('#element');
$result = $this->Proto->slider(array( $result = $this->Proto->slider(array(
@ -347,7 +347,7 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
* test the serializeForm implementation. * test the serializeForm implementation.
* *
* @return void * @return void
**/ */
function testSerializeForm() { function testSerializeForm() {
$this->Proto->get('#element'); $this->Proto->get('#element');
$result = $this->Proto->serializeForm(array('isForm' => true)); $result = $this->Proto->serializeForm(array('isForm' => true));

View file

@ -95,7 +95,7 @@ class SessionHelperTest extends CakeTestCase {
* test construction and initial property settings * test construction and initial property settings
* *
* @return void * @return void
**/ */
function testConstruct() { function testConstruct() {
$this->assertFalse(empty($this->Session->sessionTime)); $this->assertFalse(empty($this->Session->sessionTime));
$this->assertFalse(empty($this->Session->security)); $this->assertFalse(empty($this->Session->security));

View file

@ -293,7 +293,7 @@ class ViewTest extends CakeTestCase {
* test that plugin/$plugin_name is only appended to the paths it should be. * test that plugin/$plugin_name is only appended to the paths it should be.
* *
* @return void * @return void
**/ */
function testPluginPathGeneration() { function testPluginPathGeneration() {
$this->Controller->plugin = 'test_plugin'; $this->Controller->plugin = 'test_plugin';
$this->Controller->name = 'TestPlugin'; $this->Controller->name = 'TestPlugin';
@ -319,7 +319,7 @@ class ViewTest extends CakeTestCase {
* test that CamelCase plugins still find their view files. * test that CamelCase plugins still find their view files.
* *
* @return void * @return void
**/ */
function testCamelCasePluginGetTemplate() { function testCamelCasePluginGetTemplate() {
$this->Controller->plugin = 'TestPlugin'; $this->Controller->plugin = 'TestPlugin';
$this->Controller->name = 'TestPlugin'; $this->Controller->name = 'TestPlugin';
@ -572,7 +572,7 @@ class ViewTest extends CakeTestCase {
* test the correct triggering of helper callbacks * test the correct triggering of helper callbacks
* *
* @return void * @return void
**/ */
function testHelperCallbackTriggering() { function testHelperCallbackTriggering() {
$this->PostsController->helpers = array('Html', 'CallbackMock'); $this->PostsController->helpers = array('Html', 'CallbackMock');
$View =& new TestView($this->PostsController); $View =& new TestView($this->PostsController);
@ -702,7 +702,7 @@ class ViewTest extends CakeTestCase {
* test rendering layout with cache helper loaded * test rendering layout with cache helper loaded
* *
* @return void * @return void
**/ */
function testRenderLayoutWithMockCacheHelper() { function testRenderLayoutWithMockCacheHelper() {
$_check = Configure::read('Cache.check'); $_check = Configure::read('Cache.check');
Configure::write('Cache.check', true); Configure::write('Cache.check', true);

View file

@ -120,7 +120,7 @@ class XmlTest extends CakeTestCase {
* test serialization of boolean and null values. false = 0, true = 1, null = '' * test serialization of boolean and null values. false = 0, true = 1, null = ''
* *
* @return void * @return void
**/ */
function testSerializationOfBooleanAndBooleanishValues() { function testSerializationOfBooleanAndBooleanishValues() {
$xml =& new Xml(array('data' => array('example' => false))); $xml =& new Xml(array('data' => array('example' => false)));
$result = $xml->toString(false); $result = $xml->toString(false);
@ -732,7 +732,7 @@ class XmlTest extends CakeTestCase {
* *
* @access public * @access public
* @return void * @return void
**/ */
function testElementCollapsing() { function testElementCollapsing() {
$xmlDataThatFails = '<resultpackage> $xmlDataThatFails = '<resultpackage>
<result qid="46b1c46ed6208"><![CDATA[46b1c46ed3af9]]></result> <result qid="46b1c46ed6208"><![CDATA[46b1c46ed3af9]]></result>
@ -794,7 +794,7 @@ class XmlTest extends CakeTestCase {
* *
* @see http://code.cakephp.org/tickets/view/8 * @see http://code.cakephp.org/tickets/view/8
* @return void * @return void
**/ */
function testCaseFoldingWithEmptyValues() { function testCaseFoldingWithEmptyValues() {
$filledValue = '<method name="set_user_settings"> $filledValue = '<method name="set_user_settings">
<title>update user information</title> <title>update user information</title>

View file

@ -56,7 +56,7 @@ class CakeHtmlReporter extends SimpleReporter {
* *
* @param * @param
* @return void * @return void
**/ */
function paintGroupStart($test_name, $size) { function paintGroupStart($test_name, $size) {
if (empty($this->_timeStart)) { if (empty($this->_timeStart)) {
$this->_timeStart = $this->_getTime(); $this->_timeStart = $this->_getTime();
@ -69,7 +69,7 @@ class CakeHtmlReporter extends SimpleReporter {
* and timers are stopped. * and timers are stopped.
* *
* @return void * @return void
**/ */
function paintGroupEnd($test_name) { function paintGroupEnd($test_name) {
$this->_timeEnd = $this->_getTime(); $this->_timeEnd = $this->_getTime();
$this->_timeDuration = $this->_timeEnd - $this->_timeStart; $this->_timeDuration = $this->_timeEnd - $this->_timeStart;
@ -81,7 +81,7 @@ class CakeHtmlReporter extends SimpleReporter {
* but in a separate function to reduce dependancies. * but in a separate function to reduce dependancies.
* *
* @return float Time in microseconds * @return float Time in microseconds
**/ */
function _getTime() { function _getTime() {
list($usec, $sec) = explode(' ', microtime()); list($usec, $sec) = explode(' ', microtime());
return ((float)$sec + (float)$usec); return ((float)$sec + (float)$usec);

View file

@ -32,7 +32,7 @@ class CakeTestFixture extends Object {
* Name of the object * Name of the object
* *
* @var string * @var string
**/ */
var $name = null; var $name = null;
/** /**

View file

@ -11,7 +11,7 @@ class CakeTextReporter extends TextReporter {
* *
* @param * @param
* @return void * @return void
**/ */
function paintGroupStart($test_name, $size) { function paintGroupStart($test_name, $size) {
if (empty($this->_timeStart)) { if (empty($this->_timeStart)) {
$this->_timeStart = $this->_getTime(); $this->_timeStart = $this->_getTime();
@ -24,7 +24,7 @@ class CakeTextReporter extends TextReporter {
* and timers are stopped. * and timers are stopped.
* *
* @return void * @return void
**/ */
function paintGroupEnd($test_name) { function paintGroupEnd($test_name) {
$this->_timeEnd = $this->_getTime(); $this->_timeEnd = $this->_getTime();
$this->_timeDuration = $this->_timeEnd - $this->_timeStart; $this->_timeDuration = $this->_timeEnd - $this->_timeStart;
@ -36,7 +36,7 @@ class CakeTextReporter extends TextReporter {
* but in a separate function to reduce dependancies. * but in a separate function to reduce dependancies.
* *
* @return float Time in microseconds * @return float Time in microseconds
**/ */
function _getTime() { function _getTime() {
list($usec, $sec) = explode(' ', microtime()); list($usec, $sec) = explode(' ', microtime());
return ((float)$sec + (float)$usec); return ((float)$sec + (float)$usec);