diff --git a/app/Config/Schema/db_acl.sql b/app/Config/Schema/db_acl.sql new file mode 100644 index 000000000..973995f5f --- /dev/null +++ b/app/Config/Schema/db_acl.sql @@ -0,0 +1,40 @@ +# $Id$ +# +# Copyright 2005-2011, Cake Software Foundation, Inc. +# +# Licensed under The MIT License +# Redistributions of files must retain the above copyright notice. +# MIT License (http://www.opensource.org/licenses/mit-license.php) + +CREATE TABLE acos ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + parent_id INTEGER(10) DEFAULT NULL, + model VARCHAR(255) DEFAULT '', + foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, + alias VARCHAR(255) DEFAULT '', + lft INTEGER(10) DEFAULT NULL, + rght INTEGER(10) DEFAULT NULL, + PRIMARY KEY (id) +); + +CREATE TABLE aros_acos ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + aro_id INTEGER(10) UNSIGNED NOT NULL, + aco_id INTEGER(10) UNSIGNED NOT NULL, + _create CHAR(2) NOT NULL DEFAULT 0, + _read CHAR(2) NOT NULL DEFAULT 0, + _update CHAR(2) NOT NULL DEFAULT 0, + _delete CHAR(2) NOT NULL DEFAULT 0, + PRIMARY KEY(id) +); + +CREATE TABLE aros ( + id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, + parent_id INTEGER(10) DEFAULT NULL, + model VARCHAR(255) DEFAULT '', + foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, + alias VARCHAR(255) DEFAULT '', + lft INTEGER(10) DEFAULT NULL, + rght INTEGER(10) DEFAULT NULL, + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/app/Config/Schema/i18n.sql b/app/Config/Schema/i18n.sql new file mode 100644 index 000000000..5a053ff3c --- /dev/null +++ b/app/Config/Schema/i18n.sql @@ -0,0 +1,26 @@ +# $Id$ +# +# Copyright 2005-2011, Cake Software Foundation, Inc. +# +# Licensed under The MIT License +# Redistributions of files must retain the above copyright notice. +# MIT License (http://www.opensource.org/licenses/mit-license.php) + +CREATE TABLE i18n ( + id int(10) NOT NULL auto_increment, + locale varchar(6) NOT NULL, + model varchar(255) NOT NULL, + foreign_key int(10) NOT NULL, + field varchar(255) NOT NULL, + content mediumtext, + PRIMARY KEY (id), +# UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field), +# INDEX I18N_LOCALE_ROW(locale, model, foreign_key), +# INDEX I18N_LOCALE_MODEL(locale, model), +# INDEX I18N_FIELD(model, foreign_key, field), +# INDEX I18N_ROW(model, foreign_key), + INDEX locale (locale), + INDEX model (model), + INDEX row_id (foreign_key), + INDEX field (field) +); \ No newline at end of file diff --git a/app/Config/Schema/sessions.sql b/app/Config/Schema/sessions.sql new file mode 100644 index 000000000..18a68b4b3 --- /dev/null +++ b/app/Config/Schema/sessions.sql @@ -0,0 +1,16 @@ +# $Id$ +# +# Copyright 2005-2011, Cake Software Foundation, Inc. +# 1785 E. Sahara Avenue, Suite 490-204 +# Las Vegas, Nevada 89104 +# +# Licensed under The MIT License +# Redistributions of files must retain the above copyright notice. +# MIT License (http://www.opensource.org/licenses/mit-license.php) + +CREATE TABLE cake_sessions ( + id varchar(255) NOT NULL default '', + data text, + expires int(11) default NULL, + PRIMARY KEY (id) +); \ No newline at end of file diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 01f1d7c41..4a8b703ad 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -24,7 +24,7 @@ App::uses('Validation', 'Utility'); /** * Task class for creating and updating model files. * - * @package Cake.Console.Command.Task + * @package Cake.Console.Command.Task */ class ModelTask extends BakeTask { @@ -187,33 +187,44 @@ class ModelTask extends BakeTask { $useTable = $this->getTable($currentModelName); $db = ConnectionManager::getDataSource($this->connection); $fullTableName = $db->fullTableName($useTable); - - if (in_array($useTable, $this->_tables)) { - $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection)); - $fields = $tempModel->schema(true); - if (!array_key_exists('id', $fields)) { - $primaryKey = $this->findPrimaryKey($fields); + if (!in_array($useTable, $this->_tables)) { + $prompt = __d('cake_console', "The table %s doesn't exist or could not be automatically detected\ncontinue anyway?", $useTable); + $continue = $this->in($prompt, array('y', 'n')); + if (strtolower($continue) == 'n') { + return false; } - } else { - $this->err(__d('cake_console', 'Table %s does not exist, cannot bake a model without a table.', $useTable)); - $this->_stop(); - return false; - } - $displayField = $tempModel->hasField(array('name', 'title')); - if (!$displayField) { - $displayField = $this->findDisplayField($tempModel->schema()); } - $prompt = __d('cake_console', "Would you like to supply validation criteria \nfor the fields in your model?"); - $wannaDoValidation = $this->in($prompt, array('y','n'), 'y'); - if (array_search($useTable, $this->_tables) !== false && strtolower($wannaDoValidation) == 'y') { - $validate = $this->doValidation($tempModel); + $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection)); + + $knownToExist = false; + try { + $fields = $tempModel->schema(true); + $knownToExist = true; + } catch (Exception $e) { + $fields = array($tempModel->primaryKey); + } + if (!array_key_exists('id', $fields)) { + $primaryKey = $this->findPrimaryKey($fields); } - $prompt = __d('cake_console', "Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?"); - $wannaDoAssoc = $this->in($prompt, array('y','n'), 'y'); - if (strtolower($wannaDoAssoc) == 'y') { - $associations = $this->doAssociations($tempModel); + if ($knownToExist) { + $displayField = $tempModel->hasField(array('name', 'title')); + if (!$displayField) { + $displayField = $this->findDisplayField($tempModel->schema()); + } + + $prompt = __d('cake_console', "Would you like to supply validation criteria \nfor the fields in your model?"); + $wannaDoValidation = $this->in($prompt, array('y','n'), 'y'); + if (array_search($useTable, $this->_tables) !== false && strtolower($wannaDoValidation) == 'y') { + $validate = $this->doValidation($tempModel); + } + + $prompt = __d('cake_console', "Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?"); + $wannaDoAssoc = $this->in($prompt, array('y','n'), 'y'); + if (strtolower($wannaDoAssoc) == 'y') { + $associations = $this->doAssociations($tempModel); + } } $this->out(); @@ -467,7 +478,7 @@ class ModelTask extends BakeTask { } if (empty($this->_tables)) { - $this->_tables = $this->getAllTables(); + $this->_tables = (array) $this->getAllTables(); } $associations = array( @@ -539,7 +550,7 @@ class ModelTask extends BakeTask { $modelFieldsTemp = $tempOtherModel->schema(true); $pattern = '/_' . preg_quote($model->table, '/') . '|' . preg_quote($model->table, '/') . '_/'; - $possibleJoinTable = preg_match($pattern , $otherTable); + $possibleJoinTable = preg_match($pattern, $otherTable); if ($possibleJoinTable == true) { continue; } @@ -650,20 +661,29 @@ class ModelTask extends BakeTask { $this->out(__d('cake_console', 'What is the association type?')); $assocType = intval($this->inOptions($assocs, __d('cake_console', 'Enter a number'))); - $this->out(__d('cake_console', "For the following options be very careful to match your setup exactly.\nAny spelling mistakes will cause errors.")); + $this->out(__d('cake_console', "For the following options be very careful to match your setup exactly.\n" . + "Any spelling mistakes will cause errors.")); $this->hr(); $alias = $this->in(__d('cake_console', 'What is the alias for this association?')); $className = $this->in(__d('cake_console', 'What className will %s use?', $alias), null, $alias ); if ($assocType == 0) { - $showKeys = $possibleKeys[$model->table]; + if (!empty($possibleKeys[$model->table])) { + $showKeys = $possibleKeys[$model->table]; + } else { + $showKeys = null; + } $suggestedForeignKey = $this->_modelKey($alias); } else { $otherTable = Inflector::tableize($className); if (in_array($otherTable, $this->_tables)) { if ($assocType < 3) { - $showKeys = $possibleKeys[$otherTable]; + if (!empty($possibleKeys[$otherTable])) { + $showKeys = $possibleKeys[$otherTable]; + } else { + $showKeys = null; + } } else { $showKeys = null; } @@ -744,10 +764,15 @@ class ModelTask extends BakeTask { 'useTable' => null, 'useDbConfig' => 'default', 'displayField' => null); $data = array_merge($defaults, $data); + $pluginPath = ''; + if ($this->plugin) { + $pluginPath = $this->plugin . '.'; + } + $this->Template->set($data); $this->Template->set(array( 'plugin' => $this->plugin, - 'pluginPath' => empty($this->plugin) ? '' : $this->plugin . '.' + 'pluginPath' => $pluginPath )); $out = $this->Template->generate('classes', 'model'); @@ -779,7 +804,7 @@ class ModelTask extends BakeTask { * @return array */ public function listAll($useDbConfig = null) { - $this->_tables = $this->getAllTables($useDbConfig); + $this->_tables = (array) $this->getAllTables($useDbConfig); if ($this->interactive === true) { $this->out(__d('cake_console', 'Possible Models based on your current database:')); @@ -865,7 +890,8 @@ class ModelTask extends BakeTask { $enteredModel = ''; while ($enteredModel == '') { - $enteredModel = $this->in(__d('cake_console', "Enter a number from the list above,\ntype in the name of another model, or 'q' to exit"), null, 'q'); + $enteredModel = $this->in(__d('cake_console', "Enter a number from the list above,\n" . + "type in the name of another model, or 'q' to exit"), null, 'q'); if ($enteredModel === 'q') { $this->out(__d('cake_console', 'Exit')); @@ -873,7 +899,8 @@ class ModelTask extends BakeTask { } if ($enteredModel == '' || intval($enteredModel) > count($this->_modelNames)) { - $this->err(__d('cake_console', "The model name you supplied was empty,\nor the number you selected was not an option. Please try again.")); + $this->err(__d('cake_console', "The model name you supplied was empty,\n" . + "or the number you selected was not an option. Please try again.")); $enteredModel = ''; } } diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index bdef56995..bde3dd6de 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -337,8 +337,7 @@ class AuthComponent extends Component { } /** - * Attempts to introspect the correct values for object properties including - * $userModel and $sessionKey. + * Attempts to introspect the correct values for object properties. * * @return boolean */ diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 758cc913d..a2de723dd 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -185,6 +185,8 @@ class ExceptionRenderer { try { $this->controller->set($error->getAttributes()); $this->_outputMessage($this->template); + } catch (MissingViewException $e) { + $this->_outputMessage('error500'); } catch (Exception $e) { $this->_outputMessageSafe('error500'); } diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index b38429719..00c6941f0 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -206,7 +206,7 @@ class CakeSchema extends Object { } $tables = array(); - $currentTables = $db->listSources(); + $currentTables = (array) $db->listSources(); $prefix = null; if (isset($db->config['prefix'])) { diff --git a/lib/Cake/Routing/Route/CakeRoute.php b/lib/Cake/Routing/Route/CakeRoute.php index 97d8c8d47..7c3a140ca 100644 --- a/lib/Cake/Routing/Route/CakeRoute.php +++ b/lib/Cake/Routing/Route/CakeRoute.php @@ -396,6 +396,7 @@ class CakeRoute { } $namedConfig = Router::namedConfig(); + $prefixes = Router::prefixes(); $greedyNamed = $namedConfig['greedyNamed']; $allowedNamedParams = $namedConfig['rules']; @@ -429,7 +430,8 @@ class CakeRoute { // pull out named params if named params are greedy or a rule exists. if ( ($greedyNamed || isset($allowedNamedParams[$key])) && - ($value !== false && $value !== null) + ($value !== false && $value !== null) && + (!in_array($key, $prefixes)) ) { $named[$key] = $value; continue; diff --git a/lib/Cake/Test/Case/BasicsTest.php b/lib/Cake/Test/Case/BasicsTest.php index 29acfd220..e694da995 100644 --- a/lib/Cake/Test/Case/BasicsTest.php +++ b/lib/Cake/Test/Case/BasicsTest.php @@ -683,61 +683,21 @@ class BasicsTest extends CakeTestCase { */ public function testDebug() { ob_start(); - debug('this-is-a-test'); + debug('this-is-a-test', false); $result = ob_get_clean(); -$expectedHtml = << -%s (line %d) -
-this-is-a-test
-
- -EXPECTED; $expectedText = <<assertEquals($expected, $result); - - ob_start(); - debug('
this-is-a-test
'); - $result = ob_get_clean(); -$expectedHtml = << -%s (line %d) -
-'<div>this-is-a-test</div>'
-
- -EXPECTED; -$expectedText = <<this-is-a-test' -########################### - -EXPECTED; - if (php_sapi_name() == 'cli') { - $expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19); - } else { - $expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 21); - } + $expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8); $this->assertEquals($expected, $result); ob_start(); debug('
this-is-a-test
', true); $result = ob_get_clean(); -$expected = << %s (line %d)
@@ -745,7 +705,7 @@ $expected = <<
 
 EXPECTED;
-		$expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 10);
+		$expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 10);
 		$this->assertEquals($expected, $result);
 
 		ob_start();
