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
* SwitchDetailMode controller tests
25
* @author Don Willingham <donwillingham@users.sf.net>
26
* @version $Revision: 15513 $
28
class Getid3DetailModeControllerTest extends GalleryControllerTestCase {
30
function Getid3DetailModeControllerTest($methodName) {
31
$this->GalleryControllerTestCase($methodName, 'getid3:Getid3DetailMode');
34
function testSwitchToSummary() {
36
GalleryUtilities::putRequestVariable('mode', 'summary');
38
/* Perform the request and verify that we succeeded */
39
$results = $this->handleRequest();
40
$this->assertEquals(array('return' => 1,
41
'redirect' => array('view' => 'core.ShowItem'),
46
/* Verify that we're in the right mode now */
47
$session =& $gallery->getSession();
48
if (!$session->exists('getid3.module.LoadGetid3Info.mode')) {
49
$this->fail('Missing session value');
51
$this->assertEquals('summary', $session->get('getid3.module.LoadGetid3Info.mode'));
54
function testSwitchToDetailed() {
56
GalleryUtilities::putRequestVariable('mode', 'detailed');
58
/* Perform the request and verify that we succeeded */
59
$results = $this->handleRequest();
60
$this->assertEquals(array('return' => 1,
61
'redirect' => array('view' => 'core.ShowItem'),
66
/* Verify that we're in the right mode now */
67
$session =& $gallery->getSession();
68
if (!$session->exists('getid3.module.LoadGetid3Info.mode')) {
69
$this->fail('Missing session value');
71
$this->assertEquals('detailed', $session->get('getid3.module.LoadGetid3Info.mode'));
74
function testSwitchToBogus() {
76
GalleryUtilities::putRequestVariable('mode', 'BoGuS');
78
/* Perform the request and verify that we succeeded */
79
$results = $this->handleRequest();
80
$this->assertEquals(array('return' => 1,
81
'redirect' => array('view' => 'core.ShowItem'),
86
/* Verify that we're in the right mode now */
87
$session =& $gallery->getSession();
88
if (!$session->exists('getid3.module.LoadGetid3Info.mode')) {
89
$this->fail('Missing session value');
91
$this->assertEquals('summary', $session->get('getid3.module.LoadGetid3Info.mode'));