Ejemplo n.º 1
0
 public function tearDown()
 {
     $db = new DB($this->getEntryPointInstance());
     $sql = "DELETE from accounts where name='Test PHPUNIT account';";
     $db->query($sql);
     $sql = "DELETE from users where user_name='Test PHPUNIT user';";
     $db->query($sql);
 }
Ejemplo n.º 2
0
 public function setPassword($userName, $password)
 {
     $user = $this->getUserBeanByName($userName);
     if (method_exists($user, 'setNewPassword')) {
         $user->setNewPassword($password);
     } else {
         $hash = strtolower(md5($password));
         $sql = "UPDATE {$user->table_name} SET user_hash='{$hash}' WHERE id='{$user->id}'";
         $db = new DB($this->getEntryPoint());
         $db->query($sql);
     }
 }