/** * @dataProvider notSetAttributeAddProvider() */ public function testAddToAttributeArrayNotSet($addition, $expected) { $attributes = array('id' => 'my-element'); $expected = array('id' => 'my-element', 'class' => $expected); $this->assertSame($expected, Html::addToAttributeArray($attributes, 'class', $addition)); }
public function select($name, array $values, $selected = null, $multiple = false, array $attributes = array()) { $attributes = Html::addToAttributeArray($attributes, 'class', 'form-control'); return Html::select($name, $values, $selected, $multiple, $attributes); }