openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

PasswordTest.class.php (526B)


      1 <?php
      2 
      3 namespace security\test;
      4 
      5 use security\Password;
      6 use util\test\TestCase;
      7 
      8 class PasswordTest extends TestCase {
      9 
     10 	public function testHash() {
     11 		$this->assertEquals("aadce520e20c2899f4ced228a79a3083",Password::hash("wtf",Password::ALGO_MD5));
     12 	}
     13 
     14 
     15 	public function testCheck() {
     16 
     17 		$this->assertEquals( true, Password::check("wtf",'$2y$10$LNY2qCb9elkMe/ITN09cB.6t5QqDzm9Uh9h/LV1I',Password::ALGO_CRYPT) );
     18 
     19 		$this->assertEquals( true,Password::check("wtf",'aadce520e20c2899f4ced228a79a3083',Password::ALGO_MD5));
     20 	}
     21 }