From e7d2892e8193ee787279122bf0c0ab3cf5157e28 Mon Sep 17 00:00:00 2001 From: Rik van der Heijden Date: Tue, 11 Jun 2013 20:03:05 +0200 Subject: [PATCH] Fixed unit-test locales --- lib/Cake/Test/Case/Controller/ControllerTest.php | 1 + lib/Cake/Test/Case/Controller/ScaffoldTest.php | 1 + lib/Cake/Test/Case/Error/ExceptionRendererTest.php | 1 + .../Test/Case/Model/Behavior/TranslateBehaviorTest.php | 1 + lib/Cake/Test/Case/Model/ModelValidationTest.php | 10 ++++++++++ lib/Cake/Test/Case/Model/ModelWriteTest.php | 10 ++++++++++ .../Case/Model/Validator/CakeValidationSetTest.php | 10 ++++++++++ lib/Cake/Test/Case/View/Helper/FormHelperTest.php | 1 + lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php | 1 + 9 files changed, 36 insertions(+) diff --git a/lib/Cake/Test/Case/Controller/ControllerTest.php b/lib/Cake/Test/Case/Controller/ControllerTest.php index 7c0e76db9..7e9aad5ce 100644 --- a/lib/Cake/Test/Case/Controller/ControllerTest.php +++ b/lib/Cake/Test/Case/Controller/ControllerTest.php @@ -1080,6 +1080,7 @@ class ControllerTest extends CakeTestCase { * @return void */ public function testValidateErrorsOnArbitraryModels() { + Configure::write('Config.language', 'eng'); $TestController = new TestController(); $Post = new ControllerPost(); diff --git a/lib/Cake/Test/Case/Controller/ScaffoldTest.php b/lib/Cake/Test/Case/Controller/ScaffoldTest.php index 8e942258c..fa544b906 100644 --- a/lib/Cake/Test/Case/Controller/ScaffoldTest.php +++ b/lib/Cake/Test/Case/Controller/ScaffoldTest.php @@ -129,6 +129,7 @@ class ScaffoldTest extends CakeTestCase { */ public function setUp() { parent::setUp(); + Configure::write('Config.language', 'eng'); $request = new CakeRequest(null, false); $this->Controller = new ScaffoldMockController($request); $this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php index b69bc43ce..86b88740b 100644 --- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php +++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php @@ -148,6 +148,7 @@ class ExceptionRendererTest extends CakeTestCase { */ public function setUp() { parent::setUp(); + Configure::write('Config.language', 'eng'); App::build(array( 'View' => array( CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS diff --git a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php index 8e202b252..e4e32c393 100644 --- a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php @@ -942,6 +942,7 @@ class TranslateBehaviorTest extends CakeTestCase { * @return void */ public function testValidation() { + Configure::write('Config.language', 'eng'); $this->loadFixtures('Translate', 'TranslatedItem'); $TestModel = new TranslatedItem(); diff --git a/lib/Cake/Test/Case/Model/ModelValidationTest.php b/lib/Cake/Test/Case/Model/ModelValidationTest.php index abc3becc7..5dd9fe2c9 100644 --- a/lib/Cake/Test/Case/Model/ModelValidationTest.php +++ b/lib/Cake/Test/Case/Model/ModelValidationTest.php @@ -27,6 +27,16 @@ require_once dirname(__FILE__) . DS . 'ModelTestBase.php'; */ class ModelValidationTest extends BaseModelTest { +/** + * override locale to the default (eng). + * + * @return void + */ + public function setUp() { + parent::setUp(); + Configure::write('Config.language', 'eng'); + } + /** * Tests validation parameter order in custom validation methods * diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index f9857beb1..1ec06c96b 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -32,6 +32,16 @@ require_once dirname(__FILE__) . DS . 'ModelTestBase.php'; */ class ModelWriteTest extends BaseModelTest { +/** + * override locale to the default (eng). + * + * @return void + */ + public function setUp() { + parent::setUp(); + Configure::write('Config.language', 'eng'); + } + /** * Test save() failing when there is no data. * diff --git a/lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php b/lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php index ab5c7804e..5bdd3590e 100644 --- a/lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php +++ b/lib/Cake/Test/Case/Model/Validator/CakeValidationSetTest.php @@ -27,6 +27,16 @@ App::uses('CakeValidationSet', 'Model/Validator'); */ class CakeValidationSetTest extends CakeTestCase { +/** + * override locale to the default (eng). + * + * @return void + */ + public function setUp() { + parent::setUp(); + Configure::write('Config.language', 'eng'); + } + /** * testValidate method * diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 73cfb283e..02b5d8c97 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -524,6 +524,7 @@ class FormHelperTest extends CakeTestCase { public function setUp() { parent::setUp(); + Configure::write('Config.language', 'eng'); Configure::write('App.base', ''); Configure::delete('Asset'); $this->Controller = new ContactTestController(); diff --git a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php index ec8c937bf..a2da52bde 100644 --- a/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php @@ -42,6 +42,7 @@ class PaginatorHelperTest extends CakeTestCase { */ public function setUp() { parent::setUp(); + Configure::write('Config.language', 'eng'); $controller = null; $this->View = new View($controller); $this->Paginator = new PaginatorHelper($this->View);