Sindbad~EG File Manager

Current Path : /var/www/web3/modules/imageblock/test/phpunit/
Upload File :
Current File : /var/www/web3/modules/imageblock/test/phpunit/ImageBlockSiteAdminControllerTest.class

<?php
/*
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2008 Bharat Mediratta
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 */

/**
 * ImageBlockSiteAdmin controller tests
 *
 * @package ImageBlock
 * @subpackage PHPUnit
 * @author Alan Harder <alan.harder@sun.com>
 * @version $Revision: 17580 $
 */
class ImageBlockSiteAdminControllerTest extends GalleryControllerTestCase {

    function ImageBlockSiteAdminControllerTest($methodName) {
	$this->GalleryControllerTestCase($methodName, 'imageblock.ImageBlockSiteAdmin');
    }

    function setUp() {
	$ret = parent::setUp();
	if ($ret) {
	   return $ret;
	}

	$ret = $this->_markPluginParametersForCleanup('module', 'imageblock');
	if ($ret) {
	    return $ret;
	}
    }

    function testImageBlockSiteAdminControllerReset() {
	GalleryUtilities::putRequestVariable('form[action][reset]', '1');

	/* Perform the request and verify that we succeeded */
	$results = $this->handleRequest();
	$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
						   'subView' => 'imageblock.ImageBlockSiteAdmin'),
				  'status' => array(),
				  'error' => array()),
			    $results);
    }

    function testImageBlockSiteAdminControllerSaveNone() {
	GalleryUtilities::putRequestVariable('form[action][save]', '1');

	/* Perform the request and verify that we succeeded */
	$results = $this->handleRequest();
	$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
						   'subView' => 'imageblock.ImageBlockSiteAdmin'),
				  'status' => array('saved' => 1),
				  'error' => array()),
			    $results);
    }

    function testImageBlockSiteAdminControllerSaveOne() {
	GalleryUtilities::putRequestVariable('form[action][save]', '1');
	GalleryUtilities::putRequestVariable('form[date]', '1');

	/* Perform the request and verify that we succeeded */
	$results = $this->handleRequest();
	$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
						   'subView' => 'imageblock.ImageBlockSiteAdmin'),
				  'status' => array('saved' => 1),
				  'error' => array()),
			    $results);

	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'imageblock');
	if ($ret) {
	    return $ret;
	}
	$this->assertEquals('date', $params['show']);
    }

    function testImageBlockSiteAdminControllerSaveMultiple() {
	GalleryUtilities::putRequestVariable('form[action][save]', '1');
	GalleryUtilities::putRequestVariable('form[title]', '1');
	GalleryUtilities::putRequestVariable('form[views]', '1');
	GalleryUtilities::putRequestVariable('form[albumFrame]', 'solid');

	/* Perform the request and verify that we succeeded */
	$results = $this->handleRequest();
	$this->assertEquals(array('redirect' => array('view' => 'core.SiteAdmin',
						   'subView' => 'imageblock.ImageBlockSiteAdmin'),
				  'status' => array('saved' => 1),
				  'error' => array()),
			    $results);

	list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'imageblock');
	if ($ret) {
	    return $ret;
	}
	$this->assertEquals('title|views', $params['show']);
	$this->assertEquals('solid', $params['albumFrame']);
    }
}
?>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists