From dfe54e90d6b77f56a9b98a59817f5c70e02f9d40 Mon Sep 17 00:00:00 2001 From: Schlaefer Date: Thu, 1 Nov 2012 15:47:50 +0100 Subject: [PATCH 1/4] =?UTF-8?q?removed=20Inflictor::slug()replacement=20fr?= =?UTF-8?q?om=20=C3=84=20to=20A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The slug replacement for Ä -> A is not necessary, because the better replacement Ä -> Ae is already defined and also covered by the test case. --- lib/Cake/Utility/Inflector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php index 47c5914821d..b724d421818 100644 --- a/lib/Cake/Utility/Inflector.php +++ b/lib/Cake/Utility/Inflector.php @@ -177,7 +177,7 @@ class Inflector { '/Ä/' => 'Ae', '/Ü/' => 'Ue', '/Ö/' => 'Oe', - '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', + '/À|Á|Â|Ã|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', '/ç|ć|ĉ|ċ|č/' => 'c', From cc6b699db4fe729542ae06447b9c2f8d9a738e98 Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 2 Nov 2012 01:55:37 +0530 Subject: [PATCH 2/4] Added missing App::uses() statement. Closes #3331 --- lib/Cake/Controller/CakeErrorController.php | 2 ++ lib/Cake/Error/ExceptionRenderer.php | 5 ++--- lib/Cake/Test/Case/Error/ExceptionRendererTest.php | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Controller/CakeErrorController.php b/lib/Cake/Controller/CakeErrorController.php index 3bcbd72cec8..c1835fd6eb0 100644 --- a/lib/Cake/Controller/CakeErrorController.php +++ b/lib/Cake/Controller/CakeErrorController.php @@ -19,6 +19,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppController', 'Controller'); + /** * Error Handling Controller * diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index a404d3be845..3be08d26cd6 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -142,15 +142,14 @@ public function __construct(Exception $exception) { * @return Controller */ protected function _getController($exception) { + App::uses('AppController', 'Controller'); App::uses('CakeErrorController', 'Controller'); if (!$request = Router::getRequest(true)) { $request = new CakeRequest(); } $response = new CakeResponse(array('charset' => Configure::read('App.encoding'))); try { - if (class_exists('AppController')) { - $controller = new CakeErrorController($request, $response); - } + $controller = new CakeErrorController($request, $response); } catch (Exception $e) { } if (empty($controller)) { diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php index a5704433be4..d11c664135e 100644 --- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php +++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php @@ -19,7 +19,6 @@ App::uses('ExceptionRenderer', 'Error'); App::uses('Controller', 'Controller'); -App::uses('AppController', 'Controller'); App::uses('Component', 'Controller'); App::uses('Router', 'Routing'); From ddd3baf7038e146cc1008481cce07545d3c5d529 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 1 Nov 2012 21:07:29 -0400 Subject: [PATCH 3/4] Fix null column errors in SQLite and Postgres. --- .../Case/Model/Behavior/TreeBehaviorScopedTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Test/Case/Model/Behavior/TreeBehaviorScopedTest.php b/lib/Cake/Test/Case/Model/Behavior/TreeBehaviorScopedTest.php index 9f505638752..66adac3e5c3 100644 --- a/lib/Cake/Test/Case/Model/Behavior/TreeBehaviorScopedTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/TreeBehaviorScopedTest.php @@ -175,6 +175,7 @@ public function testTranslatingTree() { $this->Tree->locale = 'eng'; $data = array('FlagTree' => array( 'title' => 'name #1', + 'name' => 'test', 'locale' => 'eng', 'parent_id' => null, )); @@ -183,7 +184,7 @@ public function testTranslatingTree() { $expected = array(array('FlagTree' => array( 'id' => 1, 'title' => 'name #1', - 'name' => '', + 'name' => 'test', 'parent_id' => null, 'lft' => 1, 'rght' => 2, @@ -201,7 +202,7 @@ public function testTranslatingTree() { $expected = array(array('FlagTree' => array( 'id' => 1, 'title' => 'Named 2', - 'name' => '', + 'name' => 'test', 'parent_id' => null, 'lft' => 1, 'rght' => 2, @@ -218,6 +219,7 @@ public function testTranslatingTree() { 'id' => 1, 'parent_id' => null, 'title' => 'namen #1', + 'name' => 'test', 'locale' => 'deu', )); $this->Tree->save($data); @@ -229,7 +231,7 @@ public function testTranslatingTree() { 'FlagTree' => array( 'id' => 1, 'title' => 'namen #1', - 'name' => '', + 'name' => 'test', 'parent_id' => null, 'lft' => 1, 'rght' => 2, @@ -244,6 +246,7 @@ public function testTranslatingTree() { $this->Tree->locale = 'eng'; $data = array( 'title' => array('eng' => 'New title', 'spa' => 'Nuevo leyenda'), + 'name' => 'test', 'parent_id' => null ); $this->Tree->create($data); @@ -260,7 +263,7 @@ public function testTranslatingTree() { 'id' => 2, 'parent_id' => null, 'locale' => 'eng', - 'name' => '', + 'name' => 'test', 'title' => 'New title', 'flag' => 0, 'lft' => 3, From 118dd8c534b6d8be0f45352577f6967ca63a8249 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 1 Nov 2012 21:36:14 -0400 Subject: [PATCH 4/4] Make fragile test less fragile. --- lib/Cake/Test/Case/View/MediaViewTest.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Test/Case/View/MediaViewTest.php b/lib/Cake/Test/Case/View/MediaViewTest.php index 3b723c0bfea..8660a119b40 100644 --- a/lib/Cake/Test/Case/View/MediaViewTest.php +++ b/lib/Cake/Test/Case/View/MediaViewTest.php @@ -132,11 +132,14 @@ public function testRenderWithUnknownFileTypeGeneric() { $this->MediaView->response->expects($this->at(1)) ->method('header') - ->with(array( - 'Date' => gmdate('D, d M Y H:i:s', time()) . ' GMT', - 'Expires' => '0', - 'Cache-Control' => 'private, must-revalidate, post-check=0, pre-check=0', - 'Pragma' => 'no-cache' + ->with($this->logicalAnd( + $this->arrayHasKey('Date'), + $this->arrayHasKey('Expires'), + $this->arrayHasKey('Cache-Control'), + $this->arrayHasKey('Pragma'), + $this->contains('0'), + $this->contains('private, must-revalidate, post-check=0, pre-check=0'), + $this->contains('no-cache') )); $this->MediaView->response->expects($this->once())