/** * Tests the update function in the ChargeController * @param void * @return void */ public function testUpdate() { $this->withoutMiddleware(); $this->call('POST', '/charge', $this->chargeData); // Update the Charge $chargeStored = Charge::orderBy('id', 'desc')->first(); $this->withoutMiddleware(); $this->call('PUT', '/charge/1', $this->chargeUpdate); $chargeUpdated = Charge::find('1'); $this->assertEquals($chargeUpdated->test_id, $this->chargeUpdate['test_id']); $this->assertEquals($chargeUpdated->current_amount, $this->chargeUpdate['current_amount']); }
/** * Remove the specified charge from storage. * * @param int $id * @return Response */ public function destroy($id) { $charge = Charge::find($id); $url = session('SOURCE_URL'); return redirect()->to($url)->with('message', trans('terms.record-successfully-deleted')); }