mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge branch '2.0' into 2.1
Conflicts: lib/Cake/Test/Case/BasicsTest.php
This commit is contained in:
commit
21cd3f00ac
21 changed files with 495 additions and 385 deletions
40
app/Config/Schema/db_acl.sql
Normal file
40
app/Config/Schema/db_acl.sql
Normal file
|
@ -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)
|
||||||
|
);
|
26
app/Config/Schema/i18n.sql
Normal file
26
app/Config/Schema/i18n.sql
Normal file
|
@ -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)
|
||||||
|
);
|
16
app/Config/Schema/sessions.sql
Normal file
16
app/Config/Schema/sessions.sql
Normal file
|
@ -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)
|
||||||
|
);
|
|
@ -337,8 +337,7 @@ class AuthComponent extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to introspect the correct values for object properties including
|
* Attempts to introspect the correct values for object properties.
|
||||||
* $userModel and $sessionKey.
|
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -185,6 +185,8 @@ class ExceptionRenderer {
|
||||||
try {
|
try {
|
||||||
$this->controller->set($error->getAttributes());
|
$this->controller->set($error->getAttributes());
|
||||||
$this->_outputMessage($this->template);
|
$this->_outputMessage($this->template);
|
||||||
|
} catch (MissingViewException $e) {
|
||||||
|
$this->_outputMessage('error500');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->_outputMessageSafe('error500');
|
$this->_outputMessageSafe('error500');
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,6 +396,7 @@ class CakeRoute {
|
||||||
}
|
}
|
||||||
|
|
||||||
$namedConfig = Router::namedConfig();
|
$namedConfig = Router::namedConfig();
|
||||||
|
$prefixes = Router::prefixes();
|
||||||
$greedyNamed = $namedConfig['greedyNamed'];
|
$greedyNamed = $namedConfig['greedyNamed'];
|
||||||
$allowedNamedParams = $namedConfig['rules'];
|
$allowedNamedParams = $namedConfig['rules'];
|
||||||
|
|
||||||
|
@ -429,7 +430,8 @@ class CakeRoute {
|
||||||
// pull out named params if named params are greedy or a rule exists.
|
// pull out named params if named params are greedy or a rule exists.
|
||||||
if (
|
if (
|
||||||
($greedyNamed || isset($allowedNamedParams[$key])) &&
|
($greedyNamed || isset($allowedNamedParams[$key])) &&
|
||||||
($value !== false && $value !== null)
|
($value !== false && $value !== null) &&
|
||||||
|
(!in_array($key, $prefixes))
|
||||||
) {
|
) {
|
||||||
$named[$key] = $value;
|
$named[$key] = $value;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -683,61 +683,21 @@ class BasicsTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function testDebug() {
|
public function testDebug() {
|
||||||
ob_start();
|
ob_start();
|
||||||
debug('this-is-a-test');
|
debug('this-is-a-test', false);
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
$expectedHtml = <<<EXPECTED
|
|
||||||
<div class="cake-debug-output">
|
|
||||||
<span><strong>%s</strong> (line <strong>%d</strong>)</span>
|
|
||||||
<pre class="cake-debug">
|
|
||||||
this-is-a-test
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
EXPECTED;
|
|
||||||
$expectedText = <<<EXPECTED
|
$expectedText = <<<EXPECTED
|
||||||
|
|
||||||
%s (line %d)
|
%s (line %d)
|
||||||
########## DEBUG ##########
|
########## DEBUG ##########
|
||||||
'this-is-a-test'
|
'this-is-a-test'
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
EXPECTED;
|
EXPECTED;
|
||||||
if (php_sapi_name() == 'cli') {
|
$expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 8);
|
||||||
$expected = sprintf($expectedText, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 19);
|
|
||||||
} else {
|
|
||||||
$expected = sprintf($expectedHtml, substr(__FILE__, strlen(ROOT) + 1), __LINE__ - 21);
|
|
||||||
}
|
|
||||||
$this->assertEquals($expected, $result);
|
|
||||||
|
|
||||||
ob_start();
|
|
||||||
debug('<div>this-is-a-test</div>');
|
|
||||||
$result = ob_get_clean();
|
|
||||||
$expectedHtml = <<<EXPECTED
|
|
||||||
<div class="cake-debug-output">
|
|
||||||
<span><strong>%s</strong> (line <strong>%d</strong>)</span>
|
|
||||||
<pre class="cake-debug">
|
|
||||||
'<div>this-is-a-test</div>'
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
EXPECTED;
|
|
||||||
$expectedText = <<<EXPECTED
|
|
||||||
|
|
||||||
%s (line %d)
|
|
||||||
########## DEBUG ##########
|
|
||||||
'<div>this-is-a-test</div>'
|
|
||||||
###########################
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
debug('<div>this-is-a-test</div>', true);
|
debug('<div>this-is-a-test</div>', true);
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
$expected = <<<EXPECTED
|
$expectedHtml = <<<EXPECTED
|
||||||
<div class="cake-debug-output">
|
<div class="cake-debug-output">
|
||||||
<span><strong>%s</strong> (line <strong>%d</strong>)</span>
|
<span><strong>%s</strong> (line <strong>%d</strong>)</span>
|
||||||
<pre class="cake-debug">
|
<pre class="cake-debug">
|
||||||
|
@ -745,7 +705,7 @@ $expected = <<<EXPECTED
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
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);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -788,43 +748,15 @@ $expectedHtml = <<<EXPECTED
|
||||||
</div>
|
</div>
|
||||||
EXPECTED;
|
EXPECTED;
|
||||||
$expectedText = <<<EXPECTED
|
$expectedText = <<<EXPECTED
|
||||||
|
|
||||||
%s (line %d)
|
%s (line %d)
|
||||||
########## DEBUG ##########
|
########## DEBUG ##########
|
||||||
'<div>this-is-a-test</div>'
|
'<div>this-is-a-test</div>'
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
EXPECTED;
|
EXPECTED;
|
||||||
if (php_sapi_name() == 'cli') {
|
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 {
|
} 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);
|
|
||||||
|
|
||||||
ob_start();
|
|
||||||
debug('<div>this-is-a-test</div>', null);
|
|
||||||
$result = ob_get_clean();
|
|
||||||
$expectedHtml = <<<EXPECTED
|
|
||||||
<div class="cake-debug-output">
|
|
||||||
<span><strong>%s</strong> (line <strong>%d</strong>)</span>
|
|
||||||
<pre class="cake-debug">
|
|
||||||
'<div>this-is-a-test</div>'
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
EXPECTED;
|
|
||||||
$expectedText = <<<EXPECTED
|
|
||||||
|
|
||||||
%s (line %d)
|
|
||||||
########## DEBUG ##########
|
|
||||||
'<div>this-is-a-test</div>'
|
|
||||||
###########################
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
@ -841,16 +773,14 @@ $expectedHtml = <<<EXPECTED
|
||||||
EXPECTED;
|
EXPECTED;
|
||||||
$expectedText = <<<EXPECTED
|
$expectedText = <<<EXPECTED
|
||||||
|
|
||||||
|
|
||||||
########## DEBUG ##########
|
########## DEBUG ##########
|
||||||
'<div>this-is-a-test</div>'
|
'<div>this-is-a-test</div>'
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
EXPECTED;
|
EXPECTED;
|
||||||
if (php_sapi_name() == 'cli') {
|
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 {
|
} 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);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
|
@ -858,28 +788,24 @@ EXPECTED;
|
||||||
debug('<div>this-is-a-test</div>', false);
|
debug('<div>this-is-a-test</div>', false);
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
$expected = <<<EXPECTED
|
$expected = <<<EXPECTED
|
||||||
|
|
||||||
%s (line %d)
|
%s (line %d)
|
||||||
########## DEBUG ##########
|
########## DEBUG ##########
|
||||||
'<div>this-is-a-test</div>'
|
'<div>this-is-a-test</div>'
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
EXPECTED;
|
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);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
debug('<div>this-is-a-test</div>', false, true);
|
debug('<div>this-is-a-test</div>', false, true);
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
$expected = <<<EXPECTED
|
$expected = <<<EXPECTED
|
||||||
|
|
||||||
%s (line %d)
|
%s (line %d)
|
||||||
########## DEBUG ##########
|
########## DEBUG ##########
|
||||||
'<div>this-is-a-test</div>'
|
'<div>this-is-a-test</div>'
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
EXPECTED;
|
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);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -887,13 +813,11 @@ EXPECTED;
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
$expected = <<<EXPECTED
|
$expected = <<<EXPECTED
|
||||||
|
|
||||||
|
|
||||||
########## DEBUG ##########
|
########## DEBUG ##########
|
||||||
'<div>this-is-a-test</div>'
|
'<div>this-is-a-test</div>'
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
EXPECTED;
|
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);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -553,11 +553,11 @@ class PaginatorComponentTest extends CakeTestCase {
|
||||||
'paramType' => 'named'
|
'paramType' => 'named'
|
||||||
);
|
);
|
||||||
$result = $Controller->Paginator->paginate('PaginatorControllerPost');
|
$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');
|
$Controller->request->params['named'] = array('sort' => 'PaginatorAuthor.joined_offset', 'direction' => 'asc');
|
||||||
$result = $Controller->Paginator->paginate('PaginatorControllerPost');
|
$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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -64,33 +64,33 @@ class I18nTest extends CakeTestCase {
|
||||||
Cache::config('_cake_core_', Cache::config('default'));
|
Cache::config('_cake_core_', Cache::config('default'));
|
||||||
|
|
||||||
// make some calls to translate using different domains
|
// make some calls to translate using different domains
|
||||||
$this->assertEqual('Dom 1 Foo', I18n::translate('dom1.foo', false, 'dom1'));
|
$this->assertEquals('Dom 1 Foo', I18n::translate('dom1.foo', false, 'dom1'));
|
||||||
$this->assertEqual('Dom 1 Bar', I18n::translate('dom1.bar', false, 'dom1'));
|
$this->assertEquals('Dom 1 Bar', I18n::translate('dom1.bar', false, 'dom1'));
|
||||||
$domains = I18n::domains();
|
$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
|
// reset internally stored entries
|
||||||
I18n::clear();
|
I18n::clear();
|
||||||
|
|
||||||
// now only dom1 should be in cache
|
// now only dom1 should be in cache
|
||||||
$cachedDom1 = Cache::read('dom1_' . $lang, '_cake_core_');
|
$cachedDom1 = Cache::read('dom1_' . $lang, '_cake_core_');
|
||||||
$this->assertEqual('Dom 1 Foo', $cachedDom1['LC_MESSAGES']['dom1.foo']);
|
$this->assertEquals('Dom 1 Foo', $cachedDom1['LC_MESSAGES']['dom1.foo']);
|
||||||
$this->assertEqual('Dom 1 Bar', $cachedDom1['LC_MESSAGES']['dom1.bar']);
|
$this->assertEquals('Dom 1 Bar', $cachedDom1['LC_MESSAGES']['dom1.bar']);
|
||||||
// dom2 not in cache
|
// dom2 not in cache
|
||||||
$this->assertFalse(Cache::read('dom2_' . $lang, '_cake_core_'));
|
$this->assertFalse(Cache::read('dom2_' . $lang, '_cake_core_'));
|
||||||
|
|
||||||
// translate a item of dom2 (adds dom2 to cache)
|
// 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
|
// verify dom2 was cached through manual read from cache
|
||||||
$cachedDom2 = Cache::read('dom2_' . $lang, '_cake_core_');
|
$cachedDom2 = Cache::read('dom2_' . $lang, '_cake_core_');
|
||||||
$this->assertEqual('Dom 2 Foo', $cachedDom2['LC_MESSAGES']['dom2.foo']);
|
$this->assertEquals('Dom 2 Foo', $cachedDom2['LC_MESSAGES']['dom2.foo']);
|
||||||
$this->assertEqual('Dom 2 Bar', $cachedDom2['LC_MESSAGES']['dom2.bar']);
|
$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
|
// modify cache entry manually to verify that dom1 entries now will be read from cache
|
||||||
$cachedDom1['LC_MESSAGES']['dom1.foo'] = 'FOO';
|
$cachedDom1['LC_MESSAGES']['dom1.foo'] = 'FOO';
|
||||||
Cache::write('dom1_' . $lang, $cachedDom1, '_cake_core_');
|
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() {
|
public function testDefaultStrings() {
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 1', $singular);
|
$this->assertEquals('Plural Rule 1', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 or > 1', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 = 0 or > 1', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 1 (from core)', $coreSingular);
|
$this->assertEquals('Plural Rule 1 (from core)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 or > 1 (from core)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_0_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 0 (translated)', $singular);
|
$this->assertEquals('Plural Rule 0 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 ends with any # (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 ends with any # (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 0 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 0 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 ends with any # (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_0_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 0 (translated)', $singular);
|
$this->assertEquals('Plural Rule 0 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 ends with any # (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 ends with any # (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 0 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 0 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 ends with any # (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_1_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 1 (translated)', $singular);
|
$this->assertEquals('Plural Rule 1 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 or > 1 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 = 0 or > 1 (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 1 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 1 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 or > 1 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_1_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 1 (translated)', $singular);
|
$this->assertEquals('Plural Rule 1 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 or > 1 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 = 0 or > 1 (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 1 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 1 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 or > 1 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_2_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 2 (translated)', $singular);
|
$this->assertEquals('Plural Rule 2 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 or 1 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 > 1 (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 2 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 2 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 or 1 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_2_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 2 (translated)', $singular);
|
$this->assertEquals('Plural Rule 2 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 or 1 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 > 1 (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 2 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 2 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 or 1 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_3_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 3 (translated)', $singular);
|
$this->assertEquals('Plural Rule 3 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 3 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 3 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_3_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 3 (translated)', $singular);
|
$this->assertEquals('Plural Rule 3 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 3 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 3 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_4_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 4 (translated)', $singular);
|
$this->assertEquals('Plural Rule 4 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 4 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 4 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_4_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 4 (translated)', $singular);
|
$this->assertEquals('Plural Rule 4 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 4 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 4 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_5_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 5 (translated)', $singular);
|
$this->assertEquals('Plural Rule 5 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 5 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 5 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_5_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 5 (translated)', $singular);
|
$this->assertEquals('Plural Rule 5 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 5 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 5 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_6_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 6 (translated)', $singular);
|
$this->assertEquals('Plural Rule 6 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 6 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 6 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_6_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 6 (translated)', $singular);
|
$this->assertEquals('Plural Rule 6 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 6 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 6 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_7_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 7 (translated)', $singular);
|
$this->assertEquals('Plural Rule 7 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 7 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 7 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_7_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 7 (translated)', $singular);
|
$this->assertEquals('Plural Rule 7 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 7 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 7 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_8_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 8 (translated)', $singular);
|
$this->assertEquals('Plural Rule 8 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 8 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 8 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_8_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 8 (translated)', $singular);
|
$this->assertEquals('Plural Rule 8 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 8 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 8 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_9_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 9 (translated)', $singular);
|
$this->assertEquals('Plural Rule 9 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 9 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 9 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_9_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 9 (translated)', $singular);
|
$this->assertEquals('Plural Rule 9 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 9 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 9 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_10_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 10 (translated)', $singular);
|
$this->assertEquals('Plural Rule 10 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 10 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 10 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_10_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 10 (translated)', $singular);
|
$this->assertEquals('Plural Rule 10 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 10 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 10 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_11_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 11 (translated)', $singular);
|
$this->assertEquals('Plural Rule 11 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 11 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 11 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_11_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 11 (translated)', $singular);
|
$this->assertEquals('Plural Rule 11 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 11 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 11 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_12_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 12 (translated)', $singular);
|
$this->assertEquals('Plural Rule 12 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 is 0 or 3-10 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 12 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 12 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 is 0 or 3-10 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_12_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 12 (translated)', $singular);
|
$this->assertEquals('Plural Rule 12 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 is 0 or 3-10 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 12 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 12 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 is 0 or 3-10 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_13_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 13 (translated)', $singular);
|
$this->assertEquals('Plural Rule 13 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 is 0 or ends in 01-10 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 13 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 13 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_13_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 13 (translated)', $singular);
|
$this->assertEquals('Plural Rule 13 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 is 0 or ends in 01-10 (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 13 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 13 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_14_po');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 14 (translated)', $singular);
|
$this->assertEquals('Plural Rule 14 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 14 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 14 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$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');
|
Configure::write('Config.language', 'rule_14_mo');
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Plural Rule 14 (translated)', $singular);
|
$this->assertEquals('Plural Rule 14 (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
$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));
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertEqual('Plural Rule 14 (from core translated)', $coreSingular);
|
$this->assertEquals('Plural Rule 14 (from core translated)', $coreSingular);
|
||||||
|
|
||||||
$corePlurals = $this->__pluralFromCore();
|
$corePlurals = $this->__pluralFromCore();
|
||||||
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
||||||
|
@ -2315,7 +2315,7 @@ class I18nTest extends CakeTestCase {
|
||||||
public function testSetLanguageWithSession () {
|
public function testSetLanguageWithSession () {
|
||||||
$_SESSION['Config']['language'] = 'po';
|
$_SESSION['Config']['language'] = 'po';
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Po (translated)', $singular);
|
$this->assertEquals('Po (translated)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__plural();
|
$plurals = $this->__plural();
|
||||||
$this->assertTrue(in_array('0 everything else (po translated)', $plurals));
|
$this->assertTrue(in_array('0 everything else (po translated)', $plurals));
|
||||||
|
@ -2355,7 +2355,7 @@ class I18nTest extends CakeTestCase {
|
||||||
public function testNoCoreTranslation () {
|
public function testNoCoreTranslation () {
|
||||||
Configure::write('Config.language', 'po');
|
Configure::write('Config.language', 'po');
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Po (translated)', $singular);
|
$this->assertEquals('Po (translated)', $singular);
|
||||||
|
|
||||||
$coreSingular = $this->__singularFromCore();
|
$coreSingular = $this->__singularFromCore();
|
||||||
$this->assertNotEquals('Po (from core translated)', $coreSingular);
|
$this->assertNotEquals('Po (from core translated)', $coreSingular);
|
||||||
|
@ -2401,7 +2401,7 @@ class I18nTest extends CakeTestCase {
|
||||||
|
|
||||||
Configure::write('Config.language', 'po');
|
Configure::write('Config.language', 'po');
|
||||||
$singular = $this->__domainSingular();
|
$singular = $this->__domainSingular();
|
||||||
$this->assertEqual('Plural Rule 1 (from plugin)', $singular);
|
$this->assertEquals('Plural Rule 1 (from plugin)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__domainPlural();
|
$plurals = $this->__domainPlural();
|
||||||
$this->assertTrue(in_array('0 = 0 or > 1 (from plugin)', $plurals));
|
$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 .= "broken up over multiple lines.\n";
|
||||||
$expected .= "This is the third line.\n";
|
$expected .= "This is the third line.\n";
|
||||||
$expected .= "This is the forth line. (translated)";
|
$expected .= "This is the forth line. (translated)";
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
// Windows Newline is \r\n
|
// Windows Newline is \r\n
|
||||||
$string = "This is a multiline translation\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 third line.\r\n";
|
||||||
$string .= "This is the forth line.";
|
$string .= "This is the forth line.";
|
||||||
$result = __($string);
|
$result = __($string);
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$singular = "valid\nsecond line";
|
$singular = "valid\nsecond line";
|
||||||
$plural = "valids\nsecond line";
|
$plural = "valids\nsecond line";
|
||||||
|
|
||||||
$result = __n($singular, $plural, 1);
|
$result = __n($singular, $plural, 1);
|
||||||
$expected = "v\nsecond line";
|
$expected = "v\nsecond line";
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = __n($singular, $plural, 2);
|
$result = __n($singular, $plural, 2);
|
||||||
$expected = "vs\nsecond line";
|
$expected = "vs\nsecond line";
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$string = "This is a multiline translation\n";
|
$string = "This is a multiline translation\n";
|
||||||
$string .= "broken up over multiple lines.\n";
|
$string .= "broken up over multiple lines.\n";
|
||||||
|
@ -2481,11 +2481,11 @@ class I18nTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = __n($singular, $plural, 1);
|
$result = __n($singular, $plural, 1);
|
||||||
$expected = "%d is 1\n" . $string;
|
$expected = "%d is 1\n" . $string;
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = __n($singular, $plural, 2);
|
$result = __n($singular, $plural, 2);
|
||||||
$expected = "%d is 2-4\n" . $string;
|
$expected = "%d is 2-4\n" . $string;
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
// Windows Newline is \r\n
|
// Windows Newline is \r\n
|
||||||
$string = "This is a multiline translation\r\n";
|
$string = "This is a multiline translation\r\n";
|
||||||
|
@ -2498,11 +2498,11 @@ class I18nTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = __n($singular, $plural, 1);
|
$result = __n($singular, $plural, 1);
|
||||||
$expected = "%d is 1\n" . str_replace("\r\n", "\n", $string);
|
$expected = "%d is 1\n" . str_replace("\r\n", "\n", $string);
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = __n($singular, $plural, 2);
|
$result = __n($singular, $plural, 2);
|
||||||
$expected = "%d is 2-4\n" . str_replace("\r\n", "\n", $string);
|
$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 () {
|
public function testPoNoTranslationNeeded () {
|
||||||
Configure::write('Config.language', 'po');
|
Configure::write('Config.language', 'po');
|
||||||
$result = __('No Translation needed');
|
$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 () {
|
public function testPoQuotedString () {
|
||||||
$expected = 'this is a "quoted string" (translated)';
|
$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);
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)1);
|
||||||
$expected = '%d is 1 (translated)';
|
$expected = '%d is 1 (translated)';
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = __n('%d = 1', '%d = 0 or > 1', (float)2);
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)2);
|
||||||
$expected = "%d ends in 2-4, not 12-14 (translated)";
|
$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);
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)5);
|
||||||
$expected = "%d everything else (translated)";
|
$expected = "%d everything else (translated)";
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2555,7 +2555,7 @@ class I18nTest extends CakeTestCase {
|
||||||
public function testCategory() {
|
public function testCategory() {
|
||||||
Configure::write('Config.language', 'po');
|
Configure::write('Config.language', 'po');
|
||||||
$category = $this->__category();
|
$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');
|
Configure::write('Config.language', 'po');
|
||||||
|
|
||||||
$singular = $this->__domainCategorySingular();
|
$singular = $this->__domainCategorySingular();
|
||||||
$this->assertEqual('Monetary Plural Rule 1 (from plugin)', $singular);
|
$this->assertEquals('Monetary Plural Rule 1 (from plugin)', $singular);
|
||||||
|
|
||||||
$plurals = $this->__domainCategoryPlural();
|
$plurals = $this->__domainCategoryPlural();
|
||||||
$this->assertTrue(in_array('Monetary 0 = 0 or > 1 (from plugin)', $plurals));
|
$this->assertTrue(in_array('Monetary 0 = 0 or > 1 (from plugin)', $plurals));
|
||||||
|
@ -2582,25 +2582,25 @@ class I18nTest extends CakeTestCase {
|
||||||
public function testCategoryThenSingular() {
|
public function testCategoryThenSingular() {
|
||||||
Configure::write('Config.language', 'po');
|
Configure::write('Config.language', 'po');
|
||||||
$category = $this->__category();
|
$category = $this->__category();
|
||||||
$this->assertEqual('Monetary Po (translated)', $category);
|
$this->assertEquals('Monetary Po (translated)', $category);
|
||||||
|
|
||||||
$singular = $this->__singular();
|
$singular = $this->__singular();
|
||||||
$this->assertEqual('Po (translated)', $singular);
|
$this->assertEquals('Po (translated)', $singular);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTimeDefinition() {
|
public function testTimeDefinition() {
|
||||||
Configure::write('Config.language', 'po');
|
Configure::write('Config.language', 'po');
|
||||||
$result = __c('d_fmt', 5);
|
$result = __c('d_fmt', 5);
|
||||||
$expected = '%m/%d/%Y';
|
$expected = '%m/%d/%Y';
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = __c('am_pm', 5);
|
$result = __c('am_pm', 5);
|
||||||
$expected = array('AM', 'PM');
|
$expected = array('AM', 'PM');
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = __c('abmon', 5);
|
$result = __c('abmon', 5);
|
||||||
$expected = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
|
$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(){
|
public function testTimeDefinitionJapanese(){
|
||||||
|
@ -2609,15 +2609,15 @@ class I18nTest extends CakeTestCase {
|
||||||
|
|
||||||
$expected = "%Y年%m月%d日";
|
$expected = "%Y年%m月%d日";
|
||||||
|
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = __c('am_pm', 5);
|
$result = __c('am_pm', 5);
|
||||||
$expected = array("午前", "午後");
|
$expected = array("午前", "午後");
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = __c('abmon', 5);
|
$result = __c('abmon', 5);
|
||||||
$expected = array(" 1月", " 2月", " 3月", " 4月", " 5月", " 6月", " 7月", " 8月", " 9月", "10月", "11月", "12月");
|
$expected = array(" 1月", " 2月", " 3月", " 4月", " 5月", " 6月", " 7月", " 8月", " 9月", "10月", "11月", "12月");
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7560,7 +7560,7 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'2' => 'Second Post',
|
'2' => 'Second Post',
|
||||||
'1' => 'First Post'
|
'1' => 'First Post'
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEquals($result, $expected);
|
||||||
|
|
||||||
$result = $Post->find('list', array('order' => array('Post.other_field' => 'DESC')));
|
$result = $Post->find('list', array('order' => array('Post.other_field' => 'DESC')));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -7568,23 +7568,23 @@ class ModelReadTest extends BaseModelTest {
|
||||||
'2' => 'Second Post',
|
'2' => 'Second Post',
|
||||||
'3' => 'Third Post'
|
'3' => 'Third Post'
|
||||||
);
|
);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEquals($result, $expected);
|
||||||
|
|
||||||
$Post->Author->virtualFields = array('joined' => 'Post.id * Author.id');
|
$Post->Author->virtualFields = array('joined' => 'Post.id * Author.id');
|
||||||
$result = $Post->find('all');
|
$result = $Post->find('all');
|
||||||
$result = Set::extract('{n}.Author.joined', $result);
|
$result = Set::extract('{n}.Author.joined', $result);
|
||||||
$expected = array(1, 6, 3);
|
$expected = array(1, 6, 3);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEquals($result, $expected);
|
||||||
|
|
||||||
$result = $Post->find('all', array('order' => array('Author.joined' => 'ASC')));
|
$result = $Post->find('all', array('order' => array('Author.joined' => 'ASC')));
|
||||||
$result = Set::extract('{n}.Author.joined', $result);
|
$result = Set::extract('{n}.Author.joined', $result);
|
||||||
$expected = array(1, 3, 6);
|
$expected = array(1, 3, 6);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEquals($result, $expected);
|
||||||
|
|
||||||
$result = $Post->find('all', array('order' => array('Author.joined' => 'DESC')));
|
$result = $Post->find('all', array('order' => array('Author.joined' => 'DESC')));
|
||||||
$result = Set::extract('{n}.Author.joined', $result);
|
$result = Set::extract('{n}.Author.joined', $result);
|
||||||
$expected = array(6, 3, 1);
|
$expected = array(6, 3, 1);
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEquals($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3550,7 +3550,6 @@ class ModelWriteTest extends BaseModelTest {
|
||||||
'title' => '',
|
'title' => '',
|
||||||
'body' => 'Trying to get away with an empty 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));
|
$result = $TestModel->saveAll($data, array('validate' => true, 'atomic' => false));
|
||||||
$this->assertEquals($result, array(true, false));
|
$this->assertEquals($result, array(true, false));
|
||||||
$result = $TestModel->find('all', array('recursive' => -1, 'order' => 'Post.id ASC'));
|
$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[0]['Post']['updated'] >= $ts);
|
||||||
$this->assertTrue($result[1]['Post']['updated'] >= $newTs);
|
$this->assertTrue($result[1]['Post']['updated'] >= $ts);
|
||||||
$this->assertTrue($result[3]['Post']['updated'] >= $newTs);
|
$this->assertTrue($result[3]['Post']['updated'] >= $ts);
|
||||||
$this->assertTrue($result[3]['Post']['created'] >= $newTs);
|
$this->assertTrue($result[3]['Post']['created'] >= $ts);
|
||||||
unset(
|
unset(
|
||||||
$result[0]['Post']['updated'], $result[1]['Post']['updated'],
|
$result[0]['Post']['updated'], $result[1]['Post']['updated'],
|
||||||
$result[3]['Post']['updated'], $result[3]['Post']['created']
|
$result[3]['Post']['updated'], $result[3]['Post']['created']
|
||||||
|
|
|
@ -606,7 +606,7 @@ class CakeRouteTest extends CakeTestCase {
|
||||||
'fish' => 'trout'
|
'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');
|
$result = $route->parse('/comments/index/wibble:spin/fish:trout/fizz:buzz');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -665,6 +665,19 @@ class CakeRouteTest extends CakeTestCase {
|
||||||
$this->assertEquals($expected, $result, 'Greedy named grabs everything, rules are followed');
|
$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
|
* test that parsing array format named parameters works
|
||||||
*
|
*
|
||||||
|
|
|
@ -960,6 +960,21 @@ class FormHelperTest extends CakeTestCase {
|
||||||
$this->assertTags($result, $expected);
|
$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.
|
* Test that the correct fields are unlocked for image submits with no names.
|
||||||
*
|
*
|
||||||
|
|
|
@ -751,6 +751,7 @@ class TimeHelperTest extends CakeTestCase {
|
||||||
'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
|
'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
|
||||||
), true);
|
), true);
|
||||||
Configure::write('Config.language', 'time_test');
|
Configure::write('Config.language', 'time_test');
|
||||||
|
|
||||||
$time = strtotime('Thu Jan 14 13:59:28 2010');
|
$time = strtotime('Thu Jan 14 13:59:28 2010');
|
||||||
|
|
||||||
$result = $this->Time->i18nFormat($time);
|
$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';
|
$expected = 'Time is 01:59:28 PM, and date is 14/01/10';
|
||||||
$this->assertEquals($expected, $result);
|
$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');
|
$result = $this->Time->i18nFormat('invalid date', '%x', 'Date invalid');
|
||||||
$expected = 'Date invalid';
|
$expected = 'Date invalid';
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
|
@ -34,6 +34,7 @@ class File {
|
||||||
* Folder object of the File
|
* Folder object of the File
|
||||||
*
|
*
|
||||||
* @var Folder
|
* @var Folder
|
||||||
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$Folder
|
||||||
*/
|
*/
|
||||||
public $Folder = null;
|
public $Folder = null;
|
||||||
|
|
||||||
|
@ -41,13 +42,15 @@ class File {
|
||||||
* Filename
|
* Filename
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
|
* http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$name
|
||||||
*/
|
*/
|
||||||
public $name = null;
|
public $name = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File info
|
* File info
|
||||||
*
|
*
|
||||||
* @var string
|
* @var array
|
||||||
|
* http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$info
|
||||||
*/
|
*/
|
||||||
public $info = array();
|
public $info = array();
|
||||||
|
|
||||||
|
@ -55,6 +58,7 @@ class File {
|
||||||
* Holds the file handler resource if the file is opened
|
* Holds the file handler resource if the file is opened
|
||||||
*
|
*
|
||||||
* @var resource
|
* @var resource
|
||||||
|
* http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$handle
|
||||||
*/
|
*/
|
||||||
public $handle = null;
|
public $handle = null;
|
||||||
|
|
||||||
|
@ -62,6 +66,7 @@ class File {
|
||||||
* Enable locking for file reading and writing
|
* Enable locking for file reading and writing
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
|
* http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$lock
|
||||||
*/
|
*/
|
||||||
public $lock = null;
|
public $lock = null;
|
||||||
|
|
||||||
|
@ -71,6 +76,7 @@ class File {
|
||||||
* Current file's absolute path
|
* Current file's absolute path
|
||||||
*
|
*
|
||||||
* @var mixed null
|
* @var mixed null
|
||||||
|
* http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#File::$path
|
||||||
*/
|
*/
|
||||||
public $path = null;
|
public $path = null;
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ class Folder {
|
||||||
* Path to Folder.
|
* Path to Folder.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::$path
|
||||||
*/
|
*/
|
||||||
public $path = null;
|
public $path = null;
|
||||||
|
|
||||||
|
@ -37,6 +38,7 @@ class Folder {
|
||||||
* should be sorted by name.
|
* should be sorted by name.
|
||||||
*
|
*
|
||||||
* @var boolean
|
* @var boolean
|
||||||
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::$sort
|
||||||
*/
|
*/
|
||||||
public $sort = false;
|
public $sort = false;
|
||||||
|
|
||||||
|
@ -44,6 +46,7 @@ class Folder {
|
||||||
* Mode to be used on create. Does nothing on windows platforms.
|
* Mode to be used on create. Does nothing on windows platforms.
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
|
* http://book.cakephp.org/2.0/en/core-utility-libraries/file-folder.html#Folder::$mode
|
||||||
*/
|
*/
|
||||||
public $mode = 0755;
|
public $mode = 0755;
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ class Set {
|
||||||
* @param array $arr1 Array to be merged
|
* @param array $arr1 Array to be merged
|
||||||
* @param array $arr2 Array to merge with
|
* @param array $arr2 Array to merge with
|
||||||
* @return array Merged array
|
* @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) {
|
public static function merge($arr1, $arr2 = null) {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
@ -61,6 +62,7 @@ class Set {
|
||||||
*
|
*
|
||||||
* @param array $var Either an array to filter, or value when in callback
|
* @param array $var Either an array to filter, or value when in callback
|
||||||
* @return mixed Either filtered array, or true/false 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) {
|
public static function filter(array $var) {
|
||||||
foreach ($var as $k => $v) {
|
foreach ($var as $k => $v) {
|
||||||
|
@ -90,6 +92,7 @@ class Set {
|
||||||
* @param mixed $array Original array
|
* @param mixed $array Original array
|
||||||
* @param mixed $array2 Differences to push
|
* @param mixed $array2 Differences to push
|
||||||
* @return array Combined array
|
* @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) {
|
public static function pushDiff($array, $array2) {
|
||||||
if (empty($array) && !empty($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 $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
|
* @param string $tmp A temporary class name used as $class if $class is an array
|
||||||
* @return object Hierarchical object
|
* @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') {
|
public static function map($class = 'stdClass', $tmp = 'stdClass') {
|
||||||
if (is_array($class)) {
|
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
|
* @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
|
* @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) {
|
public static function numeric($array = null) {
|
||||||
if (empty($array)) {
|
if (empty($array)) {
|
||||||
|
@ -238,6 +243,7 @@ class Set {
|
||||||
* @param mixed $select Key in $list to return
|
* @param mixed $select Key in $list to return
|
||||||
* @param mixed $list can be an array or a comma-separated list.
|
* @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
|
* @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) {
|
public static function enum($select, $list = null) {
|
||||||
if (empty($list)) {
|
if (empty($list)) {
|
||||||
|
@ -260,6 +266,7 @@ class Set {
|
||||||
* @param string $format Format string into which values will be inserted, see sprintf()
|
* @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
|
* @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
|
* @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) {
|
public static function format($data, $format, $keys) {
|
||||||
$extracted = array();
|
$extracted = array();
|
||||||
|
@ -338,6 +345,7 @@ class Set {
|
||||||
* @param array $data An array of data to extract from
|
* @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
|
* @param array $options Currently only supports 'flatten' which can be disabled for higher XPath-ness
|
||||||
* @return array An array of matched items
|
* @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()) {
|
public static function extract($path, $data = null, $options = array()) {
|
||||||
if (is_string($data)) {
|
if (is_string($data)) {
|
||||||
|
@ -488,6 +496,7 @@ class Set {
|
||||||
* @param integer $i Optional: The 'nth'-number of the item being matched.
|
* @param integer $i Optional: The 'nth'-number of the item being matched.
|
||||||
* @param integer $length
|
* @param integer $length
|
||||||
* @return boolean
|
* @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) {
|
public static function matches($conditions, $data = array(), $i = null, $length = null) {
|
||||||
if (empty($conditions)) {
|
if (empty($conditions)) {
|
||||||
|
@ -561,6 +570,7 @@ class Set {
|
||||||
* @param array $data Array from where to extract
|
* @param array $data Array from where to extract
|
||||||
* @param mixed $path As an array, or as a dot-separated string.
|
* @param mixed $path As an array, or as a dot-separated string.
|
||||||
* @return array Extracted data
|
* @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) {
|
public static function classicExtract($data, $path = null) {
|
||||||
if (empty($path)) {
|
if (empty($path)) {
|
||||||
|
@ -648,6 +658,7 @@ class Set {
|
||||||
* @param mixed $path A dot-separated string.
|
* @param mixed $path A dot-separated string.
|
||||||
* @param array $data Data to insert
|
* @param array $data Data to insert
|
||||||
* @return array
|
* @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) {
|
public static function insert($list, $path, $data = null) {
|
||||||
if (!is_array($path)) {
|
if (!is_array($path)) {
|
||||||
|
@ -678,6 +689,7 @@ class Set {
|
||||||
* @param mixed $list From where to remove
|
* @param mixed $list From where to remove
|
||||||
* @param mixed $path A dot-separated string.
|
* @param mixed $path A dot-separated string.
|
||||||
* @return array Array with $path removed from its value
|
* @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) {
|
public static function remove($list, $path = null) {
|
||||||
if (empty($path)) {
|
if (empty($path)) {
|
||||||
|
@ -710,6 +722,7 @@ class Set {
|
||||||
* @param mixed $data Data to check on
|
* @param mixed $data Data to check on
|
||||||
* @param mixed $path A dot-separated string.
|
* @param mixed $path A dot-separated string.
|
||||||
* @return boolean true if path is found, false otherwise
|
* @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) {
|
public static function check($data, $path = null) {
|
||||||
if (empty($path)) {
|
if (empty($path)) {
|
||||||
|
@ -742,6 +755,7 @@ class Set {
|
||||||
* @param mixed $val2 Second value
|
* @param mixed $val2 Second value
|
||||||
* @return array Returns the key => value pairs that are not common in $val1 and $val2
|
* @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))
|
* 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) {
|
public static function diff($val1, $val2 = null) {
|
||||||
if (empty($val1)) {
|
if (empty($val1)) {
|
||||||
|
@ -768,6 +782,7 @@ class Set {
|
||||||
* @param array $val1 First value
|
* @param array $val1 First value
|
||||||
* @param array $val2 Second value
|
* @param array $val2 Second value
|
||||||
* @return boolean true if $val1 contains $val2, false otherwise
|
* @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) {
|
public static function contains($val1, $val2 = null) {
|
||||||
if (empty($val1) || empty($val2)) {
|
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 boolean $all Set to true to count the dimension considering all elements in array
|
||||||
* @param integer $count Start the dimension count at this number
|
* @param integer $count Start the dimension count at this number
|
||||||
* @return integer The number of dimensions in $array
|
* @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) {
|
public static function countDim($array = null, $all = false, $count = 0) {
|
||||||
if ($all) {
|
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 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
|
* @param boolean $trim If true, separated strings will be trimmed
|
||||||
* @return array
|
* @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) {
|
public static function normalize($list, $assoc = true, $sep = ',', $trim = true) {
|
||||||
if (is_string($list)) {
|
if (is_string($list)) {
|
||||||
|
@ -873,6 +890,7 @@ class Set {
|
||||||
* @param mixed $path2 As an array, or as a dot-separated string.
|
* @param mixed $path2 As an array, or as a dot-separated string.
|
||||||
* @param string $groupPath 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
|
* @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) {
|
public static function combine($data, $path1 = null, $path2 = null, $groupPath = null) {
|
||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
|
@ -933,6 +951,7 @@ class Set {
|
||||||
* Converts an object into an array.
|
* Converts an object into an array.
|
||||||
* @param object $object Object to reverse
|
* @param object $object Object to reverse
|
||||||
* @return array Array representation of given object
|
* @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) {
|
public static function reverse($object) {
|
||||||
$out = array();
|
$out = array();
|
||||||
|
@ -979,6 +998,7 @@ class Set {
|
||||||
* @param array $data Array to flatten
|
* @param array $data Array to flatten
|
||||||
* @param string $separator String used to separate array key elements in a path, defaults to '.'
|
* @param string $separator String used to separate array key elements in a path, defaults to '.'
|
||||||
* @return array
|
* @return array
|
||||||
|
* @link http://book.cakephp.org/2.0/en/core-utility-libraries/set.html#Set::flatten
|
||||||
*/
|
*/
|
||||||
public static function flatten($data, $separator = '.') {
|
public static function flatten($data, $separator = '.') {
|
||||||
$result = array();
|
$result = array();
|
||||||
|
@ -1035,6 +1055,7 @@ class Set {
|
||||||
* @param string $path A Set-compatible path to the array value
|
* @param string $path A Set-compatible path to the array value
|
||||||
* @param string $dir Direction of sorting - either ascending (ASC), or descending (DESC)
|
* @param string $dir Direction of sorting - either ascending (ASC), or descending (DESC)
|
||||||
* @return array Sorted array of data
|
* @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) {
|
public static function sort($data, $path, $dir) {
|
||||||
$originalKeys = array_keys($data);
|
$originalKeys = array_keys($data);
|
||||||
|
@ -1074,6 +1095,7 @@ class Set {
|
||||||
* to array_map, reduce will handoff to array_reduce, and pass will
|
* to array_map, reduce will handoff to array_reduce, and pass will
|
||||||
* use call_user_func_array().
|
* use call_user_func_array().
|
||||||
* @return mixed Result of the callback when applied to extracted data
|
* @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()) {
|
public static function apply($path, $data, $callback, $options = array()) {
|
||||||
$defaults = array('type' => 'pass');
|
$defaults = array('type' => 'pass');
|
||||||
|
|
|
@ -591,7 +591,7 @@ class FormHelper extends AppHelper {
|
||||||
*
|
*
|
||||||
* @param boolean $lock Whether this field should be part of the validation
|
* @param boolean $lock Whether this field should be part of the validation
|
||||||
* or excluded as part of the unlockedFields.
|
* 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.
|
* @param mixed $value Field value, if value should not be tampered with.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -1466,7 +1466,8 @@ class FormHelper extends AppHelper {
|
||||||
$title = h($title);
|
$title = h($title);
|
||||||
}
|
}
|
||||||
if (isset($options['name'])) {
|
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);
|
return $this->Html->useTag('button', $options['type'], array_diff_key($options, array('type' => '')), $title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
* @since CakePHP(tm) v 0.10.0.1076
|
* @since CakePHP(tm) v 0.10.0.1076
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
if (!class_exists('Multibyte')) {
|
||||||
|
App::import('Core', 'Multibyte');
|
||||||
|
}
|
||||||
|
|
||||||
App::uses('AppHelper', 'View/Helper');
|
App::uses('AppHelper', 'View/Helper');
|
||||||
|
|
||||||
|
@ -241,7 +244,7 @@ class TimeHelper extends AppHelper {
|
||||||
$format = $this->niceFormat;
|
$format = $this->niceFormat;
|
||||||
}
|
}
|
||||||
$format = $this->convertSpecifiers($format, $date);
|
$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';
|
$y = $this->isThisYear($date) ? '' : ' %Y';
|
||||||
|
|
||||||
if ($this->isToday($dateString, $userOffset)) {
|
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)) {
|
} 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 {
|
} else {
|
||||||
$format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date);
|
$format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date);
|
||||||
$ret = strftime($format, $date);
|
$ret = $this->_strftime($format, $date);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -748,6 +751,32 @@ class TimeHelper extends AppHelper {
|
||||||
$format = '%x';
|
$format = '%x';
|
||||||
}
|
}
|
||||||
$format = $this->convertSpecifiers($format, $date);
|
$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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,12 +92,10 @@ function debug($var = false, $showHtml = null, $showFrom = true) {
|
||||||
</div>
|
</div>
|
||||||
HTML;
|
HTML;
|
||||||
$text = <<<TEXT
|
$text = <<<TEXT
|
||||||
|
|
||||||
%s
|
%s
|
||||||
########## DEBUG ##########
|
########## DEBUG ##########
|
||||||
%s
|
%s
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
TEXT;
|
TEXT;
|
||||||
$template = $html;
|
$template = $html;
|
||||||
if (php_sapi_name() == 'cli' || $showHtml === false) {
|
if (php_sapi_name() == 'cli' || $showHtml === false) {
|
||||||
|
|
Loading…
Reference in a new issue