X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fhelper%2Fcsv.t;h=434626f8f4385a704612d3629f585350f34404b4;hb=05cb19d573c8e414f020bd1fef84e861651ff16c;hp=d4a1571995aabdc50572f3ea91fb6d9e5bf5c2f5;hpb=61a56da0c549380aeaa9d3c04ea8ba56145444b7;p=kivitendo-erp.git diff --git a/t/helper/csv.t b/t/helper/csv.t index d4a157199..434626f8f 100644 --- a/t/helper/csv.t +++ b/t/helper/csv.t @@ -1,4 +1,4 @@ -use Test::More tests => 37; +use Test::More tests => 39; use SL::Dispatcher; use Data::Dumper; use utf8; @@ -11,7 +11,7 @@ $csv = SL::Helper::Csv->new( header => [ 'description' ], ); -isa_ok $csv->_csv, 'Text::CSV'; +isa_ok $csv->_csv, 'Text::CSV_XS'; isa_ok $csv->_io, 'IO::File'; isa_ok $csv->parse, 'SL::Helper::Csv', 'parsing returns self'; is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'simple case works'; @@ -274,4 +274,23 @@ $csv = SL::Helper::Csv->new( $csv->parse; is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'eol bug at the end of files'; +##### + +$csv = SL::Helper::Csv->new( + file => \"Description\nKaffee", + class => 'SL::DB::Part', +); +$csv->parse; +is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive header from csv works'; + +##### + +$csv = SL::Helper::Csv->new( + file => \"Kaffee", + header => [ 'Description' ], + class => 'SL::DB::Part', +); +$csv->parse; +is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive header as param works'; + # vim: ft=perl