diff --git a/src/InputRenderer.php b/src/InputRenderer.php
index a18031f..43361cd 100644
--- a/src/InputRenderer.php
+++ b/src/InputRenderer.php
@@ -148,7 +148,7 @@ class InputRenderer
* @param string|string[]|null $collection_name collection name(s) for inputs, e.g. 'myform' or ['myform', '123'] etc.
* @param string|null $id_prefix base id for inputs, e.g. 'myform' or 'myform-123', etc.
*/
- public function __construct($model = null, $collection_name = null, $id_prefix = null)
+ public function __construct($model = null, $collection_name = null, $id_prefix = "form")
{
$this->model = InputModel::create($model);
$this->collection_name = $collection_name;
diff --git a/tests/unit/FieldRenderCest.php b/tests/unit/FieldRenderCest.php
index 472281d..3321ca5 100644
--- a/tests/unit/FieldRenderCest.php
+++ b/tests/unit/FieldRenderCest.php
@@ -26,38 +26,38 @@ public function renderTextFields(UnitTester $I)
$model = $form->model;
$field = new TextField('value');
- $I->assertSame('', $form->render($field),
+ $I->assertSame('', $form->render($field),
'basic input with no value-attribute');
$field->setValue($model, 'Hello World');
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field), 'basic input with value-attribute');
$field->max_length = 50;
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field), 'input with value and maxlength-attribute');
$field->setPlaceholder('hello');
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field), 'input with value, maxlength and placeholder-attributes');
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field, ['data-foo' => 'bar']), 'input with custom data-attribute overridden');
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field, ['placeholder' => 'override']), 'input with placeholder-attribute overridden');
$field->setValue($model, 'this & that');
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field), 'input with value-attribute escaped as HTML');
$field = new TextField("value");
$field->setPattern('[A-Z]{2}', 'Enter two-letter ISO language code');
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field));
}
@@ -69,7 +69,7 @@ public function renderPasswordField(UnitTester $I)
$field->setValue($model, 'supersecret');
- $I->assertSame('', $form->render($field),
+ $I->assertSame('', $form->render($field),
'input with type=password');
}
@@ -93,7 +93,7 @@ public function renderEmailField(UnitTester $I)
$field->setValue($model, 'foo@bar.baz');
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field), 'input with type=email (html5)');
}
@@ -105,7 +105,7 @@ public function renderTextArea(UnitTester $I)
$field->setValue($model, 'this & that');
- $I->assertSame('', $form->render($field),
+ $I->assertSame('', $form->render($field),
'simple textarea with content');
}
@@ -154,22 +154,22 @@ public function renderSelectTags(UnitTester $I)
2 => 'Option Two',
]);
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field));
$field->setValue($form->model, 1);
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field));
$field->disabled = 'Please select';
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field));
$field->setValue($form->model, null);
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field));
}
@@ -204,16 +204,16 @@ public function renderIntField(UnitTester $I)
$field = new IntField("value");
- $I->assertSame('', $form->render($field));
+ $I->assertSame('', $form->render($field));
$field->min_value = -1;
- $I->assertSame('', $form->render($field));
+ $I->assertSame('', $form->render($field));
$field->min_value = 1;
$field->max_value = 99;
- $I->assertSame('', $form->render($field));
+ $I->assertSame('', $form->render($field));
}
public function renderFloatField(UnitTester $I)
@@ -222,16 +222,16 @@ public function renderFloatField(UnitTester $I)
$field = new FloatField("value");
- $I->assertSame('', $form->render($field));
+ $I->assertSame('', $form->render($field));
$field->min_value = -1;
- $I->assertSame('', $form->render($field));
+ $I->assertSame('', $form->render($field));
$field->min_value = 1;
$field->max_value = 99;
- $I->assertSame('', $form->render($field));
+ $I->assertSame('', $form->render($field));
}
public function renderDateTimeField(UnitTester $I)
@@ -240,7 +240,7 @@ public function renderDateTimeField(UnitTester $I)
$field = new DateTimeField('value', 'Europe/Copenhagen', 'Y-m-d H:i:s', ['readonly' => true]);
$field->setValue($form->model, 173919600);
- $I->assertSame('',
+ $I->assertSame('',
$form->render($field));
}
@@ -269,17 +269,17 @@ public function renderDateSelector(UnitTester $I)
$I->expectParts(
$form->render($field), [
- '