Revision 1bed9601
Von Kivitendo Admin vor etwa 7 Jahren hinzugefügt
SL/Dev/File.pm | ||
---|---|---|
7 | 7 |
|
8 | 8 |
use SL::DB::File; |
9 | 9 |
|
10 |
my %common_params = ( |
|
11 |
object_id => 1, |
|
12 |
object_type => 'sales_order', |
|
13 |
); |
|
14 |
|
|
15 | 10 |
sub create_scanned { |
16 | 11 |
my (%params) = @_; |
17 | 12 |
$params{source} = 'scanner1'; |
... | ... | |
44 | 39 |
my (%params) = @_; |
45 | 40 |
|
46 | 41 |
my $fileobj = SL::File->save( |
47 |
%common_params,
|
|
48 |
mime_type => 'text/plain',
|
|
49 |
description => 'Test File',
|
|
50 |
file_type => $params{file_type},
|
|
51 |
source => $params{source},
|
|
52 |
file_name => $params{file_name},
|
|
53 |
file_contents => $params{file_contents},
|
|
54 |
file_path => $params{file_path}
|
|
42 |
mime_type => 'text/plain',
|
|
43 |
description => 'Test File',
|
|
44 |
%params,
|
|
45 |
# file_type => $params{file_type},
|
|
46 |
# source => $params{source},
|
|
47 |
# file_name => $params{file_name},
|
|
48 |
# file_contents => $params{file_contents},
|
|
49 |
# file_path => $params{file_path}
|
|
55 | 50 |
); |
56 | 51 |
return $fileobj; |
57 | 52 |
} |
58 | 53 |
|
59 |
sub get_all { SL::File->get_all (%common_params, @_) } |
|
60 |
sub get_all_count { SL::File->get_all_count (%common_params, @_) } |
|
61 |
sub get_all_versions { SL::File->get_all_versions(%common_params, @_) } |
|
62 |
sub delete_all { SL::File->delete_all (%common_params, @_) } |
|
63 |
|
|
64 | 54 |
1; |
65 | 55 |
|
66 | 56 |
__END__ |
Auch abrufbar als: Unified diff
SL::Dev::File und t/file/filesystem.t überarbeitet
SL/Dev/File.pm:
filesystem.t, daher in den Test verlagert.
Anzahl der zu tippenden Zeichen in Tests verringern, sondern allgemeine
Funktionen für verschiedene Tests bereitstellen oder sinnvolle Defaults
vorbelegen