protected function GenerateResponse() { try { $this->response = ClientesController::NuevoAval(isset($_POST['avales']) ? json_decode($_POST['avales']) : null, isset($_POST['id_cliente']) ? $_POST['id_cliente'] : null); } catch (Exception $e) { //Logger::error($e); throw new ApiException($this->error_dispatcher->invalidDatabaseOperation($e->getMessage())); } }
public function testNuevoAval() { //Crear un cliente $a = ClientesController::nuevo(time() . "cliente"); //crear su aval $b = ClientesController::nuevo(time() . "aval"); //asignar el aval al cliente ClientesController::NuevoAval(array(array("id_aval" => $b["id_cliente"], "tipo_aval" => "prendario")), $a["id_cliente"]); $r = ClienteAvalDAO::getByPK($a["id_cliente"], $b["id_cliente"]); $this->assertNotNull($r); }