X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fhelper%2Fattr.t;h=a8f69f114a459a7476429610799682e4d44fe1e4;hb=4c3c1d8ca30914dde03f68b816526015e91360bb;hp=3fc0607d56fd91c1c2d20df3ca05361d40328e29;hpb=e0ad5757c7f9551f808b55c114ff8892f09689f4;p=kivitendo-erp.git diff --git a/t/helper/attr.t b/t/helper/attr.t index 3fc0607d5..a8f69f114 100644 --- a/t/helper/attr.t +++ b/t/helper/attr.t @@ -1,4 +1,4 @@ -use Test::More tests => 29; +use Test::More tests => 44; use lib 't'; @@ -23,6 +23,18 @@ is($p->sellprice_as_number, '2,30'); is($p->sellprice_as_number('2,3442'), '2,3442'); is($p->sellprice, 2.3442); is($p->sellprice_as_number, '2,3442'); +is($p->listprice_as_null_number('2,30'), '2,30'); +is($p->listprice, 2.30); +is($p->listprice_as_null_number, '2,30'); +is($p->listprice_as_null_number('2,3442'), '2,3442'); +is($p->listprice, 2.3442); +is($p->listprice_as_null_number, '2,3442'); +is($p->listprice_as_null_number(''), ''); +is($p->listprice, undef); +is($p->listprice_as_null_number, ''); +is($p->listprice_as_null_number('0'), '0,00'); +is($p->listprice, 0); +is($p->listprice_as_null_number, '0,00'); my $o = new_ok 'SL::DB::Order'; is($o->reqdate_as_date('11.12.2007'), '11.12.2007'); @@ -50,3 +62,12 @@ $i->amount(12); $i->netamount(10.34); is($i->taxamount_as_number, '1,66'); +$o->closed(1); +is $o->closed_as_bool_yn, 'Ja', 'bool 1'; +$o->closed(0); +is $o->closed_as_bool_yn, 'Nein', 'bool 2'; + +# undef test: this only works for columns without default, rose will set +# defaults according to the database +$i->taxincluded(undef); +is $i->taxincluded_as_bool_yn, '', 'bool 3';