Fix phpunit
This commit is contained in:
parent
3c0e841877
commit
e1a45df0d8
@ -393,9 +393,10 @@ class FormAdmin
|
||||
* @param string $htmlname Name of HTML select field
|
||||
* @param string $filter Value to filter on code
|
||||
* @param int $showempty Add empty value
|
||||
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
|
||||
* @return string Return HTML output
|
||||
*/
|
||||
public function select_paper_format($selected = '', $htmlname = 'paperformat_id', $filter = 0, $showempty = 0)
|
||||
public function select_paper_format($selected = '', $htmlname = 'paperformat_id', $filter = 0, $showempty = 0, $forcecombo = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
@ -444,8 +445,10 @@ class FormAdmin
|
||||
}
|
||||
$out .= '</select>';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($htmlname);
|
||||
if (!$forcecombo) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($htmlname);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ class FormAdminTest extends PHPUnit\Framework\TestCase
|
||||
$db=$this->savdb;
|
||||
|
||||
$localobject=new FormAdmin($this->savdb);
|
||||
$result=$localobject->select_paper_format('', 'paperformat_id', 'A4');
|
||||
$result=$localobject->select_paper_format('', 'paperformat_id', 'A4', 0, 1);
|
||||
|
||||
$this->assertEquals($result, '<select class="flat" id="paperformat_id" name="paperformat_id"><option value="EUA4">Format A4 - 210x297 mm</option></select>');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user