/** * Update a job * * @param \Jaspersoft\Dto\Job\Job $job object describing new data for the job * @return \Jaspersoft\Dto\Job\Job the server returned job as it is now stored */ public function updateJob($job) { $url = $this->restUrl2 . '/jobs/' . $job->id; $data = $this->service->prepAndSend($url, array(201, 200), 'POST', $job->toJSON(), true, 'application/job+json', 'application/job+json'); return Job::createFromJSON(json_decode($data)); }
/** Coverage: createFromJSON, toJSON * * This test ensures that json created by toJSON are identical to the json created by a casted version of the object **/ public function testCreateFromJSON_roundTripPolicy_json() { $testJob_json = $this->testJob->toJSON(); $castedJob_json = Job::createFromJSON(json_decode($testJob_json))->toJSON(); $this->assertEquals($testJob_json, $castedJob_json); }