From 562ff75030d5ffcf9a7959c21d223ab0166afb40 Mon Sep 17 00:00:00 2001 From: Hasin Hayder Date: Sat, 21 May 2022 22:09:14 +0600 Subject: [PATCH] New User Test --- tests/Feature/NewUserTest.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/Feature/NewUserTest.php b/tests/Feature/NewUserTest.php index b9ff5b1..2d9b5d4 100644 --- a/tests/Feature/NewUserTest.php +++ b/tests/Feature/NewUserTest.php @@ -94,9 +94,9 @@ class NewUserTest extends TestCase { $this->user_id = $data->id; $response = $this->withHeader('Authorization', 'Bearer ' . $this->token) - ->put("/api/users/{$this->user_id}", [ - 'name' => 'Mini Me', - ]); + ->put("/api/users/{$this->user_id}", [ + 'name' => 'Mini Me', + ]); $response ->assertJson( @@ -118,9 +118,9 @@ class NewUserTest extends TestCase { $this->user_id = $data->id; $response = $this->withHeader('Authorization', 'Bearer ' . $this->token) - ->put("/api/users/{$this->user_id}", [ - 'name' => 'Mini Me', - ]); + ->put("/api/users/{$this->user_id}", [ + 'name' => 'Mini Me', + ]); $response ->assertJson( @@ -141,16 +141,16 @@ class NewUserTest extends TestCase { $this->token = $data->token; $this->user_id = $data->id; - $target = User::where('email','test@test.com')->first(); + $target = User::where('email', 'test@test.com')->first(); $response = $this->withHeader('Authorization', 'Bearer ' . $this->token) - ->delete("/api/users/{$target->id}"); + ->delete("/api/users/{$target->id}"); $response ->assertJson( fn (AssertableJson $json) => - $json->where('error',1) - ->has('message') + $json->where('error', 1) + ->has('message') ); } @@ -165,16 +165,16 @@ class NewUserTest extends TestCase { $this->token = $data->token; $this->user_id = $data->id; - $target = User::where('email','test@test.com')->first(); + $target = User::where('email', 'test@test.com')->first(); $response = $this->withHeader('Authorization', 'Bearer ' . $this->token) - ->delete("/api/users/{$target->id}"); + ->delete("/api/users/{$target->id}"); $response ->assertJson( fn (AssertableJson $json) => - $json->where('error',0) - ->where('message','user deleted') + $json->where('error', 0) + ->where('message', 'user deleted') ); } }