Changeset 447 for branches/eli_branch/tests
- Timestamp:
- Dec 13, 2013 11:24:08 PM (11 years ago)
- Location:
- branches/eli_branch/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eli_branch/tests/AppTest.php
r446 r447 113 113 { 114 114 ob_start(); 115 //$this->test_raisemsg(); //had to add this line for phpunit ver. 3.7115 $this->test_raisemsg(); //had to add this line for phpunit ver. 3.7 /// 116 116 $app =& App::getInstance(); 117 117 $app->printraisedmessages(); -
branches/eli_branch/tests/AuthSQLTest.php
r446 r447 47 47 'login_url' => '/login.php', 48 48 'blocking' => true, 49 'encryption_type' => A UTH_ENCRYPT_MD5_HARDENED,49 'encryption_type' => Auth_SQL::ENCRYPT_MD5_HARDENED, 50 50 )); 51 51 … … 212 212 function test_encryptpassword() 213 213 { 214 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_MD5));214 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_MD5)); 215 215 $result = $this->Auth_SQL->encryptpassword('123'); 216 216 $this->assertEquals('202cb962ac59075b964b07152d234b70', $result); 217 217 218 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_MD5_HARDENED));218 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_MD5_HARDENED)); 219 219 $result = $this->Auth_SQL->encryptpassword('123'); 220 220 $this->assertEquals('c55e4ac608a8768ecd758fab971b0646', $result); 221 221 222 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_SHA1));222 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1)); 223 223 $result = $this->Auth_SQL->encryptpassword('123'); 224 224 $this->assertEquals('40bd001563085fc35165329ea1ff5c5ecbdbbeef', $result); 225 225 226 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_SHA1_HARDENED));226 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1_HARDENED)); 227 227 $result = $this->Auth_SQL->encryptpassword('123'); 228 228 $this->assertEquals('33d90af96a5928ac93cbd41fc436e8c55d2768c2', $result); 229 229 230 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_PLAINTEXT));230 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_PLAINTEXT)); 231 231 $result = $this->Auth_SQL->encryptpassword('123'); 232 232 $this->assertEquals('123', $result); 233 233 234 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_CRYPT));234 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_CRYPT)); 235 235 $result = $this->Auth_SQL->encryptpassword('123', 'saltstring'); 236 236 $this->assertEquals('saEZ6MlWYV9nQ', $result); … … 241 241 $db =& DB::getInstance(); 242 242 243 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_SHA1_HARDENED));243 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1_HARDENED)); 244 244 $this->Auth_SQL->setpassword(null, '123'); 245 245 $qid = $db->query(" -
branches/eli_branch/tests/Auth_SQLTest.php
r446 r447 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 51 51 'login_url' => '/login.php', 52 52 'blocking' => true, 53 'encryption_type' => A UTH_ENCRYPT_MD5_HARDENED,53 'encryption_type' => Auth_SQL::ENCRYPT_MD5_HARDENED, 54 54 )); 55 55 … … 80 80 { 81 81 $db =& DB::getInstance(); 82 82 83 83 unset($this->Auth_SQL); 84 84 $db->query("DROP TABLE IF EXISTS test_user_tbl"); … … 145 145 $after_logged_in = $this->Auth_SQL->isloggedin(); 146 146 $this->assertFalse($after_logged_in, '3. User is still logged in but should not be.'); 147 147 148 148 // Testing wrong password. 149 149 $login2 = $this->Auth_SQL->login('testuser', 'wrongpass'); … … 164 164 { 165 165 $db =& DB::getInstance(); 166 166 167 167 $this->Auth_SQL->login('testuser', 'testpass'); 168 168 $this->Auth_SQL->blockaccount(null, 'blocktestuser'); … … 178 178 { 179 179 $db =& DB::getInstance(); 180 180 181 181 $db->query(" 182 182 UPDATE test_user_tbl SET blocked_reason = 'blocktestuser' … … 212 212 function test_encryptpassword() 213 213 { 214 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_MD5));214 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_MD5)); 215 215 $result = $this->Auth_SQL->encryptpassword('123'); 216 216 $this->assertEquals('202cb962ac59075b964b07152d234b70', $result); 217 217 218 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_MD5_HARDENED));218 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_MD5_HARDENED)); 219 219 $result = $this->Auth_SQL->encryptpassword('123'); 220 220 $this->assertEquals('c55e4ac608a8768ecd758fab971b0646', $result); 221 221 222 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_SHA1));222 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1)); 223 223 $result = $this->Auth_SQL->encryptpassword('123'); 224 224 $this->assertEquals('40bd001563085fc35165329ea1ff5c5ecbdbbeef', $result); 225 225 226 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_SHA1_HARDENED));226 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1_HARDENED)); 227 227 $result = $this->Auth_SQL->encryptpassword('123'); 228 228 $this->assertEquals('33d90af96a5928ac93cbd41fc436e8c55d2768c2', $result); 229 229 230 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_PLAINTEXT));230 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_PLAINTEXT)); 231 231 $result = $this->Auth_SQL->encryptpassword('123'); 232 232 $this->assertEquals('123', $result); 233 233 234 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_CRYPT));234 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_CRYPT)); 235 235 $result = $this->Auth_SQL->encryptpassword('123', 'saltstring'); 236 236 $this->assertEquals('saEZ6MlWYV9nQ', $result); … … 240 240 { 241 241 $db =& DB::getInstance(); 242 243 $this->Auth_SQL->setParam(array('encryption_type' => A UTH_ENCRYPT_SHA1_HARDENED));242 243 $this->Auth_SQL->setParam(array('encryption_type' => Auth_SQL::ENCRYPT_SHA1_HARDENED)); 244 244 $this->Auth_SQL->setpassword(null, '123'); 245 245 $qid = $db->query(" -
branches/eli_branch/tests/DBSessionHandlerTest.php
r442 r447 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
Note: See TracChangeset
for help on using the changeset viewer.