public function delete()
 {
     $this->userModel = $this->loadModel('User');
     $iduser = $this->userModel->getUserByUserName($this->getParams()[0])['id'];
     $this->userModel->deleteUser($iduser);
     $this->getView()->redirect('/adminusers');
 }
 public function testInsert()
 {
     $this->model = new UserModel();
     $array = ['username' => 'lol', 'firstname' => 'swag', 'lastname' => 'OMG', 'password' => 'lol', 'mail' => '*****@*****.**', 'birthday' => '04/12/1900', 'phonenumber' => '000000', 'twitter' => 'Nope', 'skype' => 'nope', 'facebookuri' => 'OSEF', 'website' => '??', 'job' => 'Pole emploi', 'description' => '???', 'privacy' => '123', 'mailnotifications' => '1', 'accesslevel' => '1'];
     $ok = $this->model->insertUser($array);
     $this->assertEquals(true, $ok);
     $ok = $this->model->deleteUser('lol');
     $this->assertEquals(true, $ok);
 }