function it_can_be_made_a_radio()
 {
     $buttonLeft = new Button();
     $buttonLeft->danger('Left');
     $buttonMiddle = new Button();
     $buttonMiddle->danger('Middle');
     $buttonRight = new Button();
     $buttonRight->danger('Right');
     $this->radio([$buttonLeft, $buttonMiddle, $buttonRight])->render()->shouldBe("<div class='btn-group' data-toggle='buttons'><label class='btn btn-danger'><input type='radio'>Left</label><label class='btn btn-danger'><input type='radio'>Middle</label><label class='btn btn-danger'><input type='radio'>Right</label></div>");
 }
 function it_can_be_made_a_checkbox_with_attributes()
 {
     $buttonLeft = new Button();
     $buttonLeft->danger('Left')->withAttributes(['data-foo' => 'bar']);
     $buttonMiddle = new Button();
     $buttonMiddle->danger('Middle')->withAttributes(['data-foo' => 'bar']);
     $buttonRight = new Button();
     $buttonRight->danger('Right');
     $this->checkbox([$buttonLeft, $buttonMiddle, $buttonRight])->render()->shouldBe("<div class='btn-group' data-toggle='buttons'><label class='btn btn-danger'><input type='checkbox' data-foo='bar'>Left</label><label class='btn btn-danger'><input type='checkbox' data-foo='bar'>Middle</label><label class='btn btn-danger'><input type='checkbox'>Right</label></div>");
 }
Exemple #3
0
 /**
  * Creates an button with class .btn-danger and the given contents
  *
  * @param string $contents The contents of the button
  * @return \Bootstrapper\Button 
  * @static 
  */
 public static function danger($contents = '')
 {
     return \Bootstrapper\Button::danger($contents);
 }
 function it_allows_you_to_activate_several_links()
 {
     $buttonLeft = new Button();
     $buttonLeft->danger('Left')->withAttributes(['data-foo' => 'bar']);
     $buttonMiddle = new Button();
     $buttonMiddle->danger('Middle')->withAttributes(['data-foo' => 'bar']);
     $buttonRight = new Button();
     $buttonRight->danger('Right');
     $this->checkbox([$buttonLeft, $buttonMiddle, $buttonRight])->activate([1, 2])->render()->shouldBe("<div class='btn-group' data-toggle='buttons'><label class='btn btn-danger active'><input type='checkbox' data-foo='bar'>Left</label><label class='btn btn-danger active'><input type='checkbox' data-foo='bar'>Middle</label><label class='btn btn-danger'><input type='checkbox'>Right</label></div>");
 }