Revision 6b378ca7
Von Sven Schöling vor fast 13 Jahren hinzugefügt
t/helper/csv.t | ||
---|---|---|
1 |
use Test::More tests => 39; |
|
2 |
use SL::Dispatcher; |
|
1 |
use Test::More tests => 40; |
|
2 |
|
|
3 |
use lib 't'; |
|
4 |
|
|
3 | 5 |
use Data::Dumper; |
4 | 6 |
use utf8; |
5 | 7 |
|
8 |
use_ok 'Support::TestSetup'; |
|
6 | 9 |
use_ok 'SL::Helper::Csv'; |
7 |
my $csv; |
|
8 | 10 |
|
9 |
$csv = SL::Helper::Csv->new( |
|
11 |
Support::TestSetup::login(); |
|
12 |
|
|
13 |
my $csv = SL::Helper::Csv->new( |
|
10 | 14 |
file => \"Kaffee\n", |
11 | 15 |
header => [ 'description' ], |
12 | 16 |
class => 'SL::DB::Part', |
... | ... | |
17 | 21 |
isa_ok $csv->parse, 'SL::Helper::Csv', 'parsing returns self'; |
18 | 22 |
is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'simple case works'; |
19 | 23 |
|
20 |
|
|
21 | 24 |
is $csv->get_objects->[0]->description, 'Kaffee', 'get_object works'; |
22 | 25 |
#### |
23 | 26 |
|
24 |
{ |
|
25 |
no warnings 'once'; |
|
26 |
$::dispatcher = SL::Dispatcher->new; |
|
27 |
$::dispatcher->pre_startup_setup(); |
|
28 |
} |
|
29 |
|
|
30 |
$::form = Form->new; |
|
31 | 27 |
$::myconfig{numberformat} = '1.000,00'; |
32 | 28 |
$::myconfig{dateformat} = 'dd.mm.yyyy'; |
33 |
$::locale = Locale->new('de'); |
|
34 | 29 |
|
35 | 30 |
$csv = SL::Helper::Csv->new( |
36 | 31 |
file => \"Kaffee;0.12;12,2;1,5234\n", |
Auch abrufbar als: Unified diff
Tests von Dispatcher auf TestSetup umgeschrieben.
Dispatcher kann keine validen Datenbankhandle zur richtigen Zeit bereitstellen,
und die Mechanismen gegen kaputte DB Handle vertragen sich nicht mit reinem
offline Testing.