Skip to content

Commit

Permalink
Fixes #5214 form help icon fix. DST test fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Apr 6, 2024
1 parent e4fa9eb commit 145d1de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion e107_handlers/form_handler.php
Expand Up @@ -3235,7 +3235,10 @@ public function help($text)
}

$ret = '';
$ret .= '<i class="admin-ui-help-tip far fa-question-circle"><!-- --></i>';
// $ret .= '<i class="admin-ui-help-tip far fa-question-circle"><!-- --></i>';

$ret .= $this->tp->toGlyph('far-question-circle', ['class'=>'admin-ui-help-tip', 'placeholder'=>'<!-- -->']);

$ret .= '<div class="field-help" data-placement="left" style="display:none">'.defset($text,$text).'</div>'; // display:none to prevent visibility during page load.

return $ret;
Expand Down
2 changes: 1 addition & 1 deletion e107_tests/tests/unit/e107Test.php
Expand Up @@ -1562,7 +1562,7 @@ public function testUrl()
echo $result . "\n";
continue;
}
$this->assertEquals($var['_expected_'], $result);
self::assertEquals($var['_expected_'], $result, 'Failed on test #'.$index);
// $this->assertEquals("https://localhost/e107/news", $result);
}

Expand Down
10 changes: 5 additions & 5 deletions e107_tests/tests/unit/e_formTest.php
Expand Up @@ -288,7 +288,7 @@ public function testGetCountry()
public function testHelp()
{
$result = $this->_frm->help('my tip');
$this->assertSame('<i class="admin-ui-help-tip far fa-question-circle"><!-- --></i><div class="field-help" data-placement="left" style="display:none">my tip</div>', $result);
self::assertSame("<i class='admin-ui-help-tip far fa-question-circle' ><!-- --></i><div class=\"field-help\" data-placement=\"left\" style=\"display:none\">my tip</div>", $result);
}
/*
public function testGetRequiredString()
Expand Down Expand Up @@ -435,9 +435,9 @@ public function testDatepicker()
$this->assertEquals($expected, $actual);

// test timezone change...
date_default_timezone_set('America/Los_Angeles');
date_default_timezone_set('America/Phoenix');
$actual = $this->_frm->datepicker('date_field',$time,'type=datetime&format=MM, dd, yyyy hh:ii');
$expected = "<input class='tbox e-datetime input-xlarge form-control' type='text' size='40' id='e-datepicker-date-field' value='December, 31, 2022 17:00' data-date-unix ='true' data-date-format='MM, dd, yyyy hh:ii' data-date-ampm='false' data-date-language='en' data-date-firstday='0' /><input type='hidden' name='date_field' id='date-field' value='1672534800' />";
$expected = "<input class='tbox e-datetime input-xlarge form-control' type='text' size='40' id='e-datepicker-date-field' value='December, 31, 2022 18:00' data-date-unix ='true' data-date-format='MM, dd, yyyy hh:ii' data-date-ampm='false' data-date-language='en' data-date-firstday='0' /><input type='hidden' name='date_field' id='date-field' value='1672534800' />";

$this->assertEquals($expected, $actual);
date_default_timezone_set($prevTimeZone);
Expand Down Expand Up @@ -1108,7 +1108,7 @@ public function testRenderInline()
*/
public function testRenderValue()
{
date_default_timezone_set('America/Los_Angeles');
date_default_timezone_set('America/Phoenix');

$frm = $this->_frm;

Expand Down Expand Up @@ -1144,7 +1144,7 @@ public function testRenderValue()

'file_001' => '<a href="'.SITEURL.'e107_media/000000test/files/test.zip" title="Direct link to {e_MEDIA_FILE}test.zip" rel="external">{e_MEDIA_FILE}test.zip</a>',
'files_001' => '<ol><li>{e_MEDIA_FILE}test.zip</li></ol>',
'datestamp_001' => '03 Nov 2023 : 13:47',
'datestamp_001' => '03 Nov 2023 : 14:47',
'date_001' => '2018-08-23',
'userclass_001' => 'Everyone (public)',
'userclasses_001' => 'Everyone (public)<br />PRIVATEMENU',
Expand Down

0 comments on commit 145d1de

Please sign in to comment.