Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nthndnn committed Feb 19, 2019
1 parent 4acb5b9 commit 5843305
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/BasicFormBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,21 +563,21 @@ public function testCanSetGroupData()

public function testRenderInputGroupWithBeforeAddon()
{
$expected = '<div class="form-group"><label for="username">Username</label><div class="input-group"><span class="input-group-addon">@</span><input type="text" name="username" id="username" class="form-control"></div></div>';
$expected = '<div class="form-group"><label for="username">Username</label><div class="input-group"><span class="input-group-prepend">@</span><input type="text" name="username" id="username" class="form-control"></div></div>';
$result = $this->form->inputGroup('Username', 'username')->beforeAddon('@')->render();
$this->assertEquals($expected, $result);
}

public function testRenderInputGroupWithAfterAddon()
{
$expected = '<div class="form-group"><label for="site">Site</label><div class="input-group"><input type="text" name="site" id="site" class="form-control"><span class="input-group-addon">.com.br</span></div></div>';
$expected = '<div class="form-group"><label for="site">Site</label><div class="input-group"><input type="text" name="site" id="site" class="form-control"><span class="input-group-append">.com.br</span></div></div>';
$result = $this->form->inputGroup('Site', 'site')->afterAddon('.com.br')->render();
$this->assertEquals($expected, $result);
}

public function testRenderInputGroupChangeTypeWithBothAddon()
{
$expected = '<div class="form-group"><label for="secret">Secret</label><div class="input-group"><span class="input-group-addon">before</span><input type="password" name="secret" id="secret" class="form-control"><span class="input-group-addon">after</span></div></div>';
$expected = '<div class="form-group"><label for="secret">Secret</label><div class="input-group"><span class="input-group-prepend">before</span><input type="password" name="secret" id="secret" class="form-control"><span class="input-group-append">after</span></div></div>';
$result = $this->form
->inputGroup('Secret', 'secret')
->type('password')
Expand Down
4 changes: 2 additions & 2 deletions tests/InputGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function testCanRenderBeforeAddon()
$input = new InputGroup('username');
$this->assertEquals($input, $input->beforeAddon('@'));

$expected = '<div class="input-group"><span class="input-group-addon">@</span><input type="text" name="username"></div>';
$expected = '<div class="input-group"><span class="input-group-prepend">@</span><input type="text" name="username"></div>';
$result = $input->render();
$this->assertEquals($expected, $result);
}
Expand All @@ -31,7 +31,7 @@ public function testCanRenderAfterAddonAndType()
$this->assertEquals($input, $input->type('email'));
$this->assertEquals($input, $input->afterAddon('@domain.com'));

$expected = '<div class="input-group"><input type="email" name="mail"><span class="input-group-addon">@domain.com</span></div>';
$expected = '<div class="input-group"><input type="email" name="mail"><span class="input-group-append">@domain.com</span></div>';
$result = $input->render();
$this->assertEquals($expected, $result);
}
Expand Down

0 comments on commit 5843305

Please sign in to comment.