public function testActionBar() { $html = Form::actions(array(Button::primary_submit('Save changes'), Form::button('Cancel'))); $matcher = array('tag' => 'div', 'attributes' => array('class' => 'form-actions'), 'child' => array('tag' => 'button', 'attributes' => array('class' => 'btn-primary btn', 'type' => 'submit'), 'content' => 'Save changes'), 'descendant' => array('tag' => 'button', 'attributes' => array('class' => 'btn', 'type' => 'button'), 'content' => 'Cancel')); $this->assertHTML($matcher, $html); }
public function testMultipleButtons() { $buttons = Button::info('foo') . Button::success('foo'); $matcher = '<button class="btn-info btn" type="button">foo</button><button class="btn-success btn" type="button">foo</button>'; $this->assertEquals($matcher, $buttons); }
/** * Create a HTML button element. * Overriding the default button to add the correct class from Laravel\Form * * @param string $value text value of button * @param array $attributes array of attributes for button * @param bool $hasDropdown button has dropdown * * @return string */ public static function button($value = null, $attributes = array(), $hasDropdown = false) { return Button::normal($value, $attributes, $hasDropdown); }