From: <gem...@li...> - 2013-01-10 17:08:56
|
Revision: 1093 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1093&view=rev Author: matijsdejong Date: 2013-01-10 17:08:49 +0000 (Thu, 10 Jan 2013) Log Message: ----------- Updated tests and default installation to 1.6 Modified Paths: -------------- trunk/new_project/application/configs/application.ini trunk/test/bootstrap.php trunk/test/library/Gems/Test/DbTestAbstract.php trunk/test/library/Gems/Test/TestAbstract.php trunk/test/library/project-bootstrap.php Modified: trunk/new_project/application/configs/application.ini =================================================================== --- trunk/new_project/application/configs/application.ini 2013-01-10 16:43:36 UTC (rev 1092) +++ trunk/new_project/application/configs/application.ini 2013-01-10 17:08:49 UTC (rev 1093) @@ -5,6 +5,8 @@ bootstrap.path = "NewProject/Escort.php" bootstrap.class = "NewProject_Escort" +loaderDirs.NewProject = APPLICATION_PATH "/classes/NewProject" +loaderDirs.Gems = GEMS_LIBRARY_DIR "/classes/Gems" ; resources.db.adapter = PDO_MYSQL resources.db.adapter = Mysqli resources.db.params.charset = utf8 @@ -31,3 +33,4 @@ phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 firebug.log = 1 +zfdebug.activate = 0 Modified: trunk/test/bootstrap.php =================================================================== --- trunk/test/bootstrap.php 2013-01-10 16:43:36 UTC (rev 1092) +++ trunk/test/bootstrap.php 2013-01-10 17:08:49 UTC (rev 1093) @@ -3,7 +3,7 @@ /** * Copyright (c) 2011, Erasmus MC * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -14,7 +14,7 @@ * * Neither the name of Erasmus MC nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -25,7 +25,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * Unit test bootstrap * * @author Michiel Rook <mi...@to...> @@ -33,10 +33,7 @@ * @package Gems */ -// Needed for strict on >= PHP 5.1.2 -if (version_compare(phpversion(), '5.1.2') > 0) { - date_default_timezone_set('Europe/Amsterdam'); -} +date_default_timezone_set('Europe/Amsterdam'); /** * Setup environment @@ -49,11 +46,6 @@ define('APPLICATION_ENV', 'development'); define('APPLICATION_PATH', GEMS_ROOT_DIR . '/application'); -$GLOBALS['GEMS_DIRS'] = array( - GEMS_PROJECT_NAME_UC => APPLICATION_PATH . '/classes', - 'Gems' => GEMS_LIBRARY_DIR . '/classes' -); - /** * Setup include path */ Modified: trunk/test/library/Gems/Test/DbTestAbstract.php =================================================================== --- trunk/test/library/Gems/Test/DbTestAbstract.php 2013-01-10 16:43:36 UTC (rev 1092) +++ trunk/test/library/Gems/Test/DbTestAbstract.php 2013-01-10 17:08:49 UTC (rev 1093) @@ -70,14 +70,14 @@ protected function setUp() { parent::setUp(); - - global $GEMS_DIRS; $this->db = $this->getConnection()->getConnection(); Zend_Registry::set('db', $this->db); - $this->loader = new Gems_Loader(Zend_Registry::getInstance(), $GEMS_DIRS); + $settings = new Zend_Config_Ini(GEMS_ROOT_DIR . '/application/configs/application.ini', APPLICATION_ENV); + $sa = $settings->toArray(); + $this->loader = new Gems_Loader(Zend_Registry::getInstance(), $sa['loaderDirs']); Zend_Registry::set('loader', $this->loader); } Modified: trunk/test/library/Gems/Test/TestAbstract.php =================================================================== --- trunk/test/library/Gems/Test/TestAbstract.php 2013-01-10 16:43:36 UTC (rev 1092) +++ trunk/test/library/Gems/Test/TestAbstract.php 2013-01-10 17:08:49 UTC (rev 1093) @@ -53,7 +53,7 @@ * @var Gems_Loader */ protected $loader = null; - + /** * @var Zend_Db */ @@ -63,25 +63,25 @@ * @var Gems_Tracker */ protected $tracker = null; - + /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { - global $GEMS_DIRS; - $this->db = Zend_Db::factory('pdo_sqlite', array('dbname'=>':memory:')); - + Zend_Registry::set('db', $this->db); - - $this->loader = new Gems_Loader(Zend_Registry::getInstance(), $GEMS_DIRS); - + + $settings = new Zend_Config_Ini(GEMS_ROOT_DIR . '/application/configs/application.ini', APPLICATION_ENV); + $sa = $settings->toArray(); + $this->loader = new Gems_Loader(Zend_Registry::getInstance(), $sa['loaderDirs']); + Zend_Registry::set('loader', $this->loader); - + $this->tracker = $this->loader->getTracker(); - + Zend_Registry::set('tracker', $this->tracker); } } Modified: trunk/test/library/project-bootstrap.php =================================================================== --- trunk/test/library/project-bootstrap.php 2013-01-10 16:43:36 UTC (rev 1092) +++ trunk/test/library/project-bootstrap.php 2013-01-10 17:08:49 UTC (rev 1093) @@ -16,11 +16,6 @@ define('APPLICATION_ENV', 'development'); define('APPLICATION_PATH', GEMS_ROOT_DIR . '/application'); -$GLOBALS['GEMS_DIRS'] = array( - GEMS_PROJECT_NAME_UC => APPLICATION_PATH . '/classes', - 'Gems' => GEMS_LIBRARY_DIR . '/classes' -); - /** * Setup include path */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |