[Cs-webapplibs-commits] SF.net SVN: cs-webapplibs:[171] trunk/0.3/tests
Status: Beta
Brought to you by:
crazedsanity
From: <cra...@us...> - 2010-06-21 15:12:18
|
Revision: 171 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=171&view=rev Author: crazedsanity Date: 2010-06-21 15:12:12 +0000 (Mon, 21 Jun 2010) Log Message: ----------- Minor changes to make tests work, separate out the generic permissions stuff into its own test file. Modified Paths: -------------- trunk/0.3/tests/testOfCSWebAppLibs.php Added Paths: ----------- trunk/0.3/tests/testOfCSGenericPermissions.php Copied: trunk/0.3/tests/testOfCSGenericPermissions.php (from rev 170, trunk/0.3/tests/testOfCSWebAppLibs.php) =================================================================== --- trunk/0.3/tests/testOfCSGenericPermissions.php (rev 0) +++ trunk/0.3/tests/testOfCSGenericPermissions.php 2010-06-21 15:12:12 UTC (rev 171) @@ -0,0 +1,76 @@ +<?php +/* + * Created on June 21, 2010 + * + * FILE INFORMATION: + * + * $HeadURL$ + * $Id$ + * $LastChangedDate$ + * $LastChangedBy$ + * $LastChangedRevision$ + */ + +class testOfCSGenericPermissions extends UnitTestCase { + + //-------------------------------------------------------------------------- + function __construct() { + $this->gfObj = new cs_globalFunctions; + $this->gfObj->debugPrintOpt=1; + if(!defined('CS_UNITTEST')) { + throw new exception(__METHOD__ .": FATAL: constant 'CS_UNITTEST' not set, can't do testing safely"); + } + }//end __construct() + //-------------------------------------------------------------------------- + + + + //-------------------------------------------------------------------------- + private function create_dbconn() { + $dbParams = array( + 'host' => constant('cs_webapplibs-DB_CONNECT_HOST'), + 'dbname' => constant('cs_webapplibs-DB_CONNECT_DBNAME'), + 'user' => constant('cs_webapplibs-DB_CONNECT_USER'), + 'password' => constant('cs_webapplibs-DB_CONNECT_PASSWORD'), + 'port' => constant('cs_webapplibs-DB_CONNECT_PORT') + ); + $db = new cs_phpDB(constant('DBTYPE')); + $db->connect($dbParams); + return($db); + }//end create_dbconn() + //-------------------------------------------------------------------------- + + + + //-------------------------------------------------------------------------- + private function remove_tables() { + $tableList = array( + 'cswal_gdl_object_table', 'cswal_gdl_attribute_table', 'cswal_gdl_path_table', + 'cswal_object_table', 'cswal_user_group_table', 'cswal_group_table' + ); + + $db = $this->create_dbconn(); + foreach($tableList as $name) { + try { + $db->run_update("DROP TABLE ". $name ." CASCADE", true); + } + catch(exception $e) { + //force an error. + //$this->assertTrue(false, "Error while dropping (". $name .")::: ". $e->getMessage()); + } + } + }//end remove_tables() + //-------------------------------------------------------------------------- + + + + //-------------------------------------------------------------------------- + public function test_userGroups() { + $perm = new cs_genericPermission($this->create_dbconn()); + }//end test_userGroups + //-------------------------------------------------------------------------- + + + +} +?> Modified: trunk/0.3/tests/testOfCSWebAppLibs.php =================================================================== --- trunk/0.3/tests/testOfCSWebAppLibs.php 2010-06-21 14:41:53 UTC (rev 170) +++ trunk/0.3/tests/testOfCSWebAppLibs.php 2010-06-21 15:12:12 UTC (rev 171) @@ -37,7 +37,7 @@ $db = new cs_phpDB(constant('DBTYPE')); $db->connect($dbParams); return($db); - }//end create_db() + }//end create_dbconn() //-------------------------------------------------------------------------- @@ -48,8 +48,7 @@ 'cswal_auth_token_table', 'cswal_version_table', 'cswal_attribute_table', 'cswal_category_table', 'cswal_class_table', 'cswal_event_table', 'cswal_log_attribute_table', 'cswal_log_table', 'cswal_session_store_table', - 'cswal_gdl_object_table', 'cswal_gdl_attribute_table', 'cswal_gdl_path_table', - 'cswal_object_table', 'cswal_user_group_table', 'cswal_group_table' + 'cswal_gdl_object_table', 'cswal_gdl_path_table', 'cswal_gdl_attribute_table' ); $db = $this->create_dbconn(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |