CC-5651: Unit Test the Scheduler
Added test for a non-repeat and non-record show Added a helper class
This commit is contained in:
parent
60f80dbb57
commit
75eb76062f
6 changed files with 154 additions and 63 deletions
29
airtime_mvc/tests/application/helpers/TestHelper.php
Normal file
29
airtime_mvc/tests/application/helpers/TestHelper.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?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';
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue