private function _createUser() { $userTask = new Installer_Task_User(); $userTask->setUsername($this->_getValue('username')); $userTask->setPassword($this->_getValue('password')); $userTask->setEmail($this->_getValue('super_email')); $userTask->setName(Omeka_Form_Install::DEFAULT_USER_NAME); $userTask->setIsActive(Installer_Default::DEFAULT_USER_ACTIVE); $userTask->setRole(Installer_Default::DEFAULT_USER_ROLE); $userTask->install($this->_db); }
public function testTaskSavesNewUser() { $this->dbAdapter->appendLastInsertIdToStack(self::USERS_PLANS_ID); $this->dbAdapter->appendLastInsertIdToStack(self::USER_ID); $this->dbAdapter->appendLastInsertIdToStack(self::ENTITY_ID); $task = new Installer_Task_User(); $task->setUsername('foobar'); $task->setPassword('foobar'); $task->setEmail('*****@*****.**'); $task->setName('Foobar Foobar'); $task->setIsActive(true); $task->setRole('admin'); $task->install($this->db); $this->assertContains("INSERT INTO `test_users`", $this->profiler->getLastQueryProfile()->getQuery()); }