/**
  * 
  * @expectedException StatusCodeException
  */
 public function testDelete()
 {
     require __DIR__ . '/config/database_test.php';
     $db = new DatabaseConnection($host, $database, $user, $password);
     $character1 = ['name' => 'Lion Woods', 'description' => 'A wonderful zombie that plays golf better than Tiger Woods', 'type' => 'zombie', 'dead' => '1', 'stage' => '2', 'hp' => '67'];
     $id1 = Character::insert($db, $character1);
     $this->assertTrue(is_array(Character::find($db, $id1)), 'testDelete could not be done cause Character could not be inserted to be deleted.');
     Character::delete($db, $id1);
     $this->assertFalse(is_array(Character::find($db, $id1)), 'Character::delete not worked properly.');
 }
 /**
  * Update a character with that ID
  *
  * @param DatabaseConnection database class instance
  * @param mixed $id number, could be a string or an int
  * @return string '{}'
  */
 public function deleteCharacter(DatabaseConnection $db, $id)
 {
     Character::find($db, $id);
     Character::delete($db, $id);
     return '{}';
 }
 function character_delete()
 {
     if (!$this->delete('id')) {
         $this->response('', 400);
     }
     // Are we logged in?
     if (!$this->user->exists()) {
         $this->response(NULL, 401);
     }
     $character = new Character($this->delete('id'));
     // Only allow deleting of your own characters
     if ($this->user->id != $character->player_id) {
         $this->response(NULL, 401);
     }
     $character->delete();
     $this->response('Character deleted', 200);
 }