3
* Gallery - a web based photo album viewer and editor
4
* Copyright (C) 2000-2007 Bharat Mediratta
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or (at
9
* your option) any later version.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
22
* Test Register module functionality
23
* @package Registration
25
* @author Alan Harder <alan.harder@sun.com>
26
* @version $Revision: 15513 $
28
class RegisterModuleTest extends GalleryTestCase {
30
function RewriteModuleTest($methodName) {
31
$this->GalleryTestCase($methodName);
37
list ($ret, $this->_module) = GalleryCoreApi::loadPlugin('module', 'register');
39
print $ret->getAsHtml();
40
return $this->failWithStatus($ret);
44
function testSystemLinks() {
46
$label = $this->_module->translate('Register');
48
list ($ret, $links) = $this->_module->getSystemLinks();
50
return $this->failWithStatus($ret);
52
/* None for non-guest */
53
$this->assertEquals(array(), $links, 'admin');
55
$gallery->setConfig('anonymousUserId', $gallery->getActiveUserId());
56
list ($ret, $links) = $this->_module->getSystemLinks();
58
return $this->failWithStatus($ret);
61
array('Register' => array('text' => $label,
62
'params' => array('view' => 'core.UserAdmin',
63
'subView' => 'register.UserSelfRegistration',
65
$links, 'alternate guest');
67
$gallery->setConfig('anonymousUserId', null);
68
$this->_becomeGuestUser();
69
list ($ret, $links) = $this->_module->getSystemLinks();
71
return $this->failWithStatus($ret);
74
array('Register' => array('text' => $label,
75
'params' => array('view' => 'core.UserAdmin',
76
'subView' => 'register.UserSelfRegistration',