Esempio n. 1
0
 public function testCanSelectNumericKeys()
 {
     $select = new Select('fruit');
     $select->options(array('1' => 'Granny Smith', '2' => 'Blueberry'));
     $expected = '<select class="ui dropdown" name="fruit"><option value="1" selected>Granny Smith</option><option value="2">Blueberry</option></select>';
     $result = $select->select('1')->render();
     $this->assertEquals($expected, $result);
     $select = new Select('fruit');
     $select->options(array('1' => 'Granny Smith', '2' => 'Blueberry'));
     $expected = '<select class="ui dropdown" name="fruit"><option value="1">Granny Smith</option><option value="2" selected>Blueberry</option></select>';
     $result = $select->select('2')->render();
     $this->assertEquals($expected, $result);
 }