All pastes #490830 Raw Edit

Something

public php v1 · immutable
·published 2007-05-16 08:21 UTC
rendered paste body
require_once("PHPUnit2/Framework/TestCase.php");require_once("../classes/db.php");require_once("../classes/authorization.php");class AuthTest extends PHPUnit2_Framework_TestCase {	var $auth;		function setUp() {		$this->auth = new Auth();	}	// test that getSetting() is working and that default configs are loaded	// in the constructor	function test_getSetting() {		print_r($this->auth->settings);		$this->assertEquals('localhost',$this->auth->getSetting('dbhost'));	}		// try to set a new value for a setting and check that it's working	function test_setSetting() {		print_r($this->auth->settings);		//$this->assertEquals('localhost',$this->auth->getSetting('dbhost'));		//$this->auth->setSetting('dbhost','127.0.0.1');		//$this->assertEquals('127.0.0.1',$this->auth->getSetting('dbhost'));	}	}/*********************************************************************************/$ phpunit2 AuthTest authTest.phpPHPUnit 2.3.6 by Sebastian Bergmann.Array(    [dbusername] =>    [dbpassword] =>    [dbhost] => localhost    [dbname] =>    [default_restrict] => 1    [authType] => HTTP    [redirectPage] => /    [authText] => Authorization required    [expires] => 0    [login_ses_expire] => 0    [accountConfirm] =>    [language] => en    [restrictedRedirect] => /index.php?forbidden    [logoutPage] => /index.php    [bannedPage] => /banned.php    [loginPage] => /login.php    [close_db_after_use] =>    [db_to_variable] => mysql    [remember_login] =>).Array().Time: 0.017722OK (2 tests)