From fb7566c9667bc5a157b119bfb653dbb7c66f8ec0 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Tue, 25 Feb 2014 23:44:26 +0100 Subject: [PATCH] Removing test for stuff that is tested somewhere else --- tests/TestCase/View/Helper/FormHelperTest.php | 215 +----------------- 1 file changed, 1 insertion(+), 214 deletions(-) diff --git a/tests/TestCase/View/Helper/FormHelperTest.php b/tests/TestCase/View/Helper/FormHelperTest.php index f19bb9180b2..5024f96e8dd 100755 --- a/tests/TestCase/View/Helper/FormHelperTest.php +++ b/tests/TestCase/View/Helper/FormHelperTest.php @@ -1485,7 +1485,7 @@ public function testFormSecurityMultipleInputFields() { public function testFormSecurityArrayFields() { $this->Form->request->params['_Token'] = 'testKey'; - $this->Form->create('Address'); + $this->Form->create(); $this->Form->text('Address.primary.1'); $this->assertEquals('Address.primary', $this->Form->fields[0]); @@ -2621,219 +2621,6 @@ public function testInputCheckbox() { $this->assertTags($result, $expected); } -/** - * test form->input() with time types. - * - */ - public function testInputTime() { - $this->markTestIncomplete('Need to revisit once models work again.'); - extract($this->dateRegex); - $result = $this->Form->input('Contact.created', array('type' => 'time', 'timeFormat' => 24)); - $result = explode(':', $result); - $this->assertRegExp('/option value="23"/', $result[0]); - $this->assertNotRegExp('/option value="24"/', $result[0]); - - $result = $this->Form->input('Contact.created', array('type' => 'time', 'timeFormat' => 24)); - $result = explode(':', $result); - $this->assertRegExp('/option value="23"/', $result[0]); - $this->assertNotRegExp('/option value="24"/', $result[0]); - - $result = $this->Form->input('Model.field', array( - 'type' => 'time', 'timeFormat' => 24, 'interval' => 15 - )); - $result = explode(':', $result); - $this->assertNotRegExp('##', $result[1]); - $this->assertNotRegExp('##', $result[1]); - $this->assertRegExp('##', $result[1]); - - $result = $this->Form->input('Model.field', array( - 'type' => 'time', 'timeFormat' => 12, 'interval' => 15 - )); - $result = explode(':', $result); - $this->assertNotRegExp('##', $result[1]); - $this->assertNotRegExp('##', $result[1]); - $this->assertRegExp('##', $result[1]); - - $result = $this->Form->input('prueba', array( - 'type' => 'time', 'timeFormat' => 24, 'dateFormat' => 'DMY', 'minYear' => 2008, - 'maxYear' => date('Y') + 1, 'interval' => 15 - )); - $result = explode(':', $result); - $this->assertNotRegExp('##', $result[1]); - $this->assertNotRegExp('##', $result[1]); - $this->assertRegExp('##', $result[1]); - $this->assertRegExp('##', $result[1]); - - $result = $this->Form->input('Random.start_time', array( - 'type' => 'time', - 'selected' => '18:15' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('published', array('type' => 'time')); - $now = strtotime('now'); - $this->assertContains('', $result); - - $now = strtotime('2013-03-09 00:42:21'); - $result = $this->Form->input('published', array('type' => 'time', 'selected' => $now)); - $this->assertContains('', $result); - $this->assertContains('', $result); - } - -/** - * Test interval + selected near the hour roll over. - * - * @return void - */ - public function testTimeSelectedWithInterval() { - $this->markTestIncomplete('Need to revisit once models work again.'); - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'interval' => 15, - 'selected' => array('hour' => '3', 'min' => '57', 'meridian' => 'pm') - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'interval' => 15, - 'selected' => '2012-10-23 15:57:00' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'timeFormat' => 24, - 'type' => 'time', - 'interval' => 15, - 'selected' => '15:57' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'timeFormat' => 24, - 'type' => 'time', - 'interval' => 15, - 'selected' => '23:57' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.created', array( - 'timeFormat' => 24, - 'type' => 'datetime', - 'interval' => 15, - 'selected' => '2012-09-30 23:56' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - } - -/** - * Test time with selected values around 12:xx:xx - * - * @return void - */ - public function testTimeSelectedWithIntervalTwelve() { - $this->markTestIncomplete('Need to revisit once models work again.'); - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'timeFormat' => 12, - 'interval' => 15, - 'selected' => '00:00:00' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'timeFormat' => 12, - 'interval' => 15, - 'selected' => '12:00:00' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'timeFormat' => 12, - 'interval' => 15, - 'selected' => '12:15:00' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - } - -/** - * Test interval & timeFormat = 12 - * - * @return void - */ - public function testInputTimeWithIntervalAnd12HourFormat() { - $this->markTestIncomplete('Need to revisit once models work again.'); - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'timeFormat' => 12, - 'interval' => 5, - 'selected' => array('hour' => '4', 'min' => '30', 'meridian' => 'pm') - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'timeFormat' => '12', - 'interval' => 5, - 'selected' => '2013-04-19 16:30:00' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'timeFormat' => '12', - 'interval' => 10, - 'selected' => '2013-05-19 00:33:00' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'timeFormat' => '12', - 'interval' => 10, - 'selected' => '2013-05-19 13:33:00' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - - $result = $this->Form->input('Model.start_time', array( - 'type' => 'time', - 'timeFormat' => '12', - 'interval' => 10, - 'selected' => '2013-05-19 01:33:00' - )); - $this->assertContains('', $result); - $this->assertContains('', $result); - $this->assertContains('', $result); - } - /** * test form->input() with datetime, date and time types *