1 # Copyright (C) 2009 Alex Schroeder <alex@gnu.org>
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 use Test::More tests => 6;
20 AppendStringToFile($ConfigFile, "\$EditPass = 'bar';\n");
21 test_page(update_page('test', 'normal edit'),
23 test_page(get_page('action=password'),
24 'You are a normal user on this site');
26 # test problem reported by Gauthier
27 WriteStringToFile($ConfigFile, <<'EOT');
29 $AdminPass = 'foo' unless defined $AdminPass;
30 $EditPass = 'bar' unless defined $EditPass;
31 $ScriptName = 'http://localhost/wiki.pl';
33 $CommentsPrefix = 'Comments on ';
34 $LocalNamesCollect = 1;
37 # using the above settings results in no permission to edit normal
39 test_page(update_page('normal_page', 'normal edit'),
40 'This page is empty');
41 test_page(update_page('normal_page', 'admin edit', 0, 0, 1),
42 'This page is empty');
45 WriteStringToFile($ConfigFile, <<'EOT');
49 $ScriptName = 'http://localhost/wiki.pl';
51 $CommentsPrefix = 'Comments on ';
52 $LocalNamesCollect = 1;
55 # using the password works, now
56 test_page(update_page('normal_page', 'normal edit'),
57 'This page is empty');
58 test_page(update_page('normal_page', 'admin edit', 0, 0, 1),