Ignore:
Timestamp:
May 24, 2006 6:07:38 AM (18 years ago)
Author:
scdev
Message:

Q - Releasing tags/2.0.1, use branches/2.0 for maintaining.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/2.0.1/tests/Auth_SQLTest.php

    r42 r126  
    2929            'db_login_table'    => 'test_login_tbl',
    3030            'login_url'         => '/login.php',
    31             'blocking'          => true
     31            'blocking'          => true,
     32            'encryption_type' => AUTH_ENCRYPT_SHA1,
    3233        ));
    3334
     
    4647            ) VALUES (
    4748                'testuser',
    48                 md5('testpass'),
     49                '" . $this->Auth_SQL->encryptpassword('testpass') . "',
    4950                'John',
    5051                'Doe',
     
    185186    function test_encryptpassword()
    186187    {
     188        $this->Auth_SQL->setParam(array('encryption_type' => AUTH_ENCRYPT_MD5));
    187189        $result = $this->Auth_SQL->encryptpassword('123');
    188190        $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);
    189203    }
    190204
     
    197211        ");
    198212        list($pass) = mysql_fetch_row($qid);
    199         $this->assertEquals('202cb962ac59075b964b07152d234b70', $pass);
     213        $this->assertEquals('40bd001563085fc35165329ea1ff5c5ecbdbbeef', $pass);
    200214    }
    201215
Note: See TracChangeset for help on using the changeset viewer.