1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-14 02:24:08 +02:00

"<div class='field-help'>" etc has been replaced by the $frm->help() method and is also used by the admin-ui.

This commit is contained in:
Cameron
2021-02-04 08:45:10 -08:00
parent 82fbeab43c
commit 5870fbdb84
15 changed files with 300 additions and 210 deletions

View File

@@ -234,6 +234,38 @@ class e_formTest extends \Codeception\Test\Unit
}
public function testHelp()
{
// disabled
$this->_frm->setHelpLocation('none');
$result = $this->_frm->help('my tip', 'before');
$this->assertEmpty($result);
$result = $this->_frm->help('my tip', 'after');
$this->assertEmpty($result);
// display after only.
$this->_frm->setHelpLocation('after');
$result = $this->_frm->help('my tip', 'before');
$this->assertEmpty($result);
$result = $this->_frm->help('my tip', 'after');
$this->assertSame('<div class="field-help" data-placement="left">my tip</div>', $result);
// display as icon before field only.
$this->_frm->setHelpLocation('before');
$result = $this->_frm->help('my tip', 'before');
$this->assertSame('<i class="admin-ui-help-tip far fa-question-circle"><!-- --></i><div class="field-help" data-placement="left">my tip</div>', $result);
$result = $this->_frm->help('my tip', 'after');
$this->assertEmpty($result);
$this->_frm->setHelpLocation('after');
}
/*
public function testGetRequiredString()