Skip to content
Permalink
Browse files

Fix another skipped test for select().

  • Loading branch information...
markstory committed Feb 18, 2014
1 parent 4e46e8a commit e68618a3cd2f3f92d9e4f54219e1fddb8cfff7a0
Showing with 16 additions and 41 deletions.
  1. +16 −41 tests/TestCase/View/Helper/FormHelperTest.php
@@ -4498,56 +4498,31 @@ public function testSelectRequired() {
* @return void
*/
public function testNestedSelect() {
$this->markTestIncomplete('Need to revisit once models work again.');
$result = $this->Form->select(
'Model.field',
array(1 => 'One', 2 => 'Two', 'Three' => array(
3 => 'Three', 4 => 'Four', 5 => 'Five'
)), array('empty' => false)
);
$expected = array(
'select' => array('name' => 'Model[field]',
'id' => 'ModelField'),
array('option' => array('value' => 1)),
'One',
'/option',
array('option' => array('value' => 2)),
'Two',
'/option',
array('optgroup' => array('label' => 'Three')),
array('option' => array('value' => 4)),
'Four',
'/option',
array('option' => array('value' => 5)),
'Five',
'/option',
'/optgroup',
'/select'
);
$this->assertTags($result, $expected);
$result = $this->Form->select(
'Model.field',
array(1 => 'One', 2 => 'Two', 'Three' => array(3 => 'Three', 4 => 'Four')),
array('showParents' => true, 'empty' => false)
);
$expected = array(
'select' => array('name' => 'Model[field]', 'id' => 'ModelField'),
array('option' => array('value' => 1)),
'One',
'select' => array('name' => 'Model[field]'),
array('option' => array('value' => 1)),
'One',
'/option',
array('option' => array('value' => 2)),
'Two',
'/option',
array('optgroup' => array('label' => 'Three')),
array('option' => array('value' => 3)),
'Three',
'/option',
array('option' => array('value' => 2)),
'Two',
array('option' => array('value' => 4)),
'Four',
'/option',
array('optgroup' => array('label' => 'Three')),
array('option' => array('value' => 3)),
'Three',
'/option',
array('option' => array('value' => 4)),
'Four',
'/option',
'/optgroup',
array('option' => array('value' => 5)),
'Five',
'/option',
'/optgroup',
'/select'
);
$this->assertTags($result, $expected);

0 comments on commit e68618a

Please sign in to comment.
You can’t perform that action at this time.