Exemplo n.º 1
0
 public function actionDelete($email)
 {
     $exitCode = 0;
     $this->stdout("Deleting {$email}: ");
     $deleteCounter = User::deleteAll(['email' => $email]);
     if (1 === $deleteCounter) {
         $this->msgSuccess();
     } else {
         //Error Handling
         if ($deleteCounter === 0) {
             $exitCode = 1;
             $this->msgError("Account Not Found");
         } else {
             $this->msgError("Multiple Accounts Deleted - DB may be in Inconsistent State");
             $this->stderr("Multiple Accounts Deleted - DB may be in Inconsistent State", Console::BG_BLUE);
             $exitCode = 2;
         }
     }
     $this->stdout("\n");
     return $exitCode;
 }
Exemplo n.º 2
0
 /**
  * Delete all users, who have status - pending.
  */
 public function actionDeletePendingUsers()
 {
     User::deleteAll(['status' => User::STATUS_UNCONFIRMED_EMAIL]);
     return $this->redirect(['index']);
 }
Exemplo n.º 3
0
 /**
  * This method is called after each cest class test method, even if test failed.
  * @param \Codeception\Event\Test $event
  */
 public function _after($event)
 {
     User::deleteAll(['email' => '*****@*****.**', 'username' => 'tester']);
 }