Example #1
0
 /**
  * @dataProvider displaytypes
  */
 public function testControlGroupFull($displaytype)
 {
     $class = $displaytype;
     if ($displaytype != '') {
         $class = ' ' . $displaytype;
     }
     // Had to match label and go up to the parent
     // than back down to get the other elements. Odd but can't
     // figure out how to find 3 different child elements
     $matcher = array('tag' => 'div', 'attributes' => array('class' => 'controls'), 'child' => array('tag' => 'input', 'attributes' => array('type' => 'text', 'name' => 'inputfoo', 'id' => 'inputfoo')), 'parent' => array('tag' => 'div', 'attributes' => array('class' => 'control-group' . $class), 'child' => array('tag' => 'label', 'attributes' => array('class' => 'control-label', 'for' => 'inputfoo'), 'content' => 'foo'), 'descendant' => array('tag' => 'div', 'attributes' => array('class' => 'controls'), 'child' => array('tag' => 'input', 'attributes' => array('type' => 'text', 'name' => 'inputfoo', 'id' => 'inputfoo')))));
     $html = Form::control_group(Form::label('inputfoo', 'foo'), Form::text('inputfoo'), $displaytype, Form::block_help('You foobared that!'));
     $this->assertHTML($matcher, $html);
 }