Merge branch 'master' into 2.5

Conflicts:
	lib/Cake/VERSION.txt
This commit is contained in:
mark_story 2013-09-17 10:11:24 -04:00
commit a7a6fcae8a
55 changed files with 177 additions and 119 deletions

View file

@ -45,7 +45,7 @@
* - `handler` - callback - The callback to handle errors. You can set this to any callable type, * - `handler` - callback - The callback to handle errors. You can set this to any callable type,
* including anonymous functions. * including anonymous functions.
* Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class * Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
* - `level` - int - The level of errors you are interested in capturing. * - `level` - integer - The level of errors you are interested in capturing.
* - `trace` - boolean - Include stack traces for errors in log files. * - `trace` - boolean - Include stack traces for errors in log files.
* *
* @see ErrorHandler for more information on error handling and configuration. * @see ErrorHandler for more information on error handling and configuration.

View file

@ -39,7 +39,7 @@ class RedisEngine extends CacheEngine {
* - server = string URL or ip to the Redis server host * - server = string URL or ip to the Redis server host
* - port = integer port number to the Redis server (default: 6379) * - port = integer port number to the Redis server (default: 6379)
* - timeout = float timeout in seconds (default: 0) * - timeout = float timeout in seconds (default: 0)
* - persistent = bool Connects to the Redis server with a persistent connection (default: true) * - persistent = boolean Connects to the Redis server with a persistent connection (default: true)
* *
* @var array * @var array
*/ */

View file

@ -155,7 +155,7 @@ class IniReader implements ConfigReaderInterface {
* @param string $key The identifier to write to. If the key has a . it will be treated * @param string $key The identifier to write to. If the key has a . it will be treated
* as a plugin prefix. * as a plugin prefix.
* @param array $data The data to convert to ini file. * @param array $data The data to convert to ini file.
* @return int Bytes saved. * @return integer Bytes saved.
*/ */
public function dump($key, $data) { public function dump($key, $data) {
$result = array(); $result = array();

View file

@ -83,7 +83,7 @@ class PhpReader implements ConfigReaderInterface {
* @param string $key The identifier to write to. If the key has a . it will be treated * @param string $key The identifier to write to. If the key has a . it will be treated
* as a plugin prefix. * as a plugin prefix.
* @param array $data Data to dump. * @param array $data Data to dump.
* @return int Bytes saved. * @return integer Bytes saved.
*/ */
public function dump($key, $data) { public function dump($key, $data) {
$contents = '<?php' . "\n" . '$config = ' . var_export($data, true) . ';'; $contents = '<?php' . "\n" . '$config = ' . var_export($data, true) . ';';

View file

@ -39,7 +39,7 @@ class ConsoleInput {
* 2. Handle we are attached to must be stdin. * 2. Handle we are attached to must be stdin.
* Allows rich editing with arrow keys and history when inputting a string. * Allows rich editing with arrow keys and history when inputting a string.
* *
* @var bool * @var boolean
*/ */
protected $_canReadline; protected $_canReadline;
@ -73,7 +73,7 @@ class ConsoleInput {
* Checks if data is available on the stream * Checks if data is available on the stream
* *
* @param integer $timeout An optional time to wait for data * @param integer $timeout An optional time to wait for data
* @return bool True for data available, false otherwise * @return boolean True for data available, false otherwise
*/ */
public function dataAvailable($timeout = 0) { public function dataAvailable($timeout = 0) {
$readFds = array($this->_input); $readFds = array($this->_input);

View file

@ -36,7 +36,7 @@
* - `handler` - callback - The callback to handle errors. You can set this to any callable type, * - `handler` - callback - The callback to handle errors. You can set this to any callable type,
* including anonymous functions. * including anonymous functions.
* Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class * Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
* - `level` - int - The level of errors you are interested in capturing. * - `level` - integer - The level of errors you are interested in capturing.
* - `trace` - boolean - Include stack traces for errors in log files. * - `trace` - boolean - Include stack traces for errors in log files.
* *
* @see ErrorHandler for more information on error handling and configuration. * @see ErrorHandler for more information on error handling and configuration.

View file

@ -211,7 +211,7 @@ class AuthComponent extends Component {
* Error to display when user attempts to access an object or action to which they do not have * Error to display when user attempts to access an object or action to which they do not have
* access. * access.
* *
* @var string|bool Error message or boolean false to suppress flash message * @var string|boolean Error message or boolean false to suppress flash message
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#AuthComponent::$authError * @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#AuthComponent::$authError
*/ */
public $authError = null; public $authError = null;
@ -812,7 +812,7 @@ class AuthComponent extends Component {
* @return boolean true if the user is logged in, false otherwise * @return boolean true if the user is logged in, false otherwise
*/ */
public function loggedIn() { public function loggedIn() {
return (boolean)$this->user(); return (bool)$this->user();
} }
/** /**

View file

@ -718,7 +718,7 @@ class Controller extends Object implements CakeEventListener {
* *
* @param string $modelClass Name of model class to load * @param string $modelClass Name of model class to load
* @param integer|string $id Initial ID the instanced model class should have * @param integer|string $id Initial ID the instanced model class should have
* @return bool True if the model was found * @return boolean True if the model was found
* @throws MissingModelException if the model class cannot be found. * @throws MissingModelException if the model class cannot be found.
*/ */
public function loadModel($modelClass = null, $id = null) { public function loadModel($modelClass = null, $id = null) {

View file

@ -298,7 +298,7 @@ class ExceptionRenderer {
protected function _outputMessageSafe($template) { protected function _outputMessageSafe($template) {
$this->controller->layoutPath = null; $this->controller->layoutPath = null;
$this->controller->subDir = null; $this->controller->subDir = null;
$this->controller->viewPath = 'Errors/'; $this->controller->viewPath = 'Errors';
$this->controller->layout = 'error'; $this->controller->layout = 'error';
$this->controller->helpers = array('Form', 'Html', 'Session'); $this->controller->helpers = array('Form', 'Html', 'Session');

View file

@ -32,7 +32,7 @@ class CakeEventManager {
/** /**
* The default priority queue value for new, attached listeners * The default priority queue value for new, attached listeners
* *
* @var int * @var integer
*/ */
public static $defaultPriority = 10; public static $defaultPriority = 10;

View file

@ -169,6 +169,7 @@ class CakeLog {
* {{{ * {{{
* CakeLog::config('payments', array( * CakeLog::config('payments', array(
* 'engine' => 'File', * 'engine' => 'File',
* 'types' => array('info', 'error', 'warning'),
* 'scopes' => array('payment', 'order') * 'scopes' => array('payment', 'order')
* )); * ));
* }}} * }}}

View file

@ -146,7 +146,7 @@ class SyslogLog extends BaseLog {
* *
* @param integer $priority * @param integer $priority
* @param string $message * @param string $message
* @return bool * @return boolean
*/ */
protected function _write($priority, $message) { protected function _write($priority, $message) {
return syslog($priority, $message); return syslog($priority, $message);

View file

@ -38,7 +38,7 @@ class DatabaseSession implements CakeSessionHandlerInterface {
/** /**
* Number of seconds to mark the session as expired * Number of seconds to mark the session as expired
* *
* @var int * @var integer
*/ */
protected $_timeout; protected $_timeout;

View file

@ -3142,10 +3142,12 @@ class Model extends Object implements CakeEventListener {
} }
/** /**
* Returns an array of fields that have failed validation. On the current model. * Returns an array of fields that have failed the validation of the current model.
*
* Additionally it populates the validationErrors property of the model with the same array.
* *
* @param string $options An optional array of custom options to be made available in the beforeValidate callback * @param string $options An optional array of custom options to be made available in the beforeValidate callback
* @return array Array of invalid fields * @return array Array of invalid fields and their error messages
* @see Model::validates() * @see Model::validates()
*/ */
public function invalidFields($options = array()) { public function invalidFields($options = array()) {

View file

@ -526,7 +526,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
/** /**
* Returns the number of fields having validation rules * Returns the number of fields having validation rules
* *
* @return int * @return integer
*/ */
public function count() { public function count() {
$this->_parseRules(); $this->_parseRules();

View file

@ -359,7 +359,7 @@ class CakeValidationSet implements ArrayAccess, IteratorAggregate, Countable {
/** /**
* Returns the number of rules in this set * Returns the number of rules in this set
* *
* @return int * @return integer
*/ */
public function count() { public function count() {
return count($this->_rules); return count($this->_rules);

View file

@ -848,7 +848,7 @@ class CakeResponse {
* If called with no parameters, this function will return the current max-age value if any * If called with no parameters, this function will return the current max-age value if any
* *
* @param integer $seconds if null, the method will return the current s-maxage value * @param integer $seconds if null, the method will return the current s-maxage value
* @return int * @return integer
*/ */
public function sharedMaxAge($seconds = null) { public function sharedMaxAge($seconds = null) {
if ($seconds !== null) { if ($seconds !== null) {
@ -868,7 +868,7 @@ class CakeResponse {
* If called with no parameters, this function will return the current max-age value if any * If called with no parameters, this function will return the current max-age value if any
* *
* @param integer $seconds if null, the method will return the current max-age value * @param integer $seconds if null, the method will return the current max-age value
* @return int * @return integer
*/ */
public function maxAge($seconds = null) { public function maxAge($seconds = null) {
if ($seconds !== null) { if ($seconds !== null) {

View file

@ -762,6 +762,10 @@ class CakeEmail {
/** /**
* Format addresses * Format addresses
* *
* If the address contains non alphanumeric/whitespace characters, it will
* be quoted as characters like `:` and `,` are known to cause issues
* in address header fields.
*
* @param array $address * @param array $address
* @return array * @return array
*/ */
@ -771,10 +775,11 @@ class CakeEmail {
if ($email === $alias) { if ($email === $alias) {
$return[] = $email; $return[] = $email;
} else { } else {
if (strpos($alias, ',') !== false) { $encoded = $this->_encode($alias);
$alias = '"' . $alias . '"'; if ($encoded === $alias && preg_match('/[^a-z0-9 ]/i', $encoded)) {
$encoded = '"' . str_replace('"', '\"', $encoded) . '"';
} }
$return[] = sprintf('%s <%s>', $this->_encode($alias), $email); $return[] = sprintf('%s <%s>', $encoded, $email);
} }
} }
return $return; return $return;

View file

@ -243,7 +243,7 @@ class Dispatcher implements CakeEventListener {
* Load controller and return controller classname * Load controller and return controller classname
* *
* @param CakeRequest $request * @param CakeRequest $request
* @return string|bool Name of controller class name * @return string|boolean Name of controller class name
*/ */
protected function _loadController($request) { protected function _loadController($request) {
$pluginName = $pluginPath = $controller = null; $pluginName = $pluginPath = $controller = null;

View file

@ -31,7 +31,7 @@ abstract class DispatcherFilter implements CakeEventListener {
/** /**
* Default priority for all methods in this filter * Default priority for all methods in this filter
* *
* @var int * @var integer
*/ */
public $priority = 10; public $priority = 10;

View file

@ -31,7 +31,7 @@ class AssetDispatcher extends DispatcherFilter {
* Default priority for all methods in this filter * Default priority for all methods in this filter
* This filter should run before the request gets parsed by router * This filter should run before the request gets parsed by router
* *
* @var int * @var integer
*/ */
public $priority = 9; public $priority = 9;

View file

@ -27,7 +27,7 @@ class CacheDispatcher extends DispatcherFilter {
* Default priority for all methods in this filter * Default priority for all methods in this filter
* This filter should run before the request gets parsed by router * This filter should run before the request gets parsed by router
* *
* @var int * @var integer
*/ */
public $priority = 9; public $priority = 9;

View file

@ -784,7 +784,7 @@ class Router {
* or an array specifying any of the following: 'controller', 'action', * or an array specifying any of the following: 'controller', 'action',
* and/or 'plugin', in addition to named arguments (keyed array elements), * and/or 'plugin', in addition to named arguments (keyed array elements),
* and standard URL arguments (indexed array elements) * and standard URL arguments (indexed array elements)
* @param bool|array $full If (bool) true, the full base URL will be prepended to the result. * @param boolean|array $full If (bool) true, the full base URL will be prepended to the result.
* If an array accepts the following keys * If an array accepts the following keys
* - escape - used when making URLs embedded in html escapes query string '&' * - escape - used when making URLs embedded in html escapes query string '&'
* - full - if true the full base URL will be prepended. * - full - if true the full base URL will be prepended.

View file

@ -278,7 +278,7 @@ class BasicsTest extends CakeTestCase {
Configure::write('Cache.disable', false); Configure::write('Cache.disable', false);
$result = cache('basics_test', 'simple cache write'); $result = cache('basics_test', 'simple cache write');
$this->assertTrue((boolean)$result); $this->assertTrue((bool)$result);
$this->assertTrue(file_exists(CACHE . 'basics_test')); $this->assertTrue(file_exists(CACHE . 'basics_test'));
$result = cache('basics_test'); $result = cache('basics_test');

View file

@ -44,7 +44,7 @@ class FixtureTaskTest extends CakeTestCase {
/** /**
* Whether backup global state for each test method or not * Whether backup global state for each test method or not
* *
* @var bool false * @var boolean
*/ */
public $backupGlobals = false; public $backupGlobals = false;

View file

@ -42,7 +42,7 @@ class AclNodeTwoTestBase extends AclNode {
/** /**
* cacheSources property * cacheSources property
* *
* @var bool false * @var boolean
*/ */
public $cacheSources = false; public $cacheSources = false;
} }
@ -129,7 +129,7 @@ class PermissionTwoTest extends Permission {
/** /**
* cacheQueries property * cacheQueries property
* *
* @var bool false * @var boolean
*/ */
public $cacheQueries = false; public $cacheQueries = false;

View file

@ -33,7 +33,7 @@ class TestAuthComponent extends AuthComponent {
/** /**
* testStop property * testStop property
* *
* @var bool false * @var boolean
*/ */
public $testStop = false; public $testStop = false;
@ -271,7 +271,7 @@ class AuthComponentTest extends CakeTestCase {
/** /**
* initialized property * initialized property
* *
* @var bool false * @var boolean
*/ */
public $initialized = false; public $initialized = false;

View file

@ -761,7 +761,7 @@ class ExceptionRendererTest extends CakeTestCase {
$ExceptionRenderer->render(); $ExceptionRenderer->render();
$this->assertEquals('', $ExceptionRenderer->controller->layoutPath); $this->assertEquals('', $ExceptionRenderer->controller->layoutPath);
$this->assertEquals('', $ExceptionRenderer->controller->subDir); $this->assertEquals('', $ExceptionRenderer->controller->subDir);
$this->assertEquals('Errors/', $ExceptionRenderer->controller->viewPath); $this->assertEquals('Errors', $ExceptionRenderer->controller->viewPath);
} }
/** /**

View file

@ -38,7 +38,7 @@ class DbAclNodeTestBase extends AclNode {
/** /**
* cacheSources property * cacheSources property
* *
* @var bool false * @var boolean
*/ */
public $cacheSources = false; public $cacheSources = false;
} }
@ -104,7 +104,7 @@ class DbPermissionTest extends CakeTestModel {
/** /**
* cacheQueries property * cacheQueries property
* *
* @var bool false * @var boolean
*/ */
public $cacheQueries = false; public $cacheQueries = false;

View file

@ -27,7 +27,7 @@ class TranslateBehaviorTest extends CakeTestCase {
/** /**
* autoFixtures property * autoFixtures property
* *
* @var bool false * @var boolean
*/ */
public $autoFixtures = false; public $autoFixtures = false;

View file

@ -32,7 +32,7 @@ class TreeBehaviorAfterTest extends CakeTestCase {
/** /**
* Whether backup global state for each test method or not * Whether backup global state for each test method or not
* *
* @var bool false * @var boolean
*/ */
public $backupGlobals = false; public $backupGlobals = false;

View file

@ -34,7 +34,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
/** /**
* Whether backup global state for each test method or not * Whether backup global state for each test method or not
* *
* @var bool false * @var boolean
*/ */
public $backupGlobals = false; public $backupGlobals = false;

View file

@ -34,7 +34,7 @@ class TreeBehaviorScopedTest extends CakeTestCase {
/** /**
* Whether backup global state for each test method or not * Whether backup global state for each test method or not
* *
* @var bool false * @var boolean
*/ */
public $backupGlobals = false; public $backupGlobals = false;

View file

@ -35,7 +35,7 @@ class TreeBehaviorUuidTest extends CakeTestCase {
/** /**
* Whether backup global state for each test method or not * Whether backup global state for each test method or not
* *
* @var bool false * @var boolean
*/ */
public $backupGlobals = false; public $backupGlobals = false;

View file

@ -35,7 +35,7 @@ class MysqlTest extends CakeTestCase {
/** /**
* autoFixtures property * autoFixtures property
* *
* @var bool false * @var boolean
*/ */
public $autoFixtures = false; public $autoFixtures = false;

View file

@ -69,7 +69,7 @@ class PostgresTestModel extends Model {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -150,7 +150,7 @@ class PostgresClientTestModel extends Model {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;

View file

@ -118,7 +118,7 @@ class SqlserverTestModel extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -184,7 +184,7 @@ class SqlserverClientTestModel extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -250,7 +250,7 @@ class SqlserverTest extends CakeTestCase {
/** /**
* autoFixtures property * autoFixtures property
* *
* @var bool false * @var boolean
*/ */
public $autoFixtures = false; public $autoFixtures = false;

View file

@ -116,7 +116,7 @@ class DboSourceTest extends CakeTestCase {
/** /**
* autoFixtures property * autoFixtures property
* *
* @var bool false * @var boolean
*/ */
public $autoFixtures = false; public $autoFixtures = false;

View file

@ -32,14 +32,14 @@ abstract class BaseModelTest extends CakeTestCase {
/** /**
* autoFixtures property * autoFixtures property
* *
* @var bool false * @var boolean
*/ */
public $autoFixtures = false; public $autoFixtures = false;
/** /**
* Whether backup global state for each test method or not * Whether backup global state for each test method or not
* *
* @var bool false * @var boolean
*/ */
public $backupGlobals = false; public $backupGlobals = false;

View file

@ -7144,7 +7144,7 @@ class ModelWriteTest extends BaseModelTest {
$TestModel = new Item(); $TestModel = new Item();
$result = $TestModel->save(array('published' => true, 'id' => 1)); $result = $TestModel->save(array('published' => true, 'id' => 1));
$this->assertTrue((boolean)$result); $this->assertTrue((bool)$result);
$result = $TestModel->find('first', array( $result = $TestModel->find('first', array(
'fields' => array('id', 'published'), 'fields' => array('id', 'published'),
'conditions' => array('Item.id' => 1))); 'conditions' => array('Item.id' => 1)));

View file

@ -68,7 +68,7 @@ class Test extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -105,7 +105,7 @@ class TestAlias extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -141,7 +141,7 @@ class TestValidate extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -215,7 +215,7 @@ class User extends CakeTestModel {
/** /**
* beforeFind() callback used to run ContainableBehaviorTest::testLazyLoad() * beforeFind() callback used to run ContainableBehaviorTest::testLazyLoad()
* *
* @return bool * @return boolean
* @throws Exception * @throws Exception
*/ */
public function beforeFind($queryData) { public function beforeFind($queryData) {
@ -278,7 +278,7 @@ class Article extends CakeTestModel {
/** /**
* beforeSaveReturn property * beforeSaveReturn property
* *
* @var bool true * @var boolean
*/ */
public $beforeSaveReturn = true; public $beforeSaveReturn = true;
@ -2105,7 +2105,7 @@ class TheVoid extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
} }
@ -2127,7 +2127,7 @@ class ValidationTest1 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -2213,7 +2213,7 @@ class ValidationTest2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -3079,7 +3079,7 @@ class TranslatedItem extends CakeTestModel {
/** /**
* cacheQueries property * cacheQueries property
* *
* @var bool false * @var boolean
*/ */
public $cacheQueries = false; public $cacheQueries = false;
@ -3116,7 +3116,7 @@ class TranslatedItem2 extends CakeTestModel {
/** /**
* cacheQueries property * cacheQueries property
* *
* @var bool false * @var boolean
*/ */
public $cacheQueries = false; public $cacheQueries = false;
@ -3160,7 +3160,7 @@ class TranslatedItemWithTable extends CakeTestModel {
/** /**
* cacheQueries property * cacheQueries property
* *
* @var bool false * @var boolean
*/ */
public $cacheQueries = false; public $cacheQueries = false;
@ -3234,7 +3234,7 @@ class TranslatedArticle extends CakeTestModel {
/** /**
* cacheQueries property * cacheQueries property
* *
* @var bool false * @var boolean
*/ */
public $cacheQueries = false; public $cacheQueries = false;
@ -3536,7 +3536,7 @@ class TestModel extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -3611,7 +3611,7 @@ class TestModel2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
} }
@ -3633,7 +3633,7 @@ class TestModel3 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
} }
@ -3662,7 +3662,7 @@ class TestModel4 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -3746,7 +3746,7 @@ class TestModel4TestModel7 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -3791,7 +3791,7 @@ class TestModel5 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -3859,7 +3859,7 @@ class TestModel6 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -3919,7 +3919,7 @@ class TestModel7 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -3966,7 +3966,7 @@ class TestModel8 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4027,7 +4027,7 @@ class TestModel9 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4088,7 +4088,7 @@ class Level extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4147,7 +4147,7 @@ class Group extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4207,7 +4207,7 @@ class User2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4279,7 +4279,7 @@ class Category2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4362,7 +4362,7 @@ class Article2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4434,7 +4434,7 @@ class CategoryFeatured2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4482,7 +4482,7 @@ class Featured2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4547,7 +4547,7 @@ class Comment2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4594,7 +4594,7 @@ class ArticleFeatured2 extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4667,7 +4667,7 @@ class MysqlTestModel extends Model {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;

View file

@ -697,10 +697,6 @@ class CakeRequestTest extends CakeTestCase {
$result = $request->referer(false); $result = $request->referer(false);
$this->assertSame($result, Configure::read('App.fullBaseUrl') . '/some/path'); $this->assertSame($result, Configure::read('App.fullBaseUrl') . '/some/path');
$_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseUrl') . '/some/path';
$result = $request->referer(true);
$this->assertSame($result, '/some/path');
$_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseUrl') . '/recipes/add'; $_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseUrl') . '/recipes/add';
$result = $request->referer(true); $result = $request->referer(true);
$this->assertSame($result, '/recipes/add'); $this->assertSame($result, '/recipes/add');
@ -1063,7 +1059,7 @@ class CakeRequestTest extends CakeTestCase {
* Helper function for testing callbacks. * Helper function for testing callbacks.
* *
* @param $request * @param $request
* @return bool * @return boolean
*/ */
public function detectCallback($request) { public function detectCallback($request) {
return (bool)$request->return; return (bool)$request->return;

View file

@ -178,6 +178,25 @@ class CakeEmailTest extends CakeTestCase {
$result = $this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address')); $result = $this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP', 'fail@cakephp.org' => 'From can only be one address'));
} }
/**
* Test that from addresses using colons work.
*
* @return void
*/
public function testFromWithColonsAndQuotes() {
$address = array(
'info@example.com' => '70:20:00 " Forum'
);
$this->CakeEmail->from($address);
$this->assertEquals($address, $this->CakeEmail->from());
$this->CakeEmail->to('info@example.com')
->subject('Test email')
->transport('Debug');
$result = $this->CakeEmail->send();
$this->assertContains('From: "70:20:00 \" Forum" <info@example.com>', $result['headers']);
}
/** /**
* testSender method * testSender method
* *
@ -371,6 +390,10 @@ class CakeEmailTest extends CakeTestCase {
$expected = array('"Last, First" <me@example.com>'); $expected = array('"Last, First" <me@example.com>');
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
$result = $this->CakeEmail->formatAddress(array('me@example.com' => '"Last" First'));
$expected = array('"\"Last\" First" <me@example.com>');
$this->assertSame($expected, $result);
$result = $this->CakeEmail->formatAddress(array('me@example.com' => 'Last First')); $result = $this->CakeEmail->formatAddress(array('me@example.com' => 'Last First'));
$expected = array('Last First <me@example.com>'); $expected = array('Last First <me@example.com>');
$this->assertSame($expected, $result); $this->assertSame($expected, $result);

View file

@ -341,7 +341,7 @@ class SomePostsController extends AppController {
/** /**
* autoRender property * autoRender property
* *
* @var bool false * @var boolean
*/ */
public $autoRender = false; public $autoRender = false;

View file

@ -30,7 +30,7 @@ class ClassRegisterModel extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
} }

View file

@ -60,7 +60,7 @@ class SanitizeTest extends CakeTestCase {
/** /**
* autoFixtures property * autoFixtures property
* *
* @var bool false * @var boolean
*/ */
public $autoFixtures = false; public $autoFixtures = false;

View file

@ -2134,9 +2134,6 @@ class ValidationTest extends CakeTestCase {
// invalid area-codes // invalid area-codes
$this->assertFalse(Validation::phone('1-(511)-999-9999')); $this->assertFalse(Validation::phone('1-(511)-999-9999'));
$this->assertFalse(Validation::phone('1-(379)-999-9999'));
$this->assertFalse(Validation::phone('1-(962)-999-9999'));
$this->assertFalse(Validation::phone('1-(295)-999-9999'));
$this->assertFalse(Validation::phone('1-(555)-999-9999')); $this->assertFalse(Validation::phone('1-(555)-999-9999'));
// invalid exhange // invalid exhange
@ -2147,10 +2144,13 @@ class ValidationTest extends CakeTestCase {
$this->assertFalse(Validation::phone('1-(222)-555-0122')); $this->assertFalse(Validation::phone('1-(222)-555-0122'));
// valid phone numbers // valid phone numbers
$this->assertTrue(Validation::phone('416-428-1234'));
$this->assertTrue(Validation::phone('1-(369)-333-4444')); $this->assertTrue(Validation::phone('1-(369)-333-4444'));
$this->assertTrue(Validation::phone('1-(973)-333-4444')); $this->assertTrue(Validation::phone('1-(973)-333-4444'));
$this->assertTrue(Validation::phone('1-(313)-555-9999')); $this->assertTrue(Validation::phone('1-(313)-555-9999'));
$this->assertTrue(Validation::phone('1-(222)-555-0299')); $this->assertTrue(Validation::phone('1-(222)-555-0299'));
$this->assertTrue(Validation::phone('508-428-1234'));
$this->assertTrue(Validation::phone('1-(508)-232-9651'));
$this->assertTrue(Validation::phone('1 (222) 333 4444')); $this->assertTrue(Validation::phone('1 (222) 333 4444'));
$this->assertTrue(Validation::phone('+1 (222) 333 4444')); $this->assertTrue(Validation::phone('+1 (222) 333 4444'));

View file

@ -84,7 +84,7 @@ class XmlTest extends CakeTestCase {
/** /**
* autoFixtures property * autoFixtures property
* *
* @var bool false * @var boolean
*/ */
public $autoFixtures = false; public $autoFixtures = false;

View file

@ -53,7 +53,7 @@ class Contact extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -144,7 +144,7 @@ class ContactTagsContact extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -209,7 +209,7 @@ class ContactTag extends Model {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -236,7 +236,7 @@ class UserForm extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -276,7 +276,7 @@ class OpenidUrl extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -331,7 +331,7 @@ class ValidateUser extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -380,7 +380,7 @@ class ValidateProfile extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -439,7 +439,7 @@ class ValidateItem extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -488,7 +488,7 @@ class TestMail extends CakeTestModel {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -4097,6 +4097,27 @@ class FormHelperTest extends CakeTestCase {
); );
} }
/**
* Test that label id's match the input element id's when radio is called after create().
*
* @return void
*/
public function testRadioWithCreate() {
$this->Form->create('Model');
$result = $this->Form->radio('recipient',
array('1' => '1', '2' => '2', '3' => '3'),
array('legend' => false, 'value' => '1')
);
$this->assertTextNotContains(
'<label for="ModelModelRecipient1">1</label>',
$result
);
$this->assertTextContains(
'<label for="ModelRecipient1">1</label>',
$result
);
}
/** /**
* testSelect method * testSelect method
* *

View file

@ -33,7 +33,7 @@ class HelperTestPost extends Model {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -73,7 +73,7 @@ class HelperTestComment extends Model {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -107,7 +107,7 @@ class HelperTestTag extends Model {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;
@ -138,7 +138,7 @@ class HelperTestPostsTag extends Model {
/** /**
* useTable property * useTable property
* *
* @var bool false * @var boolean
*/ */
public $useTable = false; public $useTable = false;

View file

@ -190,7 +190,7 @@ class CakeNumber {
* Formats a number into a currency format. * Formats a number into a currency format.
* *
* @param float $value A floating point number * @param float $value A floating point number
* @param integer $options if int then places, if string then before, if (,.-) then use it * @param integer $options If integer then places, if string then before, if (,.-) then use it
* or array with places and before keys * or array with places and before keys
* @return string formatted number * @return string formatted number
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::format * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::format

View file

@ -44,7 +44,7 @@ abstract class ObjectCollection {
/** /**
* Default object priority. A non zero integer. * Default object priority. A non zero integer.
* *
* @var int * @var integer
*/ */
public $defaultPriority = 10; public $defaultPriority = 10;

View file

@ -497,7 +497,7 @@ class Validation {
if ($type === 'ipv6') { if ($type === 'ipv6') {
$flags = FILTER_FLAG_IPV6; $flags = FILTER_FLAG_IPV6;
} }
return (boolean)filter_var($check, FILTER_VALIDATE_IP, array('flags' => $flags)); return (bool)filter_var($check, FILTER_VALIDATE_IP, array('flags' => $flags));
} }
/** /**
@ -620,11 +620,19 @@ class Validation {
case 'all': case 'all':
// includes all NANPA members. // includes all NANPA members.
// see http://en.wikipedia.org/wiki/North_American_Numbering_Plan#List_of_NANPA_countries_and_territories // see http://en.wikipedia.org/wiki/North_American_Numbering_Plan#List_of_NANPA_countries_and_territories
$regex = '/^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|3[02-689][0-9]|9[02-57-9][0-9]|[246-8][02-46-8][02-46-9])\s*\)'; $regex = '/^(?:(?:\+?1\s*(?:[.-]\s*)?)?';
$regex .= '|(55[0-46-9]|5[0-46-9][5]|[0-46-9]55|[2-9]1[02-9]|[2-9][02-8]1|[2-46-9][02-46-8][02-46-9]))\s*(?:[.-]\s*)?)';
$regex .= '(?!(555(?:\s*(?:[.|\-|\s]\s*))(01([0-9][0-9])|1212)))'; // Area code 555, X11 is not allowed.
$areaCode = '(?![2-9]11)(?!555)([2-9][0-8][0-9])';
$regex .= '(?:\(\s*' . $areaCode . '\s*\)|' . $areaCode . ')';
$regex .= '\s*(?:[.-]\s*)?)';
// Exchange and 555-XXXX numbers
$regex .= '(?!(555(?:\s*(?:[.\-\s]\s*))(01([0-9][0-9])|1212)))';
$regex .= '(?!(555(01([0-9][0-9])|1212)))'; $regex .= '(?!(555(01([0-9][0-9])|1212)))';
$regex .= '([2-9]1[02-9]|[2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)'; $regex .= '([2-9]1[02-9]|[2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)';
// Local number and extension
$regex .= '?([0-9]{4})'; $regex .= '?([0-9]{4})';
$regex .= '(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/'; $regex .= '(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/';
break; break;

View file

@ -647,7 +647,7 @@ class FormHelper extends AppHelper {
* *
* ### Options: * ### Options:
* *
* - `escape` bool - Whether or not to html escape the contents of the error. * - `escape` boolean - Whether or not to html escape the contents of the error.
* - `wrap` mixed - Whether or not the error message should be wrapped in a div. If a * - `wrap` mixed - Whether or not the error message should be wrapped in a div. If a
* string, will be used as the HTML tag to use. * string, will be used as the HTML tag to use.
* - `class` string - The classname for the error message * - `class` string - The classname for the error message
@ -1520,7 +1520,9 @@ class FormHelper extends AppHelper {
); );
if ($label) { if ($label) {
$optTitle = $this->label($tagName, $optTitle, is_array($label) ? $label : null); $labelOpts = is_array($label) ? $label : array();
$labelOpts += array('for' => $tagName);
$optTitle = $this->label($tagName, $optTitle, $labelOpts);
} }
if (is_array($between)) { if (is_array($between)) {
@ -1737,7 +1739,7 @@ class FormHelper extends AppHelper {
* @param string $title The content to be wrapped by <a> tags. * @param string $title The content to be wrapped by <a> tags.
* @param string|array $url Cake-relative URL or array of URL parameters, or external URL (starts with http://) * @param string|array $url Cake-relative URL or array of URL parameters, or external URL (starts with http://)
* @param array $options Array of HTML attributes. * @param array $options Array of HTML attributes.
* @param bool|string $confirmMessage JavaScript confirmation message. * @param boolean|string $confirmMessage JavaScript confirmation message.
* @return string An `<a />` element. * @return string An `<a />` element.
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postLink * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postLink
*/ */

View file

@ -113,7 +113,7 @@ class NumberHelper extends AppHelper {
* @see CakeNumber::format() * @see CakeNumber::format()
* *
* @param float $number A floating point number * @param float $number A floating point number
* @param integer $options if int then places, if string then before, if (,.-) then use it * @param integer $options If integer then places, if string then before, if (,.-) then use it
* or array with places and before keys * or array with places and before keys
* @return string formatted number * @return string formatted number
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::format * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::format