Example #1
0
 public function testPatchForms()
 {
     $formObject = factory(Form::class)->create();
     $formData = ['data' => ['type' => 'forms', 'attributes' => $formObject->toArray()]];
     $formData['data']['attributes']['name'] = 'waiver_new_yup';
     $formData = json_encode($formData);
     $response = $this->callPatch(self::API_URL . $formObject->id, $formData);
     $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
     $this->assertNotNull($form = json_decode($response->getContent())->data);
     $this->assertNotEmpty($form->id);
     // test to make sure the form was created
     $updatedForm = Form::findOrFail($form->id);
     $this->assertEquals('waiver_new_yup', $updatedForm->name);
 }