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
* MembersAdmin controller tests
26
* @author Robert Balousek <rbalousek@hotmail.com>
27
* @version $Revision: 15513 $
29
class MembersAdminControllerTest extends GalleryControllerTestCase {
31
function MembersAdminControllerTest($methodName) {
32
$this->GalleryControllerTestCase($methodName, 'members.AdminMembers');
38
$ret = $this->_markPluginParametersForCleanup('module', 'members');
40
print $ret->getAsHtml();
45
function testMembersAdminControllerReset() {
47
GalleryUtilities::putRequestVariable('form[action][reset]', '1');
49
/* Perform the request and verify that we succeeded */
50
$results = $this->handleRequest();
51
$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
52
'subView' => 'members.AdminMembers'),
58
function testMembersAdminControllerSave() {
60
GalleryUtilities::putRequestVariable('form[action][save]', '1');
61
GalleryUtilities::putRequestVariable('form[canViewMembersModule]', '2');
62
GalleryUtilities::putRequestVariable('form[canViewEmailAddress]', '0');
64
/* Perform the request and verify that we succeeded */
65
$results = $this->handleRequest();
66
$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
67
'subView' => 'members.AdminMembers'),
68
'status' => array('saved' => 1),
72
/* TODO: verify that the parameters were actually saved properly to the database */