@@ -788,43 +748,15 @@ $expectedHtml = <<
 EXPECTED;
 $expectedText = <<this-is-a-test'
 ###########################
-
 EXPECTED;
 		if (php_sapi_name() == 'cli') {
-			$expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19);
+			$expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 17);
 		} else {
-			$expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 21);
-		}
-		$this->assertEquals($expected, $result);
-
-		ob_start();
-			debug('
this-is-a-test
', null); - $result = ob_get_clean(); -$expectedHtml = << -%s (line %d) -
-'<div>this-is-a-test</div>'
-
- -EXPECTED; -$expectedText = <<this-is-a-test' -########################### - -EXPECTED; - if (php_sapi_name() == 'cli') { - $expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19); - } else { - $expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 21); + $expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19); } $this->assertEquals($expected, $result); @@ -841,16 +773,14 @@ $expectedHtml = <<this-is-a-test' ########################### - EXPECTED; if (php_sapi_name() == 'cli') { - $expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19); + $expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 17); } else { - $expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 21); + $expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19); } $this->assertEquals($expected, $result); @@ -858,28 +788,24 @@ EXPECTED; debug('
this-is-a-test
', false); $result = ob_get_clean(); $expected = <<this-is-a-test' ########################### - EXPECTED; - $expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 10); + $expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8); $this->assertEquals($expected, $result); ob_start(); debug('
this-is-a-test
', false, true); $result = ob_get_clean(); $expected = <<this-is-a-test' ########################### - EXPECTED; - $expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 10); + $expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8); $this->assertEquals($expected, $result); ob_start(); @@ -887,13 +813,11 @@ EXPECTED; $result = ob_get_clean(); $expected = <<this-is-a-test' ########################### - EXPECTED; - $expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 10); + $expected = sprintf($expected, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8); $this->assertEquals($expected, $result); } diff --git a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php index 12f820d01..ed47cdc81 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ModelTaskTest.php @@ -30,7 +30,7 @@ App::uses('ModelTask', 'Console/Command/Task'); /** * ModelTaskTest class * - * @package Cake.Test.Case.Console.Command.Task + * @package Cake.Test.Case.Console.Command.Task */ class ModelTaskTest extends CakeTestCase { @@ -965,12 +965,35 @@ STRINGEND; $this->Task->connection = 'test'; $this->Task->path = '/my/path/'; - $this->Task->expects($this->once())->method('_stop'); - $this->Task->expects($this->once())->method('err'); - $this->Task->expects($this->any())->method('in') - ->will($this->onConsecutiveCalls('Foobar', 'y')); + ->will($this->onConsecutiveCalls( + 'Foobar', // Or type in the name of the model + 'y', // Do you want to use this table + 'n' // Doesn't exist, continue anyway? + )); $this->Task->execute(); } + +/** + * test using bake interactively with a table that does not exist. + * + * @return void + */ + public function testForcedExecuteWithNonExistantTableName() { + $this->Task->connection = 'test'; + $this->Task->path = '/my/path/'; + + $this->Task->expects($this->any())->method('in') + ->will($this->onConsecutiveCalls( + 'Foobar', // Or type in the name of the model + 'y', // Do you want to use this table + 'y', // Doesn't exist, continue anyway? + 'id', // Primary key + 'y' // Looks good? + )); + + $this->Task->execute(); + } + } diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index f2d01e091..fe6c961a3 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -553,11 +553,11 @@ class PaginatorComponentTest extends CakeTestCase { 'paramType' => 'named' ); $result = $Controller->Paginator->paginate('PaginatorControllerPost'); - $this->assertEqual(Set::extract($result, '{n}.PaginatorAuthor.joined_offset'), array(4, 2, 2)); + $this->assertEquals(Set::extract($result, '{n}.PaginatorAuthor.joined_offset'), array(4, 2, 2)); $Controller->request->params['named'] = array('sort' => 'PaginatorAuthor.joined_offset', 'direction' => 'asc'); $result = $Controller->Paginator->paginate('PaginatorControllerPost'); - $this->assertEqual(Set::extract($result, '{n}.PaginatorAuthor.joined_offset'), array(2, 2, 4)); + $this->assertEquals(Set::extract($result, '{n}.PaginatorAuthor.joined_offset'), array(2, 2, 4)); } /** diff --git a/lib/Cake/Test/Case/I18n/I18nTest.php b/lib/Cake/Test/Case/I18n/I18nTest.php index 5bf781e7d..8f7fab36b 100644 --- a/lib/Cake/Test/Case/I18n/I18nTest.php +++ b/lib/Cake/Test/Case/I18n/I18nTest.php @@ -64,33 +64,33 @@ class I18nTest extends CakeTestCase { Cache::config('_cake_core_', Cache::config('default')); // make some calls to translate using different domains - $this->assertEqual('Dom 1 Foo', I18n::translate('dom1.foo', false, 'dom1')); - $this->assertEqual('Dom 1 Bar', I18n::translate('dom1.bar', false, 'dom1')); + $this->assertEquals('Dom 1 Foo', I18n::translate('dom1.foo', false, 'dom1')); + $this->assertEquals('Dom 1 Bar', I18n::translate('dom1.bar', false, 'dom1')); $domains = I18n::domains(); - $this->assertEqual('Dom 1 Foo', $domains['dom1']['cache_test_po']['LC_MESSAGES']['dom1.foo']); + $this->assertEquals('Dom 1 Foo', $domains['dom1']['cache_test_po']['LC_MESSAGES']['dom1.foo']); // reset internally stored entries I18n::clear(); // now only dom1 should be in cache $cachedDom1 = Cache::read('dom1_' . $lang, '_cake_core_'); - $this->assertEqual('Dom 1 Foo', $cachedDom1['LC_MESSAGES']['dom1.foo']); - $this->assertEqual('Dom 1 Bar', $cachedDom1['LC_MESSAGES']['dom1.bar']); + $this->assertEquals('Dom 1 Foo', $cachedDom1['LC_MESSAGES']['dom1.foo']); + $this->assertEquals('Dom 1 Bar', $cachedDom1['LC_MESSAGES']['dom1.bar']); // dom2 not in cache $this->assertFalse(Cache::read('dom2_' . $lang, '_cake_core_')); // translate a item of dom2 (adds dom2 to cache) - $this->assertEqual('Dom 2 Foo', I18n::translate('dom2.foo', false, 'dom2')); + $this->assertEquals('Dom 2 Foo', I18n::translate('dom2.foo', false, 'dom2')); // verify dom2 was cached through manual read from cache $cachedDom2 = Cache::read('dom2_' . $lang, '_cake_core_'); - $this->assertEqual('Dom 2 Foo', $cachedDom2['LC_MESSAGES']['dom2.foo']); - $this->assertEqual('Dom 2 Bar', $cachedDom2['LC_MESSAGES']['dom2.bar']); + $this->assertEquals('Dom 2 Foo', $cachedDom2['LC_MESSAGES']['dom2.foo']); + $this->assertEquals('Dom 2 Bar', $cachedDom2['LC_MESSAGES']['dom2.bar']); // modify cache entry manually to verify that dom1 entries now will be read from cache $cachedDom1['LC_MESSAGES']['dom1.foo'] = 'FOO'; Cache::write('dom1_' . $lang, $cachedDom1, '_cake_core_'); - $this->assertEqual('FOO', I18n::translate('dom1.foo', false, 'dom1')); + $this->assertEquals('FOO', I18n::translate('dom1.foo', false, 'dom1')); } @@ -101,7 +101,7 @@ class I18nTest extends CakeTestCase { */ public function testDefaultStrings() { $singular = $this->__singular(); - $this->assertEqual('Plural Rule 1', $singular); + $this->assertEquals('Plural Rule 1', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 or > 1', $plurals)); @@ -132,7 +132,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 = 0 or > 1', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 1 (from core)', $coreSingular); + $this->assertEquals('Plural Rule 1 (from core)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 or > 1 (from core)', $corePlurals)); @@ -172,7 +172,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_0_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 0 (translated)', $singular); + $this->assertEquals('Plural Rule 0 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 ends with any # (translated)', $plurals)); @@ -203,7 +203,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 ends with any # (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 0 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 0 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 ends with any # (from core translated)', $corePlurals)); @@ -243,7 +243,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_0_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 0 (translated)', $singular); + $this->assertEquals('Plural Rule 0 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 ends with any # (translated)', $plurals)); @@ -274,7 +274,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 ends with any # (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 0 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 0 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 ends with any # (from core translated)', $corePlurals)); @@ -314,7 +314,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_1_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 1 (translated)', $singular); + $this->assertEquals('Plural Rule 1 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 or > 1 (translated)', $plurals)); @@ -345,7 +345,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 = 0 or > 1 (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 1 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 1 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 or > 1 (from core translated)', $corePlurals)); @@ -385,7 +385,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_1_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 1 (translated)', $singular); + $this->assertEquals('Plural Rule 1 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 or > 1 (translated)', $plurals)); @@ -416,7 +416,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 = 0 or > 1 (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 1 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 1 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 or > 1 (from core translated)', $corePlurals)); @@ -456,7 +456,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_2_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 2 (translated)', $singular); + $this->assertEquals('Plural Rule 2 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 or 1 (translated)', $plurals)); @@ -487,7 +487,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 > 1 (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 2 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 2 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 or 1 (from core translated)', $corePlurals)); @@ -527,7 +527,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_2_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 2 (translated)', $singular); + $this->assertEquals('Plural Rule 2 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 or 1 (translated)', $plurals)); @@ -558,7 +558,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 > 1 (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 2 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 2 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 or 1 (from core translated)', $corePlurals)); @@ -598,7 +598,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_3_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 3 (translated)', $singular); + $this->assertEquals('Plural Rule 3 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 (translated)', $plurals)); @@ -629,7 +629,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 3 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 3 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 (from core translated)', $corePlurals)); @@ -669,7 +669,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_3_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 3 (translated)', $singular); + $this->assertEquals('Plural Rule 3 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 (translated)', $plurals)); @@ -700,7 +700,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 3 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 3 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 (from core translated)', $corePlurals)); @@ -740,7 +740,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_4_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 4 (translated)', $singular); + $this->assertEquals('Plural Rule 4 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -771,7 +771,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 4 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 4 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -811,7 +811,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_4_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 4 (translated)', $singular); + $this->assertEquals('Plural Rule 4 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -842,7 +842,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 4 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 4 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -882,7 +882,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_5_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 5 (translated)', $singular); + $this->assertEquals('Plural Rule 5 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals)); @@ -914,7 +914,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 5 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 5 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals)); @@ -955,7 +955,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_5_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 5 (translated)', $singular); + $this->assertEquals('Plural Rule 5 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals)); @@ -987,7 +987,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 5 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 5 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals)); @@ -1028,7 +1028,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_6_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 6 (translated)', $singular); + $this->assertEquals('Plural Rule 6 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (translated)', $plurals)); @@ -1059,7 +1059,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 6 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 6 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); @@ -1099,7 +1099,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_6_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 6 (translated)', $singular); + $this->assertEquals('Plural Rule 6 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (translated)', $plurals)); @@ -1130,7 +1130,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 6 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 6 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); @@ -1170,7 +1170,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_7_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 7 (translated)', $singular); + $this->assertEquals('Plural Rule 7 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1201,7 +1201,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 7 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 7 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1241,7 +1241,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_7_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 7 (translated)', $singular); + $this->assertEquals('Plural Rule 7 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1272,7 +1272,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 7 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 7 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1312,7 +1312,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_8_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 8 (translated)', $singular); + $this->assertEquals('Plural Rule 8 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1343,7 +1343,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 8 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 8 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1383,7 +1383,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_8_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 8 (translated)', $singular); + $this->assertEquals('Plural Rule 8 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1414,7 +1414,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 8 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 8 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1454,7 +1454,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_9_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 9 (translated)', $singular); + $this->assertEquals('Plural Rule 9 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1486,7 +1486,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 9 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 9 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1528,7 +1528,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_9_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 9 (translated)', $singular); + $this->assertEquals('Plural Rule 9 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1560,7 +1560,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 9 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 9 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1602,7 +1602,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_10_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 10 (translated)', $singular); + $this->assertEquals('Plural Rule 10 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1634,7 +1634,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 10 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 10 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1675,7 +1675,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_10_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 10 (translated)', $singular); + $this->assertEquals('Plural Rule 10 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1707,7 +1707,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 10 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 10 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1748,7 +1748,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_11_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 11 (translated)', $singular); + $this->assertEquals('Plural Rule 11 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1779,7 +1779,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 11 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 11 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1819,7 +1819,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_11_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 11 (translated)', $singular); + $this->assertEquals('Plural Rule 11 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -1850,7 +1850,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 11 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 11 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -1890,7 +1890,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_12_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 12 (translated)', $singular); + $this->assertEquals('Plural Rule 12 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 is 0 or 3-10 (translated)', $plurals)); @@ -1921,7 +1921,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 12 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 12 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 is 0 or 3-10 (from core translated)', $corePlurals)); @@ -1961,7 +1961,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_12_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 12 (translated)', $singular); + $this->assertEquals('Plural Rule 12 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 is 0 or 3-10 (translated)', $plurals)); @@ -1992,7 +1992,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 12 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 12 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 is 0 or 3-10 (from core translated)', $corePlurals)); @@ -2032,7 +2032,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_13_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 13 (translated)', $singular); + $this->assertEquals('Plural Rule 13 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 is 0 or ends in 01-10 (translated)', $plurals)); @@ -2063,7 +2063,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 13 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 13 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 is 0 or ends in 01-10 (from core translated)', $corePlurals)); @@ -2103,7 +2103,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_13_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 13 (translated)', $singular); + $this->assertEquals('Plural Rule 13 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 is 0 or ends in 01-10 (translated)', $plurals)); @@ -2134,7 +2134,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 13 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 13 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 is 0 or ends in 01-10 (from core translated)', $corePlurals)); @@ -2174,7 +2174,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_14_po'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 14 (translated)', $singular); + $this->assertEquals('Plural Rule 14 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -2205,7 +2205,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 14 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 14 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -2245,7 +2245,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'rule_14_mo'); $singular = $this->__singular(); - $this->assertEqual('Plural Rule 14 (translated)', $singular); + $this->assertEquals('Plural Rule 14 (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (translated)', $plurals)); @@ -2276,7 +2276,7 @@ class I18nTest extends CakeTestCase { $this->assertTrue(in_array('25 everything else (translated)', $plurals)); $coreSingular = $this->__singularFromCore(); - $this->assertEqual('Plural Rule 14 (from core translated)', $coreSingular); + $this->assertEquals('Plural Rule 14 (from core translated)', $coreSingular); $corePlurals = $this->__pluralFromCore(); $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); @@ -2315,7 +2315,7 @@ class I18nTest extends CakeTestCase { public function testSetLanguageWithSession () { $_SESSION['Config']['language'] = 'po'; $singular = $this->__singular(); - $this->assertEqual('Po (translated)', $singular); + $this->assertEquals('Po (translated)', $singular); $plurals = $this->__plural(); $this->assertTrue(in_array('0 everything else (po translated)', $plurals)); @@ -2355,7 +2355,7 @@ class I18nTest extends CakeTestCase { public function testNoCoreTranslation () { Configure::write('Config.language', 'po'); $singular = $this->__singular(); - $this->assertEqual('Po (translated)', $singular); + $this->assertEquals('Po (translated)', $singular); $coreSingular = $this->__singularFromCore(); $this->assertNotEquals('Po (from core translated)', $coreSingular); @@ -2401,7 +2401,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'po'); $singular = $this->__domainSingular(); - $this->assertEqual('Plural Rule 1 (from plugin)', $singular); + $this->assertEquals('Plural Rule 1 (from plugin)', $singular); $plurals = $this->__domainPlural(); $this->assertTrue(in_array('0 = 0 or > 1 (from plugin)', $plurals)); @@ -2450,7 +2450,7 @@ class I18nTest extends CakeTestCase { $expected .= "broken up over multiple lines.\n"; $expected .= "This is the third line.\n"; $expected .= "This is the forth line. (translated)"; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); // Windows Newline is \r\n $string = "This is a multiline translation\r\n"; @@ -2458,18 +2458,18 @@ class I18nTest extends CakeTestCase { $string .= "This is the third line.\r\n"; $string .= "This is the forth line."; $result = __($string); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $singular = "valid\nsecond line"; $plural = "valids\nsecond line"; $result = __n($singular, $plural, 1); $expected = "v\nsecond line"; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __n($singular, $plural, 2); $expected = "vs\nsecond line"; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $string = "This is a multiline translation\n"; $string .= "broken up over multiple lines.\n"; @@ -2481,11 +2481,11 @@ class I18nTest extends CakeTestCase { $result = __n($singular, $plural, 1); $expected = "%d is 1\n" . $string; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __n($singular, $plural, 2); $expected = "%d is 2-4\n" . $string; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); // Windows Newline is \r\n $string = "This is a multiline translation\r\n"; @@ -2498,11 +2498,11 @@ class I18nTest extends CakeTestCase { $result = __n($singular, $plural, 1); $expected = "%d is 1\n" . str_replace("\r\n", "\n", $string); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __n($singular, $plural, 2); $expected = "%d is 2-4\n" . str_replace("\r\n", "\n", $string); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); } /** @@ -2513,7 +2513,7 @@ class I18nTest extends CakeTestCase { public function testPoNoTranslationNeeded () { Configure::write('Config.language', 'po'); $result = __('No Translation needed'); - $this->assertEqual('No Translation needed', $result); + $this->assertEquals('No Translation needed', $result); } /** @@ -2523,7 +2523,7 @@ class I18nTest extends CakeTestCase { */ public function testPoQuotedString () { $expected = 'this is a "quoted string" (translated)'; - $this->assertEqual($expected, __('this is a "quoted string"')); + $this->assertEquals($expected, __('this is a "quoted string"')); } /** @@ -2536,15 +2536,15 @@ class I18nTest extends CakeTestCase { $result = __n('%d = 1', '%d = 0 or > 1', (float)1); $expected = '%d is 1 (translated)'; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __n('%d = 1', '%d = 0 or > 1', (float)2); $expected = "%d ends in 2-4, not 12-14 (translated)"; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __n('%d = 1', '%d = 0 or > 1', (float)5); $expected = "%d everything else (translated)"; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); } /** @@ -2555,7 +2555,7 @@ class I18nTest extends CakeTestCase { public function testCategory() { Configure::write('Config.language', 'po'); $category = $this->__category(); - $this->assertEqual('Monetary Po (translated)', $category); + $this->assertEquals('Monetary Po (translated)', $category); } /** @@ -2567,7 +2567,7 @@ class I18nTest extends CakeTestCase { Configure::write('Config.language', 'po'); $singular = $this->__domainCategorySingular(); - $this->assertEqual('Monetary Plural Rule 1 (from plugin)', $singular); + $this->assertEquals('Monetary Plural Rule 1 (from plugin)', $singular); $plurals = $this->__domainCategoryPlural(); $this->assertTrue(in_array('Monetary 0 = 0 or > 1 (from plugin)', $plurals)); @@ -2582,25 +2582,25 @@ class I18nTest extends CakeTestCase { public function testCategoryThenSingular() { Configure::write('Config.language', 'po'); $category = $this->__category(); - $this->assertEqual('Monetary Po (translated)', $category); + $this->assertEquals('Monetary Po (translated)', $category); $singular = $this->__singular(); - $this->assertEqual('Po (translated)', $singular); + $this->assertEquals('Po (translated)', $singular); } public function testTimeDefinition() { Configure::write('Config.language', 'po'); $result = __c('d_fmt', 5); $expected = '%m/%d/%Y'; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __c('am_pm', 5); $expected = array('AM', 'PM'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __c('abmon', 5); $expected = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); } public function testTimeDefinitionJapanese(){ @@ -2609,15 +2609,15 @@ class I18nTest extends CakeTestCase { $expected = "%Y年%m月%d日"; - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __c('am_pm', 5); $expected = array("午前", "午後"); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = __c('abmon', 5); $expected = array(" 1月", " 2月", " 3月", " 4月", " 5月", " 6月", " 7月", " 8月", " 9月", "10月", "11月", "12月"); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); } /** diff --git a/lib/Cake/Test/Case/I18n/L10nTest.php b/lib/Cake/Test/Case/I18n/L10nTest.php index 3fe57f7b4..5501d5f47 100644 --- a/lib/Cake/Test/Case/I18n/L10nTest.php +++ b/lib/Cake/Test/Case/I18n/L10nTest.php @@ -36,45 +36,45 @@ class L10nTest extends CakeTestCase { // Catalog Entry $l10n->get('en'); - $this->assertEqual($l10n->language, 'English'); - $this->assertEqual($l10n->languagePath, array('eng', 'eng')); - $this->assertEqual($l10n->locale, 'eng'); + $this->assertEquals($l10n->language, 'English'); + $this->assertEquals($l10n->languagePath, array('eng', 'eng')); + $this->assertEquals($l10n->locale, 'eng'); // Map Entry $l10n->get('eng'); - $this->assertEqual($l10n->language, 'English'); - $this->assertEqual($l10n->languagePath, array('eng', 'eng')); - $this->assertEqual($l10n->locale, 'eng'); + $this->assertEquals($l10n->language, 'English'); + $this->assertEquals($l10n->languagePath, array('eng', 'eng')); + $this->assertEquals($l10n->locale, 'eng'); // Catalog Entry $l10n->get('en-ca'); - $this->assertEqual($l10n->language, 'English (Canadian)'); - $this->assertEqual($l10n->languagePath, array('en_ca', 'eng')); - $this->assertEqual($l10n->locale, 'en_ca'); + $this->assertEquals($l10n->language, 'English (Canadian)'); + $this->assertEquals($l10n->languagePath, array('en_ca', 'eng')); + $this->assertEquals($l10n->locale, 'en_ca'); // Default Entry define('DEFAULT_LANGUAGE', 'en-us'); $l10n->get('use_default'); - $this->assertEqual($l10n->language, 'English (United States)'); - $this->assertEqual($l10n->languagePath, array('en_us', 'eng')); - $this->assertEqual($l10n->locale, 'en_us'); + $this->assertEquals($l10n->language, 'English (United States)'); + $this->assertEquals($l10n->languagePath, array('en_us', 'eng')); + $this->assertEquals($l10n->locale, 'en_us'); $l10n->get('es'); $l10n->get(''); - $this->assertEqual($l10n->lang, 'en-us'); + $this->assertEquals($l10n->lang, 'en-us'); // Using $this->default $l10n = new L10n(); $l10n->get('use_default'); - $this->assertEqual($l10n->language, 'English (United States)'); - $this->assertEqual($l10n->languagePath, array('en_us', 'eng', 'eng')); - $this->assertEqual($l10n->locale, 'en_us'); + $this->assertEquals($l10n->language, 'English (United States)'); + $this->assertEquals($l10n->languagePath, array('en_us', 'eng', 'eng')); + $this->assertEquals($l10n->locale, 'en_us'); } /** @@ -89,23 +89,23 @@ class L10nTest extends CakeTestCase { $l10n = new L10n(); $l10n->get(); - $this->assertEqual($l10n->language, 'English (Canadian)'); - $this->assertEqual($l10n->languagePath, array('en_ca', 'eng', 'eng')); - $this->assertEqual($l10n->locale, 'en_ca'); + $this->assertEquals($l10n->language, 'English (Canadian)'); + $this->assertEquals($l10n->languagePath, array('en_ca', 'eng', 'eng')); + $this->assertEquals($l10n->locale, 'en_ca'); $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'es_mx'; $l10n->get(); - $this->assertEqual($l10n->language, 'Spanish (Mexican)'); - $this->assertEqual($l10n->languagePath, array('es_mx', 'spa', 'eng')); - $this->assertEqual($l10n->locale, 'es_mx'); + $this->assertEquals($l10n->language, 'Spanish (Mexican)'); + $this->assertEquals($l10n->languagePath, array('es_mx', 'spa', 'eng')); + $this->assertEquals($l10n->locale, 'es_mx'); $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en_xy,en_ca'; $l10n->get(); - $this->assertEqual($l10n->language, 'English'); - $this->assertEqual($l10n->languagePath, array('eng', 'eng', 'eng')); - $this->assertEqual($l10n->locale, 'eng'); + $this->assertEquals($l10n->language, 'English'); + $this->assertEquals($l10n->languagePath, array('eng', 'eng', 'eng')); + $this->assertEquals($l10n->locale, 'eng'); $_SERVER = $__SERVER; } @@ -120,323 +120,323 @@ class L10nTest extends CakeTestCase { $result = $l10n->map(array('afr', 'af')); $expected = array('afr' => 'af', 'af' => 'afr'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('alb', 'sq')); $expected = array('alb' => 'sq', 'sq' => 'alb'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ara', 'ar')); $expected = array('ara' => 'ar', 'ar' => 'ara'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('hye', 'hy')); $expected = array('hye' => 'hy', 'hy' => 'hye'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('baq', 'eu')); $expected = array('baq' => 'eu', 'eu' => 'baq'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('baq', 'eu')); $expected = array('baq' => 'eu', 'eu' => 'baq'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('bos', 'bs')); $expected = array('bos' => 'bs', 'bs' => 'bos'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('bul', 'bg')); $expected = array('bul' => 'bg', 'bg' => 'bul'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('bel', 'be')); $expected = array('bel' => 'be', 'be' => 'bel'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('cat', 'ca')); $expected = array('cat' => 'ca', 'ca' => 'cat'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('chi', 'zh')); $expected = array('chi' => 'zh', 'zh' => 'chi'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('zho', 'zh')); $expected = array('zho' => 'zh', 'zh' => 'chi'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('hrv', 'hr')); $expected = array('hrv' => 'hr', 'hr' => 'hrv'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ces', 'cs')); $expected = array('ces' => 'cs', 'cs' => 'cze'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('cze', 'cs')); $expected = array('cze' => 'cs', 'cs' => 'cze'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('dan', 'da')); $expected = array('dan' => 'da', 'da' => 'dan'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('dut', 'nl')); $expected = array('dut' => 'nl', 'nl' => 'dut'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('nld', 'nl')); $expected = array('nld' => 'nl', 'nl' => 'dut'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('nld')); $expected = array('nld' => 'nl'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('eng', 'en')); $expected = array('eng' => 'en', 'en' => 'eng'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('est', 'et')); $expected = array('est' => 'et', 'et' => 'est'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('fao', 'fo')); $expected = array('fao' => 'fo', 'fo' => 'fao'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('fas', 'fa')); $expected = array('fas' => 'fa', 'fa' => 'fas'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('per', 'fa')); $expected = array('per' => 'fa', 'fa' => 'fas'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('fin', 'fi')); $expected = array('fin' => 'fi', 'fi' => 'fin'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('fra', 'fr')); $expected = array('fra' => 'fr', 'fr' => 'fre'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('fre', 'fr')); $expected = array('fre' => 'fr', 'fr' => 'fre'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('gla', 'gd')); $expected = array('gla' => 'gd', 'gd' => 'gla'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('glg', 'gl')); $expected = array('glg' => 'gl', 'gl' => 'glg'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('deu', 'de')); $expected = array('deu' => 'de', 'de' => 'deu'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ger', 'de')); $expected = array('ger' => 'de', 'de' => 'deu'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ell', 'el')); $expected = array('ell' => 'el', 'el' => 'gre'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('gre', 'el')); $expected = array('gre' => 'el', 'el' => 'gre'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('heb', 'he')); $expected = array('heb' => 'he', 'he' => 'heb'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('hin', 'hi')); $expected = array('hin' => 'hi', 'hi' => 'hin'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('hun', 'hu')); $expected = array('hun' => 'hu', 'hu' => 'hun'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ice', 'is')); $expected = array('ice' => 'is', 'is' => 'ice'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('isl', 'is')); $expected = array('isl' => 'is', 'is' => 'ice'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ind', 'id')); $expected = array('ind' => 'id', 'id' => 'ind'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('gle', 'ga')); $expected = array('gle' => 'ga', 'ga' => 'gle'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ita', 'it')); $expected = array('ita' => 'it', 'it' => 'ita'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('jpn', 'ja')); $expected = array('jpn' => 'ja', 'ja' => 'jpn'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('kor', 'ko')); $expected = array('kor' => 'ko', 'ko' => 'kor'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('lav', 'lv')); $expected = array('lav' => 'lv', 'lv' => 'lav'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('lit', 'lt')); $expected = array('lit' => 'lt', 'lt' => 'lit'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('mac', 'mk')); $expected = array('mac' => 'mk', 'mk' => 'mac'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('mkd', 'mk')); $expected = array('mkd' => 'mk', 'mk' => 'mac'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('may', 'ms')); $expected = array('may' => 'ms', 'ms' => 'may'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('msa', 'ms')); $expected = array('msa' => 'ms', 'ms' => 'may'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('mlt', 'mt')); $expected = array('mlt' => 'mt', 'mt' => 'mlt'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('nor', 'no')); $expected = array('nor' => 'no', 'no' => 'nor'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('nob', 'nb')); $expected = array('nob' => 'nb', 'nb' => 'nob'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('nno', 'nn')); $expected = array('nno' => 'nn', 'nn' => 'nno'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('pol', 'pl')); $expected = array('pol' => 'pl', 'pl' => 'pol'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('por', 'pt')); $expected = array('por' => 'pt', 'pt' => 'por'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('roh', 'rm')); $expected = array('roh' => 'rm', 'rm' => 'roh'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ron', 'ro')); $expected = array('ron' => 'ro', 'ro' => 'rum'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('rum', 'ro')); $expected = array('rum' => 'ro', 'ro' => 'rum'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('rus', 'ru')); $expected = array('rus' => 'ru', 'ru' => 'rus'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('smi', 'sz')); $expected = array('smi' => 'sz', 'sz' => 'smi'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('scc', 'sr')); $expected = array('scc' => 'sr', 'sr' => 'scc'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('srp', 'sr')); $expected = array('srp' => 'sr', 'sr' => 'scc'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('slk', 'sk')); $expected = array('slk' => 'sk', 'sk' => 'slo'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('slo', 'sk')); $expected = array('slo' => 'sk', 'sk' => 'slo'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('slv', 'sl')); $expected = array('slv' => 'sl', 'sl' => 'slv'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('wen', 'sb')); $expected = array('wen' => 'sb', 'sb' => 'wen'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('spa', 'es')); $expected = array('spa' => 'es', 'es' => 'spa'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('swe', 'sv')); $expected = array('swe' => 'sv', 'sv' => 'swe'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('tha', 'th')); $expected = array('tha' => 'th', 'th' => 'tha'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('tso', 'ts')); $expected = array('tso' => 'ts', 'ts' => 'tso'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('tsn', 'tn')); $expected = array('tsn' => 'tn', 'tn' => 'tsn'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('tur', 'tr')); $expected = array('tur' => 'tr', 'tr' => 'tur'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ukr', 'uk')); $expected = array('ukr' => 'uk', 'uk' => 'ukr'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('urd', 'ur')); $expected = array('urd' => 'ur', 'ur' => 'urd'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('ven', 've')); $expected = array('ven' => 've', 've' => 'ven'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('vie', 'vi')); $expected = array('vie' => 'vi', 'vi' => 'vie'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('xho', 'xh')); $expected = array('xho' => 'xh', 'xh' => 'xho'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('cy', 'cym')); $expected = array('cym' => 'cy', 'cy' => 'cym'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('yid', 'yi')); $expected = array('yid' => 'yi', 'yi' => 'yid'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->map(array('zul', 'zu')); $expected = array('zul' => 'zu', 'zu' => 'zul'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); } /** @@ -451,7 +451,7 @@ class L10nTest extends CakeTestCase { $expected = array( 'af' => array('language' => 'Afrikaans', 'locale' => 'afr', 'localeFallback' => 'afr', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ar', 'ar-ae', 'ar-bh', 'ar-dz', 'ar-eg', 'ar-iq', 'ar-jo', 'ar-kw', 'ar-lb', 'ar-ly', 'ar-ma', 'ar-om', 'ar-qa', 'ar-sa', 'ar-sy', 'ar-tn', 'ar-ye')); @@ -474,43 +474,43 @@ class L10nTest extends CakeTestCase { 'ar-tn' => array('language' => 'Arabic (Tunisia)', 'locale' => 'ar_tn', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), 'ar-ye' => array('language' => 'Arabic (Yemen)', 'locale' => 'ar_ye', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('be')); $expected = array( 'be' => array('language' => 'Byelorussian', 'locale' => 'bel', 'localeFallback' => 'bel', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('bg')); $expected = array( 'bg' => array('language' => 'Bulgarian', 'locale' => 'bul', 'localeFallback' => 'bul', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('bs')); $expected = array( 'bs' => array('language' => 'Bosnian', 'locale' => 'bos', 'localeFallback' => 'bos', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ca')); $expected = array( 'ca' => array('language' => 'Catalan', 'locale' => 'cat', 'localeFallback' => 'cat', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('cs')); $expected = array( 'cs' => array('language' => 'Czech', 'locale' => 'cze', 'localeFallback' => 'cze', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('da')); $expected = array( 'da' => array('language' => 'Danish', 'locale' => 'dan', 'localeFallback' => 'dan', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('de', 'de-at', 'de-ch', 'de-de', 'de-li', 'de-lu')); $expected = array( @@ -521,14 +521,14 @@ class L10nTest extends CakeTestCase { 'de-li' => array('language' => 'German (Liechtenstein)', 'locale' => 'de_li', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'), 'de-lu' => array('language' => 'German (Luxembourg)', 'locale' => 'de_lu', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('e', 'el')); $expected = array( 'e' => array('language' => 'Greek', 'locale' => 'gre', 'localeFallback' => 'gre', 'charset' => 'utf-8', 'direction' => 'ltr'), 'el' => array('language' => 'Greek', 'locale' => 'gre', 'localeFallback' => 'gre', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('en', 'en-au', 'en-bz', 'en-ca', 'en-gb', 'en-ie', 'en-jm', 'en-nz', 'en-tt', 'en-us', 'en-za')); $expected = array( @@ -544,7 +544,7 @@ class L10nTest extends CakeTestCase { 'en-us' => array('language' => 'English (United States)', 'locale' => 'en_us', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), 'en-za' => array('language' => 'English (South Africa)', 'locale' => 'en_za', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('es', 'es-ar', 'es-bo', 'es-cl', 'es-co', 'es-cr', 'es-do', 'es-ec', 'es-es', 'es-gt', 'es-hn', 'es-mx', 'es-ni', 'es-pa', 'es-pe', 'es-pr', 'es-py', 'es-sv', 'es-uy', 'es-ve')); @@ -570,37 +570,37 @@ class L10nTest extends CakeTestCase { 'es-uy' => array('language' => 'Spanish (Uruguay)', 'locale' => 'es_uy', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), 'es-ve' => array('language' => 'Spanish (Venezuela)', 'locale' => 'es_ve', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('et')); $expected = array( 'et' => array('language' => 'Estonian', 'locale' => 'est', 'localeFallback' => 'est', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('eu')); $expected = array( 'eu' => array('language' => 'Basque', 'locale' => 'baq', 'localeFallback' => 'baq', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('fa')); $expected = array( 'fa' => array('language' => 'Farsi', 'locale' => 'per', 'localeFallback' => 'per', 'charset' => 'utf-8', 'direction' => 'rtl') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('fi')); $expected = array( 'fi' => array('language' => 'Finnish', 'locale' => 'fin', 'localeFallback' => 'fin', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('fo')); $expected = array( 'fo' => array('language' => 'Faeroese', 'locale' => 'fao', 'localeFallback' => 'fao', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('fr', 'fr-be', 'fr-ca', 'fr-ch', 'fr-fr', 'fr-lu')); $expected = array( @@ -611,82 +611,82 @@ class L10nTest extends CakeTestCase { 'fr-fr' => array('language' => 'French (France)', 'locale' => 'fr_fr', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'), 'fr-lu' => array('language' => 'French (Luxembourg)', 'locale' => 'fr_lu', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ga')); $expected = array( 'ga' => array('language' => 'Irish', 'locale' => 'gle', 'localeFallback' => 'gle', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('gd', 'gd-ie')); $expected = array( 'gd' => array('language' => 'Gaelic (Scots)', 'locale' => 'gla', 'localeFallback' => 'gla', 'charset' => 'utf-8', 'direction' => 'ltr'), 'gd-ie' => array('language' => 'Gaelic (Irish)', 'locale' => 'gd_ie', 'localeFallback' => 'gla', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('gl')); $expected = array( 'gl' => array('language' => 'Galician', 'locale' => 'glg', 'localeFallback' => 'glg', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('he')); $expected = array( 'he' => array('language' => 'Hebrew', 'locale' => 'heb', 'localeFallback' => 'heb', 'charset' => 'utf-8', 'direction' => 'rtl') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('hi')); $expected = array( 'hi' => array('language' => 'Hindi', 'locale' => 'hin', 'localeFallback' => 'hin', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('hr')); $expected = array( 'hr' => array('language' => 'Croatian', 'locale' => 'hrv', 'localeFallback' => 'hrv', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('hu')); $expected = array( 'hu' => array('language' => 'Hungarian', 'locale' => 'hun', 'localeFallback' => 'hun', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('hy')); $expected = array( 'hy' => array('language' => 'Armenian - Armenia', 'locale' => 'hye', 'localeFallback' => 'hye', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('id', 'in')); $expected = array( 'id' => array('language' => 'Indonesian', 'locale' => 'ind', 'localeFallback' => 'ind', 'charset' => 'utf-8', 'direction' => 'ltr'), 'in' => array('language' => 'Indonesian', 'locale' => 'ind', 'localeFallback' => 'ind', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('is')); $expected = array( 'is' => array('language' => 'Icelandic', 'locale' => 'ice', 'localeFallback' => 'ice', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('it', 'it-ch')); $expected = array( 'it' => array('language' => 'Italian', 'locale' => 'ita', 'localeFallback' => 'ita', 'charset' => 'utf-8', 'direction' => 'ltr'), 'it-ch' => array('language' => 'Italian (Swiss) ', 'locale' => 'it_ch', 'localeFallback' => 'ita', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ja')); $expected = array( 'ja' => array('language' => 'Japanese', 'locale' => 'jpn', 'localeFallback' => 'jpn', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ko', 'ko-kp', 'ko-kr')); $expected = array( @@ -694,7 +694,7 @@ class L10nTest extends CakeTestCase { 'ko-kp' => array('language' => 'Korea (North)', 'locale' => 'ko_kp', 'localeFallback' => 'kor', 'charset' => 'kr', 'direction' => 'ltr'), 'ko-kr' => array('language' => 'Korea (South)', 'locale' => 'ko_kr', 'localeFallback' => 'kor', 'charset' => 'kr', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('koi8-r', 'ru', 'ru-mo')); $expected = array( @@ -702,38 +702,38 @@ class L10nTest extends CakeTestCase { 'ru' => array('language' => 'Russian', 'locale' => 'rus', 'localeFallback' => 'rus', 'charset' => 'utf-8', 'direction' => 'ltr'), 'ru-mo' => array('language' => 'Russian (Moldavia)', 'locale' => 'ru_mo', 'localeFallback' => 'rus', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('lt')); $expected = array( 'lt' => array('language' => 'Lithuanian', 'locale' => 'lit', 'localeFallback' => 'lit', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('lv')); $expected = array( 'lv' => array('language' => 'Latvian', 'locale' => 'lav', 'localeFallback' => 'lav', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('mk', 'mk-mk')); $expected = array( 'mk' => array('language' => 'FYRO Macedonian', 'locale' => 'mk', 'localeFallback' => 'mac', 'charset' => 'utf-8', 'direction' => 'ltr'), 'mk-mk' => array('language' => 'Macedonian', 'locale' => 'mk_mk', 'localeFallback' => 'mac', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ms')); $expected = array( 'ms' => array('language' => 'Malaysian', 'locale' => 'may', 'localeFallback' => 'may', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('mt')); $expected = array( 'mt' => array('language' => 'Maltese', 'locale' => 'mlt', 'localeFallback' => 'mlt', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('n', 'nl', 'nl-be')); $expected = array( @@ -741,175 +741,175 @@ class L10nTest extends CakeTestCase { 'nl' => array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'), 'nl-be' => array('language' => 'Dutch (Belgium)', 'locale' => 'nl_be', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog('nl'); $expected = array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog('nld'); $expected = array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog('dut'); $expected = array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('nb')); $expected = array( 'nb' => array('language' => 'Norwegian Bokmal', 'locale' => 'nob', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('nn', 'no')); $expected = array( 'nn' => array('language' => 'Norwegian Nynorsk', 'locale' => 'nno', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr'), 'no' => array('language' => 'Norwegian', 'locale' => 'nor', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('p', 'pl')); $expected = array( 'p' => array('language' => 'Polish', 'locale' => 'pol', 'localeFallback' => 'pol', 'charset' => 'utf-8', 'direction' => 'ltr'), 'pl' => array('language' => 'Polish', 'locale' => 'pol', 'localeFallback' => 'pol', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('pt', 'pt-br')); $expected = array( 'pt' => array('language' => 'Portuguese (Portugal)', 'locale' => 'por', 'localeFallback' => 'por', 'charset' => 'utf-8', 'direction' => 'ltr'), 'pt-br' => array('language' => 'Portuguese (Brazil)', 'locale' => 'pt_br', 'localeFallback' => 'por', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('rm')); $expected = array( 'rm' => array('language' => 'Rhaeto-Romanic', 'locale' => 'roh', 'localeFallback' => 'roh', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ro', 'ro-mo')); $expected = array( 'ro' => array('language' => 'Romanian', 'locale' => 'rum', 'localeFallback' => 'rum', 'charset' => 'utf-8', 'direction' => 'ltr'), 'ro-mo' => array('language' => 'Romanian (Moldavia)', 'locale' => 'ro_mo', 'localeFallback' => 'rum', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('sb')); $expected = array( 'sb' => array('language' => 'Sorbian', 'locale' => 'wen', 'localeFallback' => 'wen', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('sk')); $expected = array( 'sk' => array('language' => 'Slovak', 'locale' => 'slo', 'localeFallback' => 'slo', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('sl')); $expected = array( 'sl' => array('language' => 'Slovenian', 'locale' => 'slv', 'localeFallback' => 'slv', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('sq')); $expected = array( 'sq' => array('language' => 'Albanian', 'locale' => 'alb', 'localeFallback' => 'alb', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('sr')); $expected = array( 'sr' => array('language' => 'Serbian', 'locale' => 'scc', 'localeFallback' => 'scc', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('sv', 'sv-fi')); $expected = array( 'sv' => array('language' => 'Swedish', 'locale' => 'swe', 'localeFallback' => 'swe', 'charset' => 'utf-8', 'direction' => 'ltr'), 'sv-fi' => array('language' => 'Swedish (Finland)', 'locale' => 'sv_fi', 'localeFallback' => 'swe', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('sx')); $expected = array( 'sx' => array('language' => 'Sutu', 'locale' => 'sx', 'localeFallback' => 'sx', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('sz')); $expected = array( 'sz' => array('language' => 'Sami (Lappish)', 'locale' => 'smi', 'localeFallback' => 'smi', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('th')); $expected = array( 'th' => array('language' => 'Thai', 'locale' => 'tha', 'localeFallback' => 'tha', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('tn')); $expected = array( 'tn' => array('language' => 'Tswana', 'locale' => 'tsn', 'localeFallback' => 'tsn', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('tr')); $expected = array( 'tr' => array('language' => 'Turkish', 'locale' => 'tur', 'localeFallback' => 'tur', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ts')); $expected = array( 'ts' => array('language' => 'Tsonga', 'locale' => 'tso', 'localeFallback' => 'tso', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('uk')); $expected = array( 'uk' => array('language' => 'Ukrainian', 'locale' => 'ukr', 'localeFallback' => 'ukr', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ur')); $expected = array( 'ur' => array('language' => 'Urdu', 'locale' => 'urd', 'localeFallback' => 'urd', 'charset' => 'utf-8', 'direction' => 'rtl') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('ve')); $expected = array( 've' => array('language' => 'Venda', 'locale' => 'ven', 'localeFallback' => 'ven', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('vi')); $expected = array( 'vi' => array('language' => 'Vietnamese', 'locale' => 'vie', 'localeFallback' => 'vie', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('cy')); $expected = array( 'cy' => array('language' => 'Welsh', 'locale' => 'cym', 'localeFallback' => 'cym', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('xh')); $expected = array( 'xh' => array('language' => 'Xhosa', 'locale' => 'xho', 'localeFallback' => 'xho', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('yi')); $expected = array( 'yi' => array('language' => 'Yiddish', 'locale' => 'yid', 'localeFallback' => 'yid', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('zh', 'zh-cn', 'zh-hk', 'zh-sg', 'zh-tw')); $expected = array( @@ -919,13 +919,13 @@ class L10nTest extends CakeTestCase { 'zh-sg' => array('language' => 'Chinese (Singapore)', 'locale' => 'zh_sg', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'), 'zh-tw' => array('language' => 'Chinese (Taiwan)', 'locale' => 'zh_tw', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('zu')); $expected = array( 'zu' => array('language' => 'Zulu', 'locale' => 'zul', 'localeFallback' => 'zul', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('en-nz', 'es-do', 'sz', 'ar-lb', 'zh-hk', 'pt-br')); $expected = array( @@ -936,7 +936,7 @@ class L10nTest extends CakeTestCase { 'zh-hk' => array('language' => 'Chinese (Hong Kong)', 'locale' => 'zh_hk', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'), 'pt-br' => array('language' => 'Portuguese (Brazil)', 'locale' => 'pt_br', 'localeFallback' => 'por', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); $result = $l10n->catalog(array('eng', 'deu', 'zho', 'rum', 'zul', 'yid')); $expected = array( @@ -947,6 +947,6 @@ class L10nTest extends CakeTestCase { 'zul' => array('language' => 'Zulu', 'locale' => 'zul', 'localeFallback' => 'zul', 'charset' => 'utf-8', 'direction' => 'ltr'), 'yid' => array('language' => 'Yiddish', 'locale' => 'yid', 'localeFallback' => 'yid', 'charset' => 'utf-8', 'direction' => 'ltr') ); - $this->assertEqual($expected, $result); + $this->assertEquals($expected, $result); } } diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index 00e3eb2f7..d45b91085 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -7560,7 +7560,7 @@ class ModelReadTest extends BaseModelTest { '2' => 'Second Post', '1' => 'First Post' ); - $this->assertEqual($result, $expected); + $this->assertEquals($result, $expected); $result = $Post->find('list', array('order' => array('Post.other_field' => 'DESC'))); $expected = array( @@ -7568,23 +7568,23 @@ class ModelReadTest extends BaseModelTest { '2' => 'Second Post', '3' => 'Third Post' ); - $this->assertEqual($result, $expected); + $this->assertEquals($result, $expected); $Post->Author->virtualFields = array('joined' => 'Post.id * Author.id'); $result = $Post->find('all'); $result = Set::extract('{n}.Author.joined', $result); $expected = array(1, 6, 3); - $this->assertEqual($result, $expected); + $this->assertEquals($result, $expected); $result = $Post->find('all', array('order' => array('Author.joined' => 'ASC'))); $result = Set::extract('{n}.Author.joined', $result); $expected = array(1, 3, 6); - $this->assertEqual($result, $expected); + $this->assertEquals($result, $expected); $result = $Post->find('all', array('order' => array('Author.joined' => 'DESC'))); $result = Set::extract('{n}.Author.joined', $result); $expected = array(6, 3, 1); - $this->assertEqual($result, $expected); + $this->assertEquals($result, $expected); } /** diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 6ebfa48a9..1347a5ecf 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -3550,7 +3550,6 @@ class ModelWriteTest extends BaseModelTest { 'title' => '', 'body' => 'Trying to get away with an empty title' )); - $newTs = date('Y-m-d H:i:s'); $result = $TestModel->saveAll($data, array('validate' => true, 'atomic' => false)); $this->assertEquals($result, array(true, false)); $result = $TestModel->find('all', array('recursive' => -1, 'order' => 'Post.id ASC')); @@ -3598,10 +3597,10 @@ class ModelWriteTest extends BaseModelTest { ) ); - $this->assertTrue($result[0]['Post']['updated'] >= $newTs); - $this->assertTrue($result[1]['Post']['updated'] >= $newTs); - $this->assertTrue($result[3]['Post']['updated'] >= $newTs); - $this->assertTrue($result[3]['Post']['created'] >= $newTs); + $this->assertTrue($result[0]['Post']['updated'] >= $ts); + $this->assertTrue($result[1]['Post']['updated'] >= $ts); + $this->assertTrue($result[3]['Post']['updated'] >= $ts); + $this->assertTrue($result[3]['Post']['created'] >= $ts); unset( $result[0]['Post']['updated'], $result[1]['Post']['updated'], $result[3]['Post']['updated'], $result[3]['Post']['created'] diff --git a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php index 13e27c8e2..da21897bd 100644 --- a/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php +++ b/lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php @@ -606,7 +606,7 @@ class CakeRouteTest extends CakeTestCase { 'fish' => 'trout' ) ); - $this->assertEquals($expected, $result, 'Fish should be parsed, as action == index'); + $this->assertEquals($expected, $result, 'Fizz should be parsed, as controller == comments|other'); $result = $route->parse('/comments/index/wibble:spin/fish:trout/fizz:buzz'); $expected = array( @@ -665,6 +665,19 @@ class CakeRouteTest extends CakeTestCase { $this->assertEquals($expected, $result, 'Greedy named grabs everything, rules are followed'); } +/** + * Having greedNamed enabled should not capture routing.prefixes. + * + * @return void + */ + public function testMatchGreedyNamedExcludesPrefixes() { + Configure::write('Routing.prefixes', array('admin')); + Router::reload(); + + $route = new CakeRoute('/sales/*', array('controller' => 'sales', 'action' => 'index')); + $this->assertFalse($route->match(array('controller' => 'sales', 'action' => 'index', 'admin' => 1)), 'Greedy named consume routing prefixes.'); + } + /** * test that parsing array format named parameters works * diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 9cd8aa134..2107e3170 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -960,6 +960,21 @@ class FormHelperTest extends CakeTestCase { $this->assertTags($result, $expected); } +/** + * Test that buttons created with foo[bar] name attributes are unlocked correctly. + * + * @return void + */ + public function testSecurityButtonNestedNamed() { + $key = 'testKey'; + $this->Form->request['_Token'] = array('key' => $key); + + $this->Form->create('Addresses'); + $this->Form->button('Test', array('type' => 'submit', 'name' => 'Address[button]')); + $result = $this->Form->unlockField(); + $this->assertEquals(array('Address.button'), $result); + } + /** * Test that the correct fields are unlocked for image submits with no names. * diff --git a/lib/Cake/Test/Case/View/Helper/TimeHelperTest.php b/lib/Cake/Test/Case/View/Helper/TimeHelperTest.php index e52b3d917..8a6a60507 100644 --- a/lib/Cake/Test/Case/View/Helper/TimeHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TimeHelperTest.php @@ -751,6 +751,7 @@ class TimeHelperTest extends CakeTestCase { 'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS) ), true); Configure::write('Config.language', 'time_test'); + $time = strtotime('Thu Jan 14 13:59:28 2010'); $result = $this->Time->i18nFormat($time); @@ -765,6 +766,20 @@ class TimeHelperTest extends CakeTestCase { $expected = 'Time is 01:59:28 PM, and date is 14/01/10'; $this->assertEquals($expected, $result); + $time = strtotime('Wed Jan 13 13:59:28 2010'); + + $result = $this->Time->i18nFormat($time); + $expected = '13/01/10'; + $this->assertEquals($expected, $result); + + $result = $this->Time->i18nFormat($time, '%c'); + $expected = 'mié 13 ene 2010 13:59:28 ' . strftime('%Z', $time); + $this->assertEquals($expected, $result); + + $result = $this->Time->i18nFormat($time, 'Time is %r, and date is %x'); + $expected = 'Time is 01:59:28 PM, and date is 13/01/10'; + $this->assertEquals($expected, $result); + $result = $this->Time->i18nFormat('invalid date', '%x', 'Date invalid'); $expected = 'Date invalid'; $this->assertEquals($expected, $result); diff --git a/lib/Cake/Utility/File.php b/lib/Cake/Utility/File.php index 384b9a029..34bb7c2cd 100644 --- a/lib/Cake/Utility/File.php +++ b/lib/Cake/Utility/File.php @@ -34,6 +34,7 @@ class File { * Folder object of the File * * @var Folder + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$Folder */ public $Folder = null; @@ -41,13 +42,15 @@ class File { * Filename * * @var string + * http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$name */ public $name = null; /** * File info * - * @var string + * @var array + * http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$info */ public $info = array(); @@ -55,6 +58,7 @@ class File { * Holds the file handler resource if the file is opened * * @var resource + * http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$handle */ public $handle = null; @@ -62,6 +66,7 @@ class File { * Enable locking for file reading and writing * * @var boolean + * http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$lock */ public $lock = null; @@ -71,6 +76,7 @@ class File { * Current file's absolute path * * @var mixed null + * http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$path */ public $path = null; diff --git a/lib/Cake/Utility/Folder.php b/lib/Cake/Utility/Folder.php index fd1cdd160..e3d96d606 100644 --- a/lib/Cake/Utility/Folder.php +++ b/lib/Cake/Utility/Folder.php @@ -29,6 +29,7 @@ class Folder { * Path to Folder. * * @var string + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::$path */ public $path = null; @@ -37,6 +38,7 @@ class Folder { * should be sorted by name. * * @var boolean + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::$sort */ public $sort = false; @@ -44,6 +46,7 @@ class Folder { * Mode to be used on create. Does nothing on windows platforms. * * @var integer + * http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::$mode */ public $mode = 0755; diff --git a/lib/Cake/Utility/Set.php b/lib/Cake/Utility/Set.php index 84b966511..b25ba48fc 100644 --- a/lib/Cake/Utility/Set.php +++ b/lib/Cake/Utility/Set.php @@ -37,6 +37,7 @@ class Set { * @param array $arr1 Array to be merged * @param array $arr2 Array to merge with * @return array Merged array + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::merge */ public static function merge($arr1, $arr2 = null) { $args = func_get_args(); @@ -61,6 +62,7 @@ class Set { * * @param array $var Either an array to filter, or value when in callback * @return mixed Either filtered array, or true/false when in callback + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::filter */ public static function filter(array $var) { foreach ($var as $k => $v) { @@ -90,6 +92,7 @@ class Set { * @param mixed $array Original array * @param mixed $array2 Differences to push * @return array Combined array + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::pushDiff */ public static function pushDiff($array, $array2) { if (empty($array) && !empty($array2)) { @@ -116,6 +119,7 @@ class Set { * @param string $class A class name of the type of object to map to * @param string $tmp A temporary class name used as $class if $class is an array * @return object Hierarchical object + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::map */ public static function map($class = 'stdClass', $tmp = 'stdClass') { if (is_array($class)) { @@ -202,6 +206,7 @@ class Set { * * @param array $array The array to check. If null, the value of the current Set object * @return boolean true if values are numeric, false otherwise + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::numeric */ public static function numeric($array = null) { if (empty($array)) { @@ -238,6 +243,7 @@ class Set { * @param mixed $select Key in $list to return * @param mixed $list can be an array or a comma-separated list. * @return string the value of the array key or null if no match + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::enum */ public static function enum($select, $list = null) { if (empty($list)) { @@ -260,6 +266,7 @@ class Set { * @param string $format Format string into which values will be inserted, see sprintf() * @param array $keys An array containing one or more Set::extract()-style key paths * @return array An array of strings extracted from $keys and formatted with $format + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::format */ public static function format($data, $format, $keys) { $extracted = array(); @@ -338,6 +345,7 @@ class Set { * @param array $data An array of data to extract from * @param array $options Currently only supports 'flatten' which can be disabled for higher XPath-ness * @return array An array of matched items + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::extract */ public static function extract($path, $data = null, $options = array()) { if (is_string($data)) { @@ -488,6 +496,7 @@ class Set { * @param integer $i Optional: The 'nth'-number of the item being matched. * @param integer $length * @return boolean + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::matches */ public static function matches($conditions, $data = array(), $i = null, $length = null) { if (empty($conditions)) { @@ -561,6 +570,7 @@ class Set { * @param array $data Array from where to extract * @param mixed $path As an array, or as a dot-separated string. * @return array Extracted data + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::classicExtract */ public static function classicExtract($data, $path = null) { if (empty($path)) { @@ -648,6 +658,7 @@ class Set { * @param mixed $path A dot-separated string. * @param array $data Data to insert * @return array + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::insert */ public static function insert($list, $path, $data = null) { if (!is_array($path)) { @@ -678,6 +689,7 @@ class Set { * @param mixed $list From where to remove * @param mixed $path A dot-separated string. * @return array Array with $path removed from its value + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::remove */ public static function remove($list, $path = null) { if (empty($path)) { @@ -710,6 +722,7 @@ class Set { * @param mixed $data Data to check on * @param mixed $path A dot-separated string. * @return boolean true if path is found, false otherwise + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::check */ public static function check($data, $path = null) { if (empty($path)) { @@ -742,6 +755,7 @@ class Set { * @param mixed $val2 Second value * @return array Returns the key => value pairs that are not common in $val1 and $val2 * The expression for this function is ($val1 - $val2) + ($val2 - ($val1 - $val2)) + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::diff */ public static function diff($val1, $val2 = null) { if (empty($val1)) { @@ -768,6 +782,7 @@ class Set { * @param array $val1 First value * @param array $val2 Second value * @return boolean true if $val1 contains $val2, false otherwise + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::contains */ public static function contains($val1, $val2 = null) { if (empty($val1) || empty($val2)) { @@ -794,6 +809,7 @@ class Set { * @param boolean $all Set to true to count the dimension considering all elements in array * @param integer $count Start the dimension count at this number * @return integer The number of dimensions in $array + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::countDim */ public static function countDim($array = null, $all = false, $count = 0) { if ($all) { @@ -822,6 +838,7 @@ class Set { * @param string $sep If $list is a string, it will be split into an array with $sep * @param boolean $trim If true, separated strings will be trimmed * @return array + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::normalize */ public static function normalize($list, $assoc = true, $sep = ',', $trim = true) { if (is_string($list)) { @@ -873,6 +890,7 @@ class Set { * @param mixed $path2 As an array, or as a dot-separated string. * @param string $groupPath As an array, or as a dot-separated string. * @return array Combined array + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::combine */ public static function combine($data, $path1 = null, $path2 = null, $groupPath = null) { if (empty($data)) { @@ -933,6 +951,7 @@ class Set { * Converts an object into an array. * @param object $object Object to reverse * @return array Array representation of given object + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::reverse */ public static function reverse($object) { $out = array(); @@ -979,6 +998,7 @@ class Set { * @param array $data Array to flatten * @param string $separator String used to separate array key elements in a path, defaults to '.' * @return array + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::flatten */ public static function flatten($data, $separator = '.') { $result = array(); @@ -1035,6 +1055,7 @@ class Set { * @param string $path A Set-compatible path to the array value * @param string $dir Direction of sorting - either ascending (ASC), or descending (DESC) * @return array Sorted array of data + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::sort */ public static function sort($data, $path, $dir) { $originalKeys = array_keys($data); @@ -1074,6 +1095,7 @@ class Set { * to array_map, reduce will handoff to array_reduce, and pass will * use call_user_func_array(). * @return mixed Result of the callback when applied to extracted data + * @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::apply */ public static function apply($path, $data, $callback, $options = array()) { $defaults = array('type' => 'pass'); diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 6258e8234..0ea205161 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -591,7 +591,7 @@ class FormHelper extends AppHelper { * * @param boolean $lock Whether this field should be part of the validation * or excluded as part of the unlockedFields. - * @param mixed $field Reference to field to be secured + * @param mixed $field Reference to field to be secured. Should be dot separted to indicate nesting. * @param mixed $value Field value, if value should not be tampered with. * @return void */ @@ -1466,7 +1466,8 @@ class FormHelper extends AppHelper { $title = h($title); } if (isset($options['name'])) { - $this->_secure($options['secure'], $options['name']); + $name = str_replace(array('[', ']'), array('.', ''), $options['name']); + $this->_secure($options['secure'], $name); } return $this->Html->useTag('button', $options['type'], array_diff_key($options, array('type' => '')), $title); } diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php index 55fede407..70d1fdcf7 100644 --- a/lib/Cake/View/Helper/TimeHelper.php +++ b/lib/Cake/View/Helper/TimeHelper.php @@ -16,6 +16,9 @@ * @since CakePHP(tm) v 0.10.0.1076 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +if (!class_exists('Multibyte')) { + App::import('Core', 'Multibyte'); +} App::uses('AppHelper', 'View/Helper'); @@ -241,7 +244,7 @@ class TimeHelper extends AppHelper { $format = $this->niceFormat; } $format = $this->convertSpecifiers($format, $date); - return strftime($format, $date); + return $this->_strftime($format, $date); } /** @@ -263,12 +266,12 @@ class TimeHelper extends AppHelper { $y = $this->isThisYear($date) ? '' : ' %Y'; if ($this->isToday($dateString, $userOffset)) { - $ret = __d('cake', 'Today, %s', strftime("%H:%M", $date)); + $ret = __d('cake', 'Today, %s', $this->_strftime("%H:%M", $date)); } elseif ($this->wasYesterday($dateString, $userOffset)) { - $ret = __d('cake', 'Yesterday, %s', strftime("%H:%M", $date)); + $ret = __d('cake', 'Yesterday, %s', $this->_strftime("%H:%M", $date)); } else { $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date); - $ret = strftime($format, $date); + $ret = $this->_strftime($format, $date); } return $ret; @@ -748,6 +751,32 @@ class TimeHelper extends AppHelper { $format = '%x'; } $format = $this->convertSpecifiers($format, $date); - return strftime($format, $date); + return $this->_strftime($format, $date); + } + +/** + * Multibyte wrapper for strftime. + * + * Handles utf8_encoding the result of strftime when necessary. + * + * @param string $format Format string. + * @param int $date Timestamp to format. + * @return string formatted string with correct encoding. + */ + protected function _strftime($format, $date) { + $format = strftime($format, $date); + $encoding = Configure::read('App.encoding'); + + if (!empty($encoding) && $encoding === 'UTF-8') { + if (function_exists('mb_check_encoding')) { + $valid = mb_check_encoding($format, $encoding); + } else { + $valid = !Multibyte::checkMultibyte($format); + } + if (!$valid) { + $format = utf8_encode($format); + } + } + return $format; } } diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index c8dfc4186..d82714b7c 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -92,12 +92,10 @@ function debug($var = false, $showHtml = null, $showFrom = true) { HTML; $text = <<