diff --git a/tests/Integration/UpdateCompanyUserTest.php b/tests/Integration/UpdateCompanyUserTest.php index ae6fc87a5c04..28dc6797f2e7 100644 --- a/tests/Integration/UpdateCompanyUserTest.php +++ b/tests/Integration/UpdateCompanyUserTest.php @@ -52,15 +52,11 @@ class UpdateCompanyUserTest extends TestCase $response = null; - try { - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->put('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id).'/preferences?include=company_user', $settings); - } catch (ValidationException $e) { - $message = json_decode($e->validator->getMessageBag(), 1); - $this->assertNotNull($message); - } + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id).'/preferences?include=company_user', $settings); + $response->assertStatus(200); @@ -78,16 +74,11 @@ class UpdateCompanyUserTest extends TestCase $response = null; - try { $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, - ])->put('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id).'/preferences?include=company_user', $settings); - } catch (ValidationException $e) { - $message = json_decode($e->validator->getMessageBag(), 1); - $this->assertNotNull($message); - } - + ])->putJson('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id).'/preferences?include=company_user', $settings); + $response->assertStatus(200); $arr = $response->json(); @@ -114,16 +105,11 @@ class UpdateCompanyUserTest extends TestCase $response = null; - try { $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, - ])->put('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id), $user); - } catch (ValidationException $e) { - $message = json_decode($e->validator->getMessageBag(), 1); - $this->assertNotNull($message); - } - + ])->putJson('/api/v1/company_users/'.$this->encodePrimaryKey($this->user->id), $user); + $response->assertStatus(200); $arr = $response->json();