From 827c815cf1a6e33fe041f5d4b62ce8f0dd7f92ec Mon Sep 17 00:00:00 2001 From: joostdekeijzer Date: Wed, 29 Jan 2014 12:25:09 +0100 Subject: [PATCH 1/5] correct property comment --- lib/Cake/Test/Case/Model/models.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Model/models.php b/lib/Cake/Test/Case/Model/models.php index 43614a482..d1cf7de8d 100644 --- a/lib/Cake/Test/Case/Model/models.php +++ b/lib/Cake/Test/Case/Model/models.php @@ -3258,7 +3258,7 @@ class TranslatedArticle extends CakeTestModel { public $belongsTo = array('User'); /** - * belongsTo property + * hasMany property * * @var array */ From 987187ef8ce387ff460c9a06337ee2709897c97c Mon Sep 17 00:00:00 2001 From: joostdekeijzer Date: Wed, 29 Jan 2014 11:29:51 +0100 Subject: [PATCH 2/5] Fix #2721 in TranslateBehavior::beforeFind() supporting both Model::field('fieldname') and Model::read('fieldname') --- lib/Cake/Model/Behavior/TranslateBehavior.php | 2 ++ .../Model/Behavior/TranslateBehaviorTest.php | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/lib/Cake/Model/Behavior/TranslateBehavior.php b/lib/Cake/Model/Behavior/TranslateBehavior.php index 82800818a..154f52c59 100644 --- a/lib/Cake/Model/Behavior/TranslateBehavior.php +++ b/lib/Cake/Model/Behavior/TranslateBehavior.php @@ -139,6 +139,8 @@ class TranslateBehavior extends ModelBehavior { } unset($this->_joinTable, $this->_runtimeModel); return $query; + } elseif (is_string($query['fields'])) { + $query['fields'] = String::tokenize($query['fields']); } $fields = array_merge( diff --git a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php index 626376017..6c9fcdffb 100644 --- a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php @@ -232,6 +232,32 @@ class TranslateBehaviorTest extends CakeTestCase { ) ); $this->assertEquals($expected, $result); + + $result = $TestModel->field('title', array('TranslatedItem.id' => 1)); + $expected = 'Title #1'; + $this->assertEquals($expected, $result); + + $result = $TestModel->read('title', 1); + $expected = array( + 'TranslatedItem' => array( + 'id' => 1, + 'slug' => 'first_translated', + 'locale' => 'eng', + 'title' => 'Title #1', + 'translated_article_id' => 1, + ) + ); + $this->assertEquals($expected, $result); + + $result = $TestModel->read('id, title', 1); + $expected = array( + 'TranslatedItem' => array( + 'id' => 1, + 'locale' => 'eng', + 'title' => 'Title #1', + ) + ); + $this->assertEquals($expected, $result); } /** From 42daa25340564df3019e607fce9d1bbcdaec0f2a Mon Sep 17 00:00:00 2001 From: joostdekeijzer Date: Wed, 29 Jan 2014 12:59:49 +0100 Subject: [PATCH 3/5] Fix Console "extract i18n from sources" to handle quotes in Model::validate parameters correctly --- lib/Cake/Console/Command/Task/ExtractTask.php | 1 + .../Console/Command/Task/ExtractTaskTest.php | 3 ++ lib/Cake/Test/test_app/Model/Extract.php | 45 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 lib/Cake/Test/test_app/Model/Extract.php diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index 2c547ed82..608e091ee 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -525,6 +525,7 @@ class ExtractTask extends AppShell { $msgid = $rule; } if ($msgid) { + $msgid = $this->_formatString(sprintf("'%s'", $msgid)); $details = array( 'file' => $file, 'line' => 'validation for field ' . $field diff --git a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php index f157575be..e93a31eb4 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php @@ -351,6 +351,9 @@ class ExtractTaskTest extends CakeTestCase { $pattern = '#msgid "Post body is super required"#'; $this->assertRegExp($pattern, $result); + + $this->assertContains('msgid "double \\"quoted\\" validation"', $result, 'Strings with quotes not handled correctly'); + $this->assertContains("msgid \"single 'quoted' validation\"", $result, 'Strings with quotes not handled correctly'); } /** diff --git a/lib/Cake/Test/test_app/Model/Extract.php b/lib/Cake/Test/test_app/Model/Extract.php new file mode 100644 index 000000000..0cd7218c4 --- /dev/null +++ b/lib/Cake/Test/test_app/Model/Extract.php @@ -0,0 +1,45 @@ + array( + 'custom' => array( + 'rule' => array('custom', '.*'), + 'allowEmpty' => true, + 'required' => false, + 'message' => 'double "quoted" validation' + ), + 'between' => array( + 'rule' => array('between', 5, 15), + 'message' => "single 'quoted' validation" + ) + ), + ); + +} From df2fc07940f82e564bd068c3a7a37ae9b8b8238e Mon Sep 17 00:00:00 2001 From: Walker Hamilton Date: Wed, 29 Jan 2014 11:51:29 -0600 Subject: [PATCH 4/5] Grammatical fix in API docs only Grammatical fix in API docs only reset --- lib/Cake/Network/Http/HttpSocket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Network/Http/HttpSocket.php b/lib/Cake/Network/Http/HttpSocket.php index fa863f902..46fde7d7f 100644 --- a/lib/Cake/Network/Http/HttpSocket.php +++ b/lib/Cake/Network/Http/HttpSocket.php @@ -1012,7 +1012,7 @@ class HttpSocket extends CakeSocket { * Resets the state of this HttpSocket instance to it's initial state (before Object::__construct got executed) or does * the same thing partially for the request and the response property only. * - * @param boolean $full If set to false only HttpSocket::response and HttpSocket::request are reseted + * @param boolean $full If set to false only HttpSocket::response and HttpSocket::request are reset * @return boolean True on success */ public function reset($full = true) { From e5b36f696dca816a0e1c0ac3c5f6af7cfebfeb3b Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 29 Jan 2014 20:39:32 -0500 Subject: [PATCH 5/5] Actually exclude core test cases from pear packages. Refs #2620 --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index d36dbb381..82ee704d7 100644 --- a/build.xml +++ b/build.xml @@ -29,7 +29,7 @@ - +