Changeset 126 for tags/2.0.1/tests
- Timestamp:
- May 24, 2006 6:07:38 AM (18 years ago)
- Location:
- tags/2.0.1/tests
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/2.0.1/tests/Auth_FileTest.php
r42 r126 23 23 require dirname(__FILE__) . '/_config.inc.php'; 24 24 require_once '../lib/Auth_File.inc.php'; 25 $this->Auth_File =& new Auth_File(array('htpasswd_file' => dirname(__FILE__) . '/_test_htpasswd')); 25 $this->Auth_File =& new Auth_File('test'); 26 $this->Auth_File->setParam(array('htpasswd_file' => dirname(__FILE__) . '/_test_htpasswd')); 26 27 } 27 28 … … 44 45 $result = $this->Auth_File->login('testuser', 'testpass'); 45 46 $this->assertTrue($result, 'testuser login failed.'); 46 $this->assertTrue($_SESSION['_auth ']['authenticated'], 'testuser authentication not found in session.');47 $this->assertTrue($_SESSION['_auth_test']['authenticated'], 'testuser authentication not found in session.'); 47 48 } 48 49 … … 51 52 $result = $this->Auth_File->login('testuser', 'testpass'); 52 53 $this->Auth_File->clearauth(); 53 $this->assertFalse($_SESSION['_auth ']['authenticated'], 'testuser authentication not false in session.');54 $this->assertFalse($_SESSION['_auth_test']['authenticated'], 'testuser authentication not false in session.'); 54 55 } 55 56 -
tags/2.0.1/tests/Auth_SQLTest.php
r42 r126 29 29 'db_login_table' => 'test_login_tbl', 30 30 'login_url' => '/login.php', 31 'blocking' => true 31 'blocking' => true, 32 'encryption_type' => AUTH_ENCRYPT_SHA1, 32 33 )); 33 34 … … 46 47 ) VALUES ( 47 48 'testuser', 48 md5('testpass'),49 '" . $this->Auth_SQL->encryptpassword('testpass') . "', 49 50 'John', 50 51 'Doe', … … 185 186 function test_encryptpassword() 186 187 { 188 $this->Auth_SQL->setParam(array('encryption_type' => AUTH_ENCRYPT_MD5)); 187 189 $result = $this->Auth_SQL->encryptpassword('123'); 188 190 $this->assertEquals('202cb962ac59075b964b07152d234b70', $result); 191 192 $this->Auth_SQL->setParam(array('encryption_type' => AUTH_ENCRYPT_SHA1)); 193 $result = $this->Auth_SQL->encryptpassword('123'); 194 $this->assertEquals('40bd001563085fc35165329ea1ff5c5ecbdbbeef', $result); 195 196 $this->Auth_SQL->setParam(array('encryption_type' => AUTH_ENCRYPT_PLAINTEXT)); 197 $result = $this->Auth_SQL->encryptpassword('123'); 198 $this->assertEquals('123', $result); 199 200 $this->Auth_SQL->setParam(array('encryption_type' => AUTH_ENCRYPT_CRYPT)); 201 $result = $this->Auth_SQL->encryptpassword('123', 'saltstring'); 202 $this->assertEquals('saEZ6MlWYV9nQ', $result); 189 203 } 190 204 … … 197 211 "); 198 212 list($pass) = mysql_fetch_row($qid); 199 $this->assertEquals(' 202cb962ac59075b964b07152d234b70', $pass);213 $this->assertEquals('40bd001563085fc35165329ea1ff5c5ecbdbbeef', $pass); 200 214 } 201 215 -
tags/2.0.1/tests/RecordLockTest.php
r42 r126 49 49 ) VALUES ( 50 50 'testuser', 51 md5('testpass'),51 '" . $this->Auth_SQL->encryptpassword('testpass') . "', 52 52 'John', 53 53 'Doe', … … 56 56 ) 57 57 "); 58 $this->Auth_SQL->login('testuser', 'testpass'); 58 if (!$this->Auth_SQL->login('testuser', 'testpass')) { 59 trigger_error('Test user not logged in.', E_USER_WARNING); 60 } 59 61 60 62 $this->RecordLock =& RecordLock::getInstance($this->Auth_SQL); -
tags/2.0.1/tests/_config.inc.php
r43 r126 29 29 'log_screen_priority' => LOG_WARNING, 30 30 'error_reporting' => E_ALL, 31 'signing_key' => 'atestsaltkey', 31 32 )); 32 33 -
tags/2.0.1/tests/run_tests.sh
r53 r126 7 7 for foo in *Test.php; 8 8 do 9 /usr/local/bin/php$foo;9 php4 $foo; 10 10 done;
Note: See TracChangeset
for help on using the changeset viewer.