Skip to content

Commit d0a8776

Browse files
committed
fixed Issue #35
1 parent 1319d53 commit d0a8776

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

Test/Case/View/Helper/BoostCakeFormHelperTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,37 @@ public function testErrorMessage() {
311311
'/div',
312312
'/div'
313313
));
314+
315+
$result = $this->Form->input('Contact.password', array(
316+
'div' => 'control-group',
317+
'label' => array(
318+
'class' => 'control-label'
319+
),
320+
'wrapInput' => 'controls',
321+
'beforeInput' => '<div class="input-append">',
322+
'afterInput' => '<span class="add-on">AddOn</span></div>'
323+
));
324+
$this->assertTags($result, array(
325+
array('div' => array('class' => 'control-group has-error error')),
326+
'label' => array('for' => 'ContactPassword', 'class' => 'control-label'),
327+
'Password',
328+
'/label',
329+
array('div' => array('class' => 'controls')),
330+
array('div' => array('class' => 'input-append')),
331+
'input' => array(
332+
'type' => 'password', 'name' => 'data[Contact][password]',
333+
'id' => 'ContactPassword', 'class' => 'form-error'
334+
),
335+
array('span' => array('class' => 'add-on')),
336+
'AddOn',
337+
'/span',
338+
'/div',
339+
array('span' => array('class' => 'help-block text-danger')),
340+
'Please provide a password',
341+
'/span',
342+
'/div',
343+
'/div'
344+
));
314345
}
315346

316347
public function testPostLink() {

View/Helper/BoostCakeFormHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected function _getInput($args) {
184184
}
185185
}
186186

187-
$html = $beforeInput . $input . $error . $afterInput;
187+
$html = $beforeInput . $input . $afterInput . $error;
188188

189189
if ($this->_divOptions) {
190190
$tag = $this->_divOptions['tag'];

0 commit comments

Comments
 (0)