Revision 9c6cbe0f
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
t/Support/TestSetup.pm | ||
---|---|---|
34 | 34 |
die "Cannot find client with ID or name '$client'" if !$::auth->set_client($client); |
35 | 35 |
|
36 | 36 |
$::instance_conf = SL::InstanceConfiguration->new; |
37 |
$::request = SL::Request->new( cgi => CGI->new({}), layout => SL::Layout::None->new );
|
|
37 |
$::request = Support::TestSetup->create_new_request;
|
|
38 | 38 |
|
39 | 39 |
die 'cannot reach auth db' unless $::auth->session_tables_present; |
40 | 40 |
|
... | ... | |
52 | 52 |
return 1; |
53 | 53 |
} |
54 | 54 |
|
55 |
sub create_new_form { |
|
56 |
my $form = Form->new(''); |
|
57 |
$form->template(Template->new(template_config())) || die; |
|
58 |
return $form; |
|
55 |
sub create_new_form { Form->new('') } |
|
56 |
|
|
57 |
sub create_new_request { |
|
58 |
my $self = shift; |
|
59 |
|
|
60 |
my $request = SL::Request->new( |
|
61 |
cgi => CGI->new({}), |
|
62 |
layout => SL::Layout::None->new, |
|
63 |
@_, |
|
64 |
); |
|
65 |
|
|
66 |
$request->presenter->{template} = Template->new(template_config()) || die; |
|
67 |
|
|
68 |
return $request; |
|
59 | 69 |
} |
60 | 70 |
|
61 | 71 |
sub template_config { |
t/controllers/base/render.t | ||
---|---|---|
17 | 17 |
sub reset_test_env { |
18 | 18 |
$ENV{HTTP_USER_AGENT} = 'Perl Tests'; |
19 | 19 |
|
20 |
$::request = SL::Request->new( |
|
21 |
cgi => CGI->new({}), |
|
20 |
$::request = Support::TestSetup->create_new_request( |
|
22 | 21 |
layout => SL::Layout::Javascript->new, |
23 | 22 |
); |
24 | 23 |
|
Auch abrufbar als: Unified diff
Tests: Template-Objekt aus Presenter in eigenes Verzeichnis cachen lassen