sintonia/airtime_mvc/tests/application/helpers/TestHelper.php
drigato ef13d5966f CC-5651: Unit Test the Scheduler
Added test for a non-repeat and non-record show
Added a helper class
2014-01-08 15:51:11 -05:00

29 lines
No EOL
1 KiB
PHP

<?php
class TestHelper
{
public static function loginUser()
{
$authAdapter = Application_Model_Auth::getAuthAdapter();
//pass to the adapter the submitted username and password
$authAdapter->setIdentity('admin')
->setCredential('admin');
$auth = Zend_Auth::getInstance();
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
//all info about this user from the login table omit only the password
$userInfo = $authAdapter->getResultRowObject(null, 'password');
//the default storage is a session with namespace Zend_Auth
$authStorage = $auth->getStorage();
$authStorage->write($userInfo);
//Application_Model_LoginAttempts::resetAttempts($_SERVER['REMOTE_ADDR']);
//Application_Model_Subjects::resetLoginAttempts($username);
//$tempSess = new Zend_Session_Namespace("referrer");
//$tempSess->referrer = 'login';
}
}
}