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
* PanoramaSiteAdmin controller tests
26
* @author Alan Harder <alan.harder@sun.com>
27
* @version $Revision: 15513 $
29
class PanoramaSiteAdminControllerTest extends GalleryControllerTestCase {
31
function PanoramaSiteAdminControllerTest($methodName) {
32
$this->GalleryControllerTestCase($methodName, 'panorama.PanoramaSiteAdmin');
38
$ret = $this->_markPluginParametersForCleanup('module', 'panorama');
40
print $ret->getAsHtml();
41
return $this->failWithStatus($ret);
45
function testPanoramaSiteAdminControllerUndo() {
46
GalleryUtilities::putRequestVariable('form[action][undo]', '1');
48
$results = $this->handleRequest();
49
$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
50
'subView' => 'panorama.PanoramaSiteAdmin'),
56
function testPanoramaSiteAdminControllerSave() {
57
GalleryUtilities::putRequestVariable('form[itemLink]', '1');
58
GalleryUtilities::putRequestVariable('form[width]', '1000');
59
GalleryUtilities::putRequestVariable('form[action][save]', '1');
61
$results = $this->handleRequest();
62
$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
63
'subView' => 'panorama.PanoramaSiteAdmin'),
64
'status' => array('saved' => 1),
69
function testPanoramaSiteAdminControllerSaveNoWidth() {
71
GalleryUtilities::putRequestVariable('form[itemType]', '1');
72
GalleryUtilities::putRequestVariable('form[action][save]', '1');
74
$results = $this->handleRequest();
75
$this->assertEquals(array('delegate' => array('view' => 'core.SiteAdmin',
76
'subView' => 'panorama.PanoramaSiteAdmin'),
78
'error' => array('form[error][width]')),
82
function testPanoramaSiteAdminControllerSaveBadWidth() {
84
GalleryUtilities::putRequestVariable('form[width]', 'abc5000');
85
GalleryUtilities::putRequestVariable('form[action][save]', '1');
87
$results = $this->handleRequest();
88
$this->assertEquals(array('delegate' => array('view' => 'core.SiteAdmin',
89
'subView' => 'panorama.PanoramaSiteAdmin'),
91
'error' => array('form[error][width]')),