protected function setUp() { parent::setUp(); foreach (array_keys($_POST) as $key) { unset($_POST[$key]); } Zend_Auth::getInstance()->setStorage(new Zend_Auth_Storage_NonPersistent()); $this->clean(); $front = Zend_Controller_Front::getInstance(); $router = new Zend_Controller_Router_Rewrite(); $routes_config = new USVN_Config_Ini(USVN_ROUTES_CONFIG_FILE, USVN_CONFIG_SECTION); $router->addConfig($routes_config, 'routes'); $front->setRouter($router); $table = new USVN_Db_Table_Users(); $this->user = $table->fetchNew(); $this->user->setFromArray(array('users_login' => 'john', 'users_password' => 'pinocchio')); $this->user->save(); $this->admin_user = $table->fetchNew(); $this->admin_user->setFromArray(array('users_login' => 'god', 'users_password' => 'ingodwetrust', 'users_is_admin' => true)); $this->admin_user->save(); $authAdapter = new USVN_Auth_Adapter_Database('john', 'pinocchio'); Zend_Auth::getInstance()->authenticate($authAdapter); $front->setControllerDirectory(USVN_CONTROLLERS_DIR); $this->request = new USVN_Controller_Request_Http(); $front->setRequest($this->request); $this->response = new Zend_Controller_Response_Cli(); $front->setResponse($this->response); $router->addRoute('default', new Zend_Controller_Router_Route_Module(array(), $front->getDispatcher(), $front->getRequest())); }
public function setUp() { parent::setUp(); USVN_Translation::initTranslation("en_US", "app/locale"); $data = array("users_id" => 2, "users_login" => 'testlogin', "users_password" => USVN_Crypt::crypt('testpassword'), "users_is_admin" => false); $this->db->insert("usvn_users", $data); }
public function setUp() { parent::setUp(); $table = new USVN_Db_Table_Projects(); $obj = $table->fetchNew(); $obj->setFromArray(array('projects_name' => 'test', 'projects_start_date' => '1984-12-03 00:00:00')); $obj->save(); }
public function setUp() { parent::setUp(); chdir($this->_path); chdir('www'); USVN_Translation::initTranslation('en_US', 'locale'); chmod("tools/usvn-import-htpasswd.php", 0700); }
public function setUp() { parent::setUp(); $table = new USVN_Db_Table_Users(); $this->_user = $table->fetchNew(); $this->_user->setFromArray(array('users_login' => 'test', 'users_password' => 'password', 'users_firstname' => 'firstname', 'users_lastname' => 'lastname', 'users_email' => '*****@*****.**')); $this->_user->save(); }
public function setUp() { parent::setUp(); $this->group1 = $this->createGroup("grp1"); $this->group2 = $this->createGroup("grp2"); $this->users["test"] = $this->createUser("test", "test"); $this->users["babar"] = $this->createUser("babar", "test"); $this->users["john"] = $this->createUser("john", "test"); }
public function setUp() { parent::setUp(); $this->userTable = new USVN_Db_Table_Users(); $this->user = $this->userTable->fetchNew(); $this->user->users_login = '******'; $this->user->users_password = USVN_Crypt::crypt("test"); $this->userid = $this->user->save(); $this->groups = new USVN_Db_Table_Groups(); $group = $this->groups->insert(array("groups_id" => 42, "groups_name" => "test", "groups_description" => "test")); $this->groups->insert(array("groups_id" => 43, "groups_name" => "test2", "groups_description" => "test2")); $this->groups->insert(array("groups_id" => 44, "groups_name" => "test3", "groups_description" => "test3")); }
public function setUp() { parent::setUp(); $table = new USVN_Db_Table_Projects(); $project = $table->fetchNew(); $project->setFromArray(array('projects_name' => 'project1', 'projects_start_date' => '1984-12-03 00:00:00')); $this->_projectid1 = $project->save(); $table = new USVN_Db_Table_Projects(); $project = $table->fetchNew(); $project->setFromArray(array('projects_name' => 'project2', 'projects_start_date' => '1984-12-03 00:00:00')); $this->_projectid2 = $project->save(); $table_files = new USVN_Db_Table_FilesRights(); $id = $table_files->insert(array('projects_id' => $this->_projectid1, 'files_rights_path' => '/')); }
public function setUp() { parent::setUp(); $table = new USVN_Db_Table_Users(); $this->_user = $table->fetchNew(); $this->_user->setFromArray(array('users_login' => 'test', 'users_password' => 'password', 'users_firstname' => 'firstname', 'users_lastname' => 'lastname', 'users_email' => '*****@*****.**')); $this->_user->save(); $this->_projectid1 = USVN_Project::createProject(array('projects_name' => "project1"), "test", true, false, false, true)->id; $this->_projectid2 = USVN_Project::createProject(array('projects_name' => "project2"), "test", true, false, false, true)->id; $group_table = new USVN_Db_Table_Groups(); $group = $group_table->fetchNew(); $group->setFromArray(array("groups_name" => "toto")); $this->_groupid1 = $group->save(); $group_table = new USVN_Db_Table_Groups(); $group = $group_table->fetchNew(); $group->setFromArray(array("groups_name" => "titi")); $this->_groupid2 = $group->save(); }
public function setUp() { parent::setUp(); $table = new USVN_Db_Table_Projects(); $project = $table->fetchNew(); $project->setFromArray(array('projects_name' => 'project1', 'projects_start_date' => '1984-12-03 00:00:00')); $this->_projectid1 = $project->save(); $table = new USVN_Db_Table_Projects(); $project = $table->fetchNew(); $project->setFromArray(array('projects_name' => 'project2', 'projects_start_date' => '1984-12-03 00:00:00')); $this->_projectid2 = $project->save(); $group_table = new USVN_Db_Table_Groups(); $group = $group_table->fetchNew(); $group->setFromArray(array("groups_name" => "toto")); $this->_groupid1 = $group->save(); $group_table = new USVN_Db_Table_Groups(); $group = $group_table->fetchNew(); $group->setFromArray(array("groups_name" => "titi")); $this->_groupid2 = $group->save(); }
public function setUp() { parent::setUp(); $this->projectTable = new USVN_Db_Table_Projects(); $this->project = $this->projectTable->fetchNew(); $this->project->projects_name = 'testStem'; $this->project->projects_start_date = '2007-04-01 15:29:57'; $this->projectid = $this->project->save(); $this->project2Table = new USVN_Db_Table_Projects(); $this->project2 = $this->projectTable->fetchNew(); $this->project2->projects_name = 'testNoplay'; $this->project2->projects_start_date = '2007-04-01 15:29:57'; $this->project2id = $this->project2->save(); $this->groups = new USVN_Db_Table_Groups(); $this->groups->insert(array("groups_id" => 42, "groups_name" => "test", "groups_description" => "test")); $this->groups->insert(array("groups_id" => 43, "groups_name" => "test2", "groups_description" => "test2")); $this->groups->insert(array("groups_id" => 44, "groups_name" => "test3", "groups_description" => "test3")); $this->users = new USVN_Db_Table_Users(); $this->users->insert(array("users_id" => 42, "users_login" => "test", "users_password" => "pass")); $this->users = new USVN_Db_Table_Users(); $this->users->insert(array("users_id" => 43, "users_login" => "test2", "users_password" => "pass")); $this->users = new USVN_Db_Table_Users(); $this->users->insert(array("users_id" => 44, "users_login" => "test3", "users_password" => "pass")); }
protected function setUp() { parent::setUp(); mkdir($this->_menudir); file_put_contents($this->_menudir . "/beta.php", ' <?php class menus_beta extends USVN_AbstractMenu { public function getProjectSubMenu() { $project = $this->_request->getParam("project"); return array( array( "title" => "beta", "link"=> "project/" . $project . "/beta/", "controller" => "index", "action" => "" ) ); } public function getGroupSubMenu() { $group = $this->_request->getParam("group"); return array( array( "title" => "beta", "link"=> "group/" . $group . "/beta/", "controller" => "index", "action" => "" ) ); } public function getAdminSubMenu() { $project = $this->_request->getParam("project"); return array( array( "title" => "beta admin", "link"=> "project/" . $project . "/beta/", "controller" => "index", "action" => "" ) ); } public function getSubSubMenu() { return ( array( array( "title" => "Beta new user", "link"=> "admin/user/new/", "controller" => "beta", "action" => "new" ) )); } } '); require_once $this->_menudir . "/beta.php"; file_put_contents($this->_menudir . "/alpha.php", ' <?php class menus_alpha extends USVN_AbstractMenu { public function getProjectSubMenu() { $project = $this->_request->getParam("project"); return array( array( "title" => "alpha", "link"=> "project/" . $project . "/alpha/", "controller" => "index", "action" => "" ) ); } public function getGroupSubMenu() { $group = $this->_request->getParam("group"); return array( array( "title" => "alpha", "link"=> "group/" . $group . "/alpha/", "controller" => "index", "action" => "" ) ); } public function getAdminSubMenu() { $project = $this->_request->getParam("project"); return array( array( "title" => "alpha admin", "link"=> "project/" . $project . "/alpha/", "controller" => "index", "action" => "" ) ); } public function getSubSubMenu() { return ( array( array( "title" => "Alpha new user", "link"=> "admin/user/new/", "controller" => "alpha", "action" => "new" ) ) ); } } '); require_once $this->_menudir . "/alpha.php"; }
public function setUp() { parent::setUp(); }