Revision 6b378ca7
Von Sven Schöling vor fast 13 Jahren hinzugefügt
t/helper/attr.t | ||
---|---|---|
1 | 1 |
use Test::More tests => 29; |
2 | 2 |
|
3 |
use lib 't'; |
|
4 |
|
|
3 | 5 |
use DateTime; |
4 | 6 |
|
7 |
use_ok 'Support::TestSetup'; |
|
5 | 8 |
use_ok 'SL::DB::Part'; |
6 | 9 |
use_ok 'SL::DB::Order'; |
7 | 10 |
use_ok 'SL::DB::Invoice'; |
8 |
use_ok 'SL::Dispatcher'; |
|
9 | 11 |
|
12 |
Support::TestSetup::login(); |
|
10 | 13 |
|
11 | 14 |
{ |
12 |
$::dispatcher = SL::Dispatcher->new; |
|
13 |
$::dispatcher->pre_startup_setup; |
|
14 |
no warnings 'once'; |
|
15 |
$::form = Form->new; |
|
16 | 15 |
$::myconfig{numberformat} = '1.000,00'; |
17 | 16 |
$::myconfig{dateformat} = 'dd.mm.yyyy'; |
18 |
$::locale = Locale->new('de'); |
|
19 | 17 |
} |
20 | 18 |
|
21 | 19 |
my $p = new_ok 'SL::DB::Part'; |
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.