~ubuntu-branches/ubuntu/hardy/gallery2/hardy-security

« back to all changes in this revision

Viewing changes to modules/core/test/phpunit/AdminThemesControllerTest.class

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2006-04-16 16:42:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060416164235-8uy0u4bfjdxpge2o
Tags: 2.1.1-1
* New upstream release (Closes: #362936)
  + Bugfixes for Postgres7 (Closes: #359000, #362152)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * $RCSfile: AdminThemesControllerTest.class,v $
4
4
 *
5
5
 * Gallery - a web based photo album viewer and editor
6
 
 * Copyright (C) 2000-2005 Bharat Mediratta
 
6
 * Copyright (C) 2000-2006 Bharat Mediratta
7
7
 *
8
8
 * This program is free software; you can redistribute it and/or modify
9
9
 * it under the terms of the GNU General Public License as published by
20
20
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
21
21
 */
22
22
/**
23
 
 * @version $Revision: 1.4 $ $Date: 2005/08/23 03:49:33 $
 
23
 * @version $Revision: 1.6 $ $Date: 2006/03/18 03:40:20 $
24
24
 * @package GalleryCore
25
25
 * @subpackage PHPUnit
26
26
 * @author Bharat Mediratta <bharat@menalto.com>
27
27
 */
28
 
GalleryCoreApi::relativeRequireOnce('modules/core/classes/GalleryTheme.class');
 
28
GalleryCoreApi::requireOnce('modules/core/classes/GalleryTheme.class');
29
29
 
30
30
/**
31
31
 * AdminThemes controller tests
46
46
        $this->_testTheme->resetCalls();
47
47
 
48
48
        $ret = $this->_markPluginParametersForCleanup('module', 'core');
49
 
        if ($ret->isError()) {
 
49
        if ($ret) {
50
50
            print $ret->getAsHtml();
51
51
            return $ret->wrap(__FILE__, __LINE__);
52
52
        }
189
189
 
190
190
        $ret = GalleryCoreApi::setPluginParameter(
191
191
            'module', 'core', 'default.theme', 'AdminThemesControllerTest');
192
 
        if ($ret->isError()) {
 
192
        if ($ret) {
193
193
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
194
194
        }
195
195
 
304
304
                            $results);
305
305
 
306
306
        list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'core');
307
 
        if ($ret->isError()) {
 
307
        if ($ret) {
308
308
            return $this->failWithStatus($ret->wrap(__FILE__, __LINE__));
309
309
        }
310
310
 
343
343
                            'type' => 'text-field',
344
344
                            'typeParams' => array('size' => 2),
345
345
                            'value' => 99);
346
 
        return array(GalleryStatus::success(), $settings);
 
346
        return array(null, $settings);
347
347
    }
348
348
 
349
349
    /**
362
362
    }
363
363
 
364
364
    function isActive() {
365
 
        return array(GalleryStatus::success(), true);
 
365
        return array(null, true);
366
366
    }
367
367
}
368
368
 
385
385
    function setParameter($key, $value) {
386
386
        $map =& $this->getMap();
387
387
        $map[$key] = $value;
388
 
        return GalleryStatus::success();
 
388
        return null;
389
389
    }
390
390
 
391
391
    function TestThemeId2Theme() {
408
408
                            'type' => 'text-field',
409
409
                            'typeParams' => array('size' => 2),
410
410
                            'value' => 3);
411
 
        return array(GalleryStatus::success(), $settings);
 
411
        return array(null, $settings);
412
412
    }
413
413
 
414
414
    /**
419
419
    }
420
420
 
421
421
    function isActive() {
422
 
        return array(GalleryStatus::success(), true);
 
422
        return array(null, true);
423
423
    }
424
424
}
425
425
 
451
451
 
452
452
    function init() {
453
453
        $this->_setCalled('init');
454
 
        return GalleryStatus::success();
 
454
        return null;
455
455
    }
456
456
 
457
457
    function installOrUpgrade() {
458
458
        $this->_setCalled('installOrUpgrade');
459
 
        return GalleryStatus::success();
 
459
        return null;
460
460
    }
461
461
 
462
462
    function activate() {
463
463
        $this->_setCalled('activate');
464
 
        return array(GalleryStatus::success(), array());
 
464
        return array(null, array());
465
465
    }
466
466
 
467
467
    function uninstall() {
468
468
        $this->_setCalled('uninstall');
469
 
        return GalleryStatus::success();
 
469
        return null;
470
470
    }
471
471
 
472
472
    function deactivate() {
473
473
        $this->_setCalled('deactivate');
474
 
        return array(GalleryStatus::success(), array());
 
474
        return array(null, array());
475
475
    }
476
476
 
477
477
    function _setCalled($function) {
496
496
 
497
497
    function isActive() {
498
498
        $singleton = &$this->getSingleton();
499
 
        return array(GalleryStatus::success(), $singleton->_isActive);
 
499
        return array(null, $singleton->_isActive);
500
500
    }
501
501
 
502
502
    function isAdvancedSettings() {
503
503
        $singleton = &$this->getSingleton();
504
504
        return $singleton->_isAdvancedSettings;
505
505
    }
 
506
 
 
507
    function translate($str) {
 
508
        return $str;
 
509
    }
506
510
}
507
511
?>