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
* AdminToolkitPriority controller tests
23
* @package GalleryCore
25
* @author Alan Harder <alan.harder@sun.com>
26
* @version $Revision: 15513 $
28
class AdminToolkitPriorityControllerTest extends GalleryControllerTestCase {
30
function AdminToolkitPriorityControllerTest($methodName) {
31
$this->GalleryControllerTestCase($methodName, 'core.AdminToolkitPriority');
37
$ret = GalleryCoreApi::registerToolkitOperation('TestToolkitPriority',
38
array('test/type'), 'test-operation', array(),
39
'test-description', 'test/outputType', 30);
41
return $this->failWithStatus($ret);
43
$this->_markToolkitForCleanup('TestToolkitPriority');
45
$ret = GalleryCoreApi::registerToolkitOperation('TestToolkitPriority2',
46
array('test/type'), 'test-operation', array(),
47
'test-description', 'test/outputType', 27);
49
return $this->failWithStatus($ret);
51
$this->_markToolkitForCleanup('TestToolkitPriority2');
54
function testReset() {
55
GalleryUtilities::putRequestVariable('form[action][reset]', 1);
57
$results = $this->handleRequest();
58
$this->assertEquals(array('return' => 0,
59
'redirect' => array('view' => 'core.SiteAdmin',
60
'subView' => 'core.AdminToolkitPriority'),
67
GalleryUtilities::putRequestVariable('form[action][save]', 1);
68
GalleryUtilities::putRequestVariable('form[priority][27]', 'TestToolkitPriority');
69
GalleryUtilities::putRequestVariable('form[priority][30]', 'TestToolkitPriority2');
71
$results = $this->handleRequest();
72
$this->assertEquals(array('return' => 0,
73
'redirect' => array('view' => 'core.SiteAdmin',
74
'subView' => 'core.AdminToolkitPriority'),
75
'status' => array('saved' => 1),
79
list ($ret, $list) = GalleryCoreApi::getRedundantToolkitPriorities();
81
return $this->failWithStatus($ret);
84
$this->assert(count($list) >= 2, 'count');
85
$this->assertEquals(27, $list['TestToolkitPriority'], 'TestToolkitPriority');
86
$this->assertEquals(30, $list['TestToolkitPriority2'], 'TestToolkitPriority2');
93
* @package GalleryCore
96
class TestToolkitPriority { }
101
* @package GalleryCore
102
* @subpackage PHPUnit
104
class TestToolkitPriority2 { }