X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=t%2Fhelper%2Fattr.t;h=ef49d8e74fa073d60a92918ef1b00bf82b308b59;hb=2e9687c8d57a1609e2936e30c3f97d9366fab61d;hp=4de1a53ffe9944d2754522c7c25c3c952aaa0074;hpb=f9676efea9ccfa01df2a57dca9c45cc8fde0d09e;p=kivitendo-erp.git diff --git a/t/helper/attr.t b/t/helper/attr.t index 4de1a53ff..ef49d8e74 100644 --- a/t/helper/attr.t +++ b/t/helper/attr.t @@ -7,12 +7,16 @@ use_ok 'SL::DB::Order'; use_ok 'SL::DB::Invoice'; use_ok 'SL::Dispatcher'; -SL::Dispatcher::pre_startup_setup(); +{ +$::dispatcher = SL::Dispatcher->new; +$::dispatcher->pre_startup_setup; +no warnings 'once'; $::form = Form->new; $::myconfig{numberformat} = '1.000,00'; $::myconfig{dateformat} = 'dd.mm.yyyy'; $::locale = Locale->new('de'); +} my $p = new_ok 'SL::DB::Part'; is($p->sellprice_as_number('2,30'), '2,30'); @@ -31,14 +35,14 @@ is($o->reqdate_as_date, '11.12.2007'); $o->reqdate(DateTime->new(year => 2010, month => 4, day => 12)); is($o->reqdate_as_date, '12.04.2010'); -is($o->marge_percent_as_percent('40'), '40'); +is($o->marge_percent_as_percent('40'), '40,00'); is($o->marge_percent, 0.40); -is($o->marge_percent_as_percent, '40'); -is($o->marge_percent_as_percent('22,4'), '22'); +is($o->marge_percent_as_percent, '40,00'); +is($o->marge_percent_as_percent('22,4'), '22,40'); is($o->marge_percent, 0.224); -is($o->marge_percent_as_percent, '22'); +is($o->marge_percent_as_percent, '22,40'); is($o->marge_percent(0.231), 0.231); -is($o->marge_percent_as_percent, '23'); +is($o->marge_percent_as_percent, '23,10'); # overloaded attr: invoice taxamount my $i = new_ok 'SL::DB::Invoice';