Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
Adding tests BasicFormBuilderTest:testRequiredLabels() for GroupWrapp…
Browse files Browse the repository at this point in the history
…er:required().
  • Loading branch information
Clément Blanco committed Apr 25, 2017
1 parent d94265c commit ebd0986
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/BasicFormBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,17 @@ public function testCanHideLabels()
$this->assertEquals($expected, $result);
}

public function testRequiredLabels()
{
$expected = '<div class="form-group"><label class="control-label control-label-required" for="email">Email</label><input type="text" name="email" id="email" class="form-control" required="required"></div>';
$result = $this->form->text('Email', 'email')->required()->render();
$this->assertEquals($expected, $result);

$expected = '<div class="form-group"><label class="control-label" for="email">Email</label><input type="text" name="email" id="email" class="form-control"></div>';
$result = $this->form->text('Email', 'email')->required(false)->render();
$this->assertEquals($expected, $result);
}

public function testCanAddGroupClass()
{
$expected = '<div class="form-group test-class"><label class="control-label" for="email">Email</label><input type="text" name="email" id="email" class="form-control"></div>';
Expand Down

0 comments on commit ebd0986

Please sign in to comment.