From f5804cb4caca2dc3f98e42fa64c4de35055bc17d Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 15 Mar 2012 22:50:05 -0400 Subject: [PATCH] Fix most coding standards in Test/Case/View --- .../Test/Case/View/Helper/CacheHelperTest.php | 5 +- .../Test/Case/View/Helper/FormHelperTest.php | 31 +++--- .../Test/Case/View/Helper/HtmlHelperTest.php | 102 +++++++++--------- .../View/Helper/JqueryEngineHelperTest.php | 1 + .../Test/Case/View/Helper/JsHelperTest.php | 52 ++++++--- .../View/Helper/MootoolsEngineHelperTest.php | 1 + .../Case/View/Helper/NumberHelperTest.php | 1 - .../Case/View/Helper/PaginatorHelperTest.php | 9 +- .../View/Helper/PrototypeEngineHelperTest.php | 1 + .../Test/Case/View/Helper/RssHelperTest.php | 2 +- .../Case/View/Helper/SessionHelperTest.php | 6 +- .../Test/Case/View/HelperCollectionTest.php | 1 + lib/Cake/Test/Case/View/HelperTest.php | 24 +++-- lib/Cake/Test/Case/View/JsonViewTest.php | 2 +- lib/Cake/Test/Case/View/MediaViewTest.php | 16 +-- lib/Cake/Test/Case/View/ScaffoldViewTest.php | 19 ++-- lib/Cake/Test/Case/View/ThemeViewTest.php | 15 +-- lib/Cake/Test/Case/View/ViewTest.php | 89 +++++---------- lib/Cake/Test/Case/View/XmlViewTest.php | 2 +- 19 files changed, 186 insertions(+), 193 deletions(-) diff --git a/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php b/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php index 5f77829c476..768d7a5f57e 100644 --- a/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/CacheHelperTest.php @@ -49,6 +49,7 @@ public function cache_parsing() { $this->set('batman', 'bruce wayne'); $this->set('spiderman', 'peter parker'); } + } /** @@ -84,7 +85,7 @@ public function setUp() { Configure::write('Cache.check', true); Configure::write('Cache.disable', false); App::build(array( - 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS) + 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS) ), App::RESET); } @@ -380,7 +381,6 @@ public function testCacheActionArray() { $this->assertTrue(file_exists($filename)); @unlink($filename); - $this->Controller->cache_parsing(); $this->Controller->cacheAction = array( 'cache_parsing' => 21600 @@ -398,7 +398,6 @@ public function testCacheActionArray() { $this->assertTrue(file_exists($filename)); @unlink($filename); - $this->Controller->cache_parsing(); $this->Controller->request->addParams(array( 'controller' => 'cache_test', diff --git a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php index 5f225517210..271c69d537f 100644 --- a/lib/Cake/Test/Case/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/FormHelperTest.php @@ -182,6 +182,7 @@ class ContactTagsContact extends CakeTestModel { public function setSchema($schema) { $this->_schema = $schema; } + } /** @@ -217,6 +218,7 @@ public function schema($field = false) { unset($this->_schema['id']); return $this->_schema; } + } /** @@ -369,6 +371,7 @@ public function beforeValidate($options = array()) { $this->invalidate('openid_not_registered'); return true; } + } /** @@ -432,6 +435,7 @@ public function beforeValidate($options = array()) { $this->invalidate('email'); return false; } + } /** @@ -505,6 +509,7 @@ public function beforeValidate($options = array()) { $this->invalidate('city'); return false; } + } /** @@ -568,6 +573,7 @@ public function beforeValidate($options = array()) { $this->invalidate('description'); return false; } + } /** @@ -675,8 +681,6 @@ public function tearDown() { Configure::write('Security.salt', $this->oldSalt); } - - /** * testFormCreateWithSecurity method * @@ -975,7 +979,6 @@ public function testSecurityButtonNestedNamed() { $this->assertEquals(array('Address.button'), $result); } - /** * Test that submit inputs created with foo[bar] name attributes are unlocked correctly. * @@ -1469,7 +1472,7 @@ public function testUnlockFieldRemovingFromFields() { */ public function testTagIsInvalid() { $Contact = ClassRegistry::getObject('Contact'); - $Contact->validationErrors[0]['email'] = array('Please provide an email'); + $Contact->validationErrors[0]['email'] = array('Please provide an email'); $this->Form->setEntity('Contact.0.email'); $result = $this->Form->tagIsInvalid(); @@ -1496,7 +1499,7 @@ public function testTagIsInvalid() { */ public function testPasswordValidation() { $Contact = ClassRegistry::getObject('Contact'); - $Contact->validationErrors['password'] = array('Please provide a password'); + $Contact->validationErrors['password'] = array('Please provide a password'); $result = $this->Form->input('Contact.password'); $expected = array( @@ -2389,7 +2392,6 @@ public function testInputSelectType() { ); $this->assertTags($result, $expected); - $this->View->viewVars['users'] = array('value' => 'good', 'other' => 'bad'); $this->Form->request->data = array('Model' => array('user_id' => 'value')); @@ -5271,7 +5273,6 @@ public function testDateTimeLabelIdMatchesFirstInput() { $this->assertContains('label for="ModelDateYear"', $result); } - /** * testMonth method * @@ -5613,7 +5614,7 @@ public function testHour() { $result = $this->Form->hour('Model.field', true, array('value' => 'now')); $thisHour = date('H'); $optValue = date('G'); - $this->assertRegExp('/