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
* AlbumSelectSiteAdmin controller tests
24
* @package AlbumSelect
26
* @author Alan Harder <alan.harder@sun.com>
27
* @version $Revision: 15513 $
29
class AlbumSelectSiteAdminControllerTest extends GalleryControllerTestCase {
31
function AlbumSelectSiteAdminControllerTest($methodName) {
32
$this->GalleryControllerTestCase($methodName, 'albumselect.AlbumSelectSiteAdmin');
38
$ret = $this->_markPluginParametersForCleanup('module', 'albumselect');
40
print $ret->getAsHtml();
45
function testAlbumSelectSiteAdminControllerReset() {
46
GalleryUtilities::putRequestVariable('form[action][reset]', '1');
48
$results = $this->handleRequest();
49
$this->assertEquals(array('redirect' => array(
50
'view' => 'core.SiteAdmin',
51
'subView' => 'albumselect.AlbumSelectSiteAdmin'),
57
function testAlbumSelectSiteAdminControllerSave() {
58
GalleryUtilities::putRequestVariable('form[sort]', 'manual');
59
GalleryUtilities::putRequestVariable('form[treeIcons]', '1');
60
GalleryUtilities::putRequestVariable('form[treeCloseSameLevel]', '1');
61
GalleryUtilities::putRequestVariable('form[action][save]', '1');
63
$results = $this->handleRequest();
64
$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
65
'subView' => 'albumselect.AlbumSelectSiteAdmin'),
66
'status' => array('saved' => 1),
70
foreach (array('sort' => 'manual', 'treeLines' => '0',
71
'treeIcons' => '1', 'treeCookies' => '0', 'treeExpandCollapse' => '0',
72
'treeCloseSameLevel' => '1') as $key => $expectedValue) {
73
list ($ret, $value) = GalleryCoreApi::getPluginParameter('module', 'albumselect', $key);
75
return $this->failWithStatus($ret);
77
$this->assertEquals($expectedValue, $value, $key);