* @copyright 2004 by gERD Schaufelberger * @package gsSite * @subpackage test */ /** * * * @version 0.1 * @package gsSite * @subpackage test */ class DataSourceTester { var $ds = null; /** * constructor * @access public */ function __construct() { $this->ds = wbFactory::singleton( 'wbDatasource' ); } /** * Constructor for PHP 4 * @access public */ function DataSourceTester() { $this->__construct(); } /** * run the test * * * @access public * @return boolean $result true on success */ function test() { /* $user = array( 'user' => 'david', 'password' => md5( 'david123' ), 'realname' => 'David Quaglieri', 'email' => 'dquagleri@gumnut.com.au', 'flags' => 'enabled' ); $this->ds->save( 'user', 'new', $user ); */ /* $data = array( 'group' => 'German' ); $this->ds->save( 'group', 'new', $data ); */ $users = $this->ds->getEntries( 'user' ); echo "users\n
";
		print_r( $users );
		echo "
\n"; $pu = $this->ds->getPrimaryKey( 'user' ); $pg = $this->ds->getPrimaryKey( 'group' ); /* foreach( $users as $user ) { $data = array( $pu => $user[$pu], $pg => 3 ); $this->ds->save( 'usergroup', 'new', $data ); } */ echo $this->ds->count( 'user' ); return true; } } ?>