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
* LinkItemSiteAdmin controller tests
26
* @author Alan Harder <alan.harder@sun.com>
27
* @version $Revision: 15513 $
29
class LinkItemSiteAdminControllerTest extends GalleryControllerTestCase {
31
function LinkItemSiteAdminControllerTest($methodName) {
32
$this->GalleryControllerTestCase($methodName, 'linkitem.LinkItemSiteAdmin');
38
$ret = $this->_markPluginParametersForCleanup('module', 'linkitem');
40
print $ret->getAsHtml();
41
return $this->failWithStatus($ret);
45
function testReset() {
46
GalleryUtilities::putRequestVariable('form[action][reset]', '1');
48
$results = $this->handleRequest();
49
$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
50
'subView' => 'linkitem.LinkItemSiteAdmin'),
57
GalleryUtilities::putRequestVariable('form[urlSnapshot]', '1');
58
GalleryUtilities::putRequestVariable('form[snapshotExec]', 'khtml2png %URL%');
59
GalleryUtilities::putRequestVariable('form[action][save]', '1');
61
$results = $this->handleRequest();
62
$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
63
'subView' => 'linkitem.LinkItemSiteAdmin'),
64
'status' => array('saved' => 1),
68
foreach (array('arrowWatermark' => '0', 'urlSnapshot' => '1',
69
'snapshotExec' => 'khtml2png %URL%') as $key => $expectedValue) {
71
GalleryCoreApi::getPluginParameter('module', 'linkitem', $key);
73
return $this->failWithStatus($ret);
75
$this->assertEquals($expectedValue, $value, $key);