#!/usr/bin/env perl
sub
test_loadClass : Init(1) {
shift
->useOk(
'Quiq::Html::Widget::ReadOnly'
);
}
sub
test_html : Test(3) {
my
$self
=
shift
;
my
$h
= Quiq::Html::Tag->new;
my
$html
= Quiq::Html::Widget::ReadOnly->html(
$h
);
$self
->is(
$html
,
''
);
$html
= Quiq::Html::Widget::ReadOnly->html(
$h
,
name
=>
'x'
,
value
=> 4711,
);
$self
->is(
$html
,
qq|<input type="hidden" name="x" value="4711" />4711\n|
);
$html
= Quiq::Html::Widget::ReadOnly->html(
$h
,
id
=>
'x1'
,
name
=>
'x'
,
value
=> 4711,
);
$self
->is(
$html
,
q|<span id="x1"><input type="hidden" name="x"|
.
qq| value="4711" />4711</span>\n|
);
}
Quiq::Html::Widget::ReadOnly::Test->runTests;