Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentj committed Jun 22, 2011
1 parent 62d32b8 commit 6b93a12
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
Expand Up @@ -170,7 +170,7 @@ function testOutputInput(){
$ctrl->setReadOnly(false);
$ctrl->help='some help';
ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtest1_input1-help"><span>some help</span></span>', $out);
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtest1_input1-help">&nbsp;<span>some help</span></span>', $out);
$this->assertEqualOrDiff('c = new jFormsJQControlString(\'input1\', \'Votre nom\');
c.errInvalid=\'"Votre nom" field is invalid\';
jFormsJQ.tForm.addControl(c);
Expand All @@ -179,7 +179,7 @@ function testOutputInput(){

$ctrl->help="some \nhelp with ' and\nline break.";
ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtest1_input1-help">'."<span>some \nhelp with ' and\nline break.</span>".'</span>', $out);
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtest1_input1-help">'."&nbsp;<span>some \nhelp with ' and\nline break.</span>".'</span>', $out);
$this->assertEqualOrDiff('c = new jFormsJQControlString(\'input1\', \'Votre nom\');
c.errInvalid=\'"Votre nom" field is invalid\';
jFormsJQ.tForm.addControl(c);
Expand All @@ -191,7 +191,7 @@ function testOutputInput(){
$this->assertEqualOrDiff('<label class="jforms-label" for="'.$this->formname.'_input1" id="'.$this->formname.'_input1_label" title="ceci est un tooltip">Votre nom</label>'."\n", $out);

ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" title="ceci est un tooltip" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtest1_input1-help"><span>some help</span></span>', $out);
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" title="ceci est un tooltip" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtest1_input1-help">&nbsp;<span>some help</span></span>', $out);
$this->assertEqualOrDiff('c = new jFormsJQControlString(\'input1\', \'Votre nom\');
c.errInvalid=\'"Votre nom" field is invalid\';
jFormsJQ.tForm.addControl(c);
Expand Down Expand Up @@ -1461,7 +1461,7 @@ function testOutputCaptcha(){
$ctrl->setReadOnly(false);
$ctrl->help='some help';
ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<span class="jforms-captcha-question">'.htmlspecialchars($ctrl->question).'</span> <input name="cap" id="'.$this->formname.'_cap" class="jforms-ctrl-captcha jforms-required" type="text" value=""/>'."\n".'<span class="jforms-help" id="jforms_formtest1_cap-help"><span>some help</span></span>', $out);
$this->assertEqualOrDiff('<span class="jforms-captcha-question">'.htmlspecialchars($ctrl->question).'</span> <input name="cap" id="'.$this->formname.'_cap" class="jforms-ctrl-captcha jforms-required" type="text" value=""/>'."\n".'<span class="jforms-help" id="jforms_formtest1_cap-help">&nbsp;<span>some help</span></span>', $out);
$this->assertEqualOrDiff('c = new jFormsJQControlString(\'cap\', \'captcha for security\');
c.required = true;
c.errRequired=\'"captcha for security" field is required\';
Expand All @@ -1474,7 +1474,7 @@ function testOutputCaptcha(){
$this->assertEqualOrDiff('<label class="jforms-label jforms-required" for="'.$this->formname.'_cap" id="'.$this->formname.'_cap_label" title="ceci est un tooltip">captcha for security<span class="jforms-required-star">*</span></label>'."\n", $out);

ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<span class="jforms-captcha-question">'.htmlspecialchars($ctrl->question).'</span> <input name="cap" id="'.$this->formname.'_cap" title="ceci est un tooltip" class="jforms-ctrl-captcha jforms-required" type="text" value=""/>'."\n".'<span class="jforms-help" id="jforms_formtest1_cap-help"><span>some help</span></span>', $out);
$this->assertEqualOrDiff('<span class="jforms-captcha-question">'.htmlspecialchars($ctrl->question).'</span> <input name="cap" id="'.$this->formname.'_cap" title="ceci est un tooltip" class="jforms-ctrl-captcha jforms-required" type="text" value=""/>'."\n".'<span class="jforms-help" id="jforms_formtest1_cap-help">&nbsp;<span>some help</span></span>', $out);
$this->assertEqualOrDiff('c = new jFormsJQControlString(\'cap\', \'captcha for security\');
c.required = true;
c.errRequired=\'"captcha for security" field is required\';
Expand Down
Expand Up @@ -182,7 +182,7 @@ function testOutputChoice(){
$choice->setReadOnly(false);

ob_start();$this->builder->outputControlLabel($choice);$out = ob_get_clean();
$this->assertEqualOrDiff('<label class="jforms-label" for="'.$this->formname.'_status" id="'.$this->formname.'_status_label">Task Status</label>'."\n", $out);
$this->assertEqualOrDiff('<span class="jforms-label" id="'.$this->formname.'_status_label">Task Status</span>'."\n", $out);


$expected = '<ul class="jforms-choice jforms-ctl-status" >'."\n";
Expand Down
Expand Up @@ -152,7 +152,7 @@ function testOutputInput(){
$ctrl->setReadOnly(false);
$ctrl->help='some help';
ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_input1-help"><span>some help</span></span>', $out);
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_input1-help">&nbsp;<span>some help</span></span>', $out);
$this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\');
c.errInvalid=\'"Votre nom" field is invalid\';
jForms.tForm.addControl(c);
Expand All @@ -161,7 +161,7 @@ function testOutputInput(){

$ctrl->help="some \nhelp with ' and\nline break.";
ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_input1-help">'."<span>some \nhelp with ' and\nline break.</span>".'</span>', $out);
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_input1-help">'."&nbsp;<span>some \nhelp with ' and\nline break.</span>".'</span>', $out);
$this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\');
c.errInvalid=\'"Votre nom" field is invalid\';
jForms.tForm.addControl(c);
Expand All @@ -173,7 +173,7 @@ function testOutputInput(){
$this->assertEqualOrDiff('<label class="jforms-label" for="'.$this->formname.'_input1" id="'.$this->formname.'_input1_label" title="ceci est un tooltip">Votre nom</label>'."\n", $out);

ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" title="ceci est un tooltip" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_input1-help"><span>some help</span></span>', $out);
$this->assertEqualOrDiff('<input name="input1" id="'.$this->formname.'_input1" title="ceci est un tooltip" class="jforms-ctrl-input" value="laurent" type="text"/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_input1-help">&nbsp;<span>some help</span></span>', $out);
$this->assertEqualOrDiff('c = new jFormsControlString(\'input1\', \'Votre nom\');
c.errInvalid=\'"Votre nom" field is invalid\';
jForms.tForm.addControl(c);
Expand Down Expand Up @@ -1333,7 +1333,7 @@ function testOutputCaptcha(){
$ctrl->setReadOnly(false);
$ctrl->help='some help';
ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<span class="jforms-captcha-question">'.htmlspecialchars($ctrl->question).'</span> <input name="cap" id="'.$this->formname.'_cap" class="jforms-ctrl-captcha jforms-required" type="text" value=""/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_cap-help"><span>some help</span></span>', $out);
$this->assertEqualOrDiff('<span class="jforms-captcha-question">'.htmlspecialchars($ctrl->question).'</span> <input name="cap" id="'.$this->formname.'_cap" class="jforms-ctrl-captcha jforms-required" type="text" value=""/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_cap-help">&nbsp;<span>some help</span></span>', $out);
$this->assertEqualOrDiff('c = new jFormsControlString(\'cap\', \'captcha for security\');
c.required = true;
c.errRequired=\'"captcha for security" field is required\';
Expand All @@ -1346,7 +1346,7 @@ function testOutputCaptcha(){
$this->assertEqualOrDiff('<label class="jforms-label jforms-required" for="'.$this->formname.'_cap" id="'.$this->formname.'_cap_label" title="ceci est un tooltip">captcha for security<span class="jforms-required-star">*</span></label>'."\n", $out);

ob_start();$this->builder->outputControl($ctrl);$out = ob_get_clean();
$this->assertEqualOrDiff('<span class="jforms-captcha-question">'.htmlspecialchars($ctrl->question).'</span> <input name="cap" id="'.$this->formname.'_cap" title="ceci est un tooltip" class="jforms-ctrl-captcha jforms-required" type="text" value=""/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_cap-help"><span>some help</span></span>', $out);
$this->assertEqualOrDiff('<span class="jforms-captcha-question">'.htmlspecialchars($ctrl->question).'</span> <input name="cap" id="'.$this->formname.'_cap" title="ceci est un tooltip" class="jforms-ctrl-captcha jforms-required" type="text" value=""/>'."\n".'<span class="jforms-help" id="jforms_formtestlight1_cap-help">&nbsp;<span>some help</span></span>', $out);
$this->assertEqualOrDiff('c = new jFormsControlString(\'cap\', \'captcha for security\');
c.required = true;
c.errRequired=\'"captcha for security" field is required\';
Expand Down
Expand Up @@ -183,7 +183,7 @@ function testOutputChoice(){
$choice->setReadOnly(false);

ob_start();$this->builder->outputControlLabel($choice);$out = ob_get_clean();
$this->assertEqualOrDiff('<label class="jforms-label" for="'.$this->formname.'_status" id="'.$this->formname.'_status_label">Task Status</label>'."\n", $out);
$this->assertEqualOrDiff('<span class="jforms-label" id="'.$this->formname.'_status_label">Task Status</span>'."\n", $out);


$expected = '<ul class="jforms-choice jforms-ctl-status" >'."\n";
Expand Down Expand Up @@ -420,4 +420,3 @@ public function testFormWithExternalUrlAsAction(){

}
}

0 comments on commit 6b93a12

Please sign in to comment.