Revision a67ad20f
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
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; |
Auch abrufbar als: Unified diff
Tests: Tests skippen, wenn Template-Cache-Verzeichnis nicht schreibbar ist