diff options
Diffstat (limited to 'plugins/Login')
-rw-r--r-- | plugins/Login/tests/Login.test.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/Login/tests/Login.test.php b/plugins/Login/tests/Login.test.php index 24b5a4277b..e7e25bb992 100644 --- a/plugins/Login/tests/Login.test.php +++ b/plugins/Login/tests/Login.test.php @@ -146,6 +146,12 @@ class Test_Piwik_Login extends Test_Database $auth->setTokenAuth($tokenAuth); $rc = $auth->authenticate(); + // valid login & hashed token auth + $auth->setLogin($user['login']); + $hash = $auth->getHashTokenAuth($user['login'], $tokenAuth); + $auth->setTokenAuth($hash); + $rc = $auth->authenticate(); + $user = Zend_Registry::get('config')->superuser->toArray(); $password = $user['password']; $tokenAuth = Piwik_UsersManager_API::getInstance()->getTokenAuth($user['login'], $password); @@ -185,5 +191,12 @@ class Test_Piwik_Login extends Test_Database $auth->setTokenAuth($tokenAuth); $rc = $auth->authenticate(); $this->assertEqual( $rc->getCode(), Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE ); + + // valid login & hashed token auth + $auth->setLogin($user['login']); + $hash = $auth->getHashTokenAuth($user['login'], $tokenAuth); + $auth->setTokenAuth($hash); + $rc = $auth->authenticate(); + $this->assertEqual( $rc->getCode(), Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE ); } } |