Commit 2e3c31f3 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixed unit tests

parent 42331f5c
......@@ -122,7 +122,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
$formElement['checkType'] = SANITIZE_ALLOW_EMAIL;
$formElement['checkPattern'] = '';
$result = $build->buildInput($formElement, 'name:1', '', $json);
$this->assertEquals('<input name="name:1" type="input" maxlength="255" value="" pattern="^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" >', $result);
$this->assertEquals('<input name="name:1" type="input" maxlength="255" value="" pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" >', $result);
$this->assertEquals(['form-element' => 'name:1', 'value' => '', 'disabled' => false, 'readonly' => false], $json);
$formElement['checkType'] = '';
......
......@@ -149,7 +149,7 @@ class SanitizeTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('', Sanitize::sanitize($val, SANITIZE_ALLOW_EMAIL), "SANITIZE_ALLOW_EMAIL fails");
$val = 'jo%hn@doe.com';
$this->assertEquals('', Sanitize::sanitize($val, SANITIZE_ALLOW_EMAIL), "SANITIZE_ALLOW_EMAIL fails");
$this->assertEquals('jo%hn@doe.com', Sanitize::sanitize($val, SANITIZE_ALLOW_EMAIL), "SANITIZE_ALLOW_EMAIL fails");
}
public function testSanitizePattern() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment