Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a67ad20f

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID a67ad20f388cd35487a7a9d46a003e39e1f402aa
  • Vorgänger 0b5b8355
  • Nachfolger e3b5a9ce

Tests: Tests skippen, wenn Template-Cache-Verzeichnis nicht schreibbar ist

Unterschiede anzeigen:

t/Support/TestSetup.pm
4 4

  
5 5
use Data::Dumper;
6 6
use CGI qw( -no_xhtml);
7
use IO::File;
7 8
use SL::Auth;
8 9
use SL::Form;
9 10
use SL::Locale;
......
56 57
  _login($client, $login);
57 58
}
58 59

  
60
sub templates_cache_writable {
61
  my $dir = $::lx_office_conf{paths}->{userspath} . '/templates-cache';
62
  return 1 if -w $dir;
63

  
64
  # Try actually creating a file. Due to ACLs this might be possible
65
  # even if the basic Unix permissions and Perl's -w test say
66
  # otherwise.
67
  my $file = "${dir}/.writetest";
68
  my $out  = IO::File->new($file, "w") || return 0;
69
  $out->close;
70
  unlink $file;
71

  
72
  return 1;
73
}
74

  
59 75
1;
t/controllers/base/render.t
14 14

  
15 15
Support::TestSetup::login();
16 16

  
17
if (!Support::TestSetup::templates_cache_writable()) {
18
  plan skip_all => 'Cache dir not writable for this test';
19
} else {
20
  plan tests => 19;
21
}
22

  
17 23
sub reset_test_env {
18 24
  $ENV{HTTP_USER_AGENT} = 'Perl Tests';
19 25

  
t/presenter/base/render.t
9 9

  
10 10
Support::TestSetup::login();
11 11

  
12
if (!Support::TestSetup::templates_cache_writable()) {
13
  plan skip_all => 'Cache dir not writable for this test';
14
} else {
15
  plan tests => 11;
16
}
17

  
12 18
my $pr = SL::Presenter->get;
13 19

  
14 20
# Passing invalid parameters:

Auch abrufbar als: Unified diff