-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
080b7b8
commit b783afb
Showing
9 changed files
with
51 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
<?php | ||
|
||
use App\Http\Controllers\V1\User\CreateUserController; | ||
use App\Http\Controllers\V1\User\ShowUserController; | ||
use App\Http\Controllers\V1\User\UpdateUserController; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::post('v1/register', [CreateUserController::class, '__invoke']) | ||
->name('v1.user.create'); | ||
->name('api.v1.user.create'); | ||
Route::prefix('v1') | ||
->middleware('auth:sanctum') | ||
->group(function () { | ||
require __DIR__ . '/Api/V1/user.php'; | ||
Route::prefix('user')->group(function () { | ||
Route::get('/auth', function (Request $request) { | ||
return $request; | ||
}); | ||
Route::get('/show/{uuid}', [ShowUserController::class, '__invoke']) | ||
->whereUuid('uuid') | ||
->name('api.v1.user.show'); | ||
Route::put('/user/update/{uuid}', [UpdateUserController::class, '__invoke']) | ||
->whereUuid('uuid') | ||
->name('api.v1.user.update'); | ||
}); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ public function test_update_user_success_case() | |
{ | ||
//update user | ||
$response = $this->putJson( | ||
route('v1.user.update', ['uuid' => $this->user->uuid]), | ||
route('api.v1.user.update', ['uuid' => $this->user->uuid]), | ||
[ | ||
'name' => $this->faker->name . 'updated', | ||
'email' => $this->faker->userName . '[email protected]', | ||
|
@@ -52,7 +52,7 @@ public function test_update_user_fail_case_email_exists_and_birthdate_less_than_ | |
|
||
//update user | ||
$response = $this->putJson( | ||
route('v1.user.update', ['uuid' => $this->user->uuid]), | ||
route('api.v1.user.update', ['uuid' => $this->user->uuid]), | ||
[ | ||
'name' => $userMoodel->name, | ||
'email' => $userMoodel->email, | ||
|
@@ -76,7 +76,7 @@ public function test_update_user_fail_case_password_less_than_8_characters() | |
{ | ||
//update user | ||
$response = $this->putJson( | ||
route('v1.user.update', ['uuid' => $this->user->uuid]), | ||
route('api.v1.user.update', ['uuid' => $this->user->uuid]), | ||
[ | ||
'name' => $this->faker->name, | ||
'email' => $this->faker->userName . '@gmail.com', | ||
|
@@ -105,7 +105,7 @@ public function test_update_user_fail_case_email_exists() | |
|
||
//update user | ||
$response = $this->putJson( | ||
route('v1.user.update', ['uuid' => $this->user->uuid]), | ||
route('api.v1.user.update', ['uuid' => $this->user->uuid]), | ||
[ | ||
'name' => $otherUser->name, | ||
'email' => $otherUser->email, | ||
|
@@ -139,7 +139,7 @@ public function test_update_user_success_case_new_valid_email() | |
|
||
//update user | ||
$response = $this->putJson( | ||
route('v1.user.update', ['uuid' => $this->user->uuid]), | ||
route('api.v1.user.update', ['uuid' => $this->user->uuid]), | ||
[ | ||
'name' => $otherUser->name, | ||
'email' => $this->faker->userName . '@gmail.com', | ||
|
@@ -161,7 +161,7 @@ public function test_update_user_fail_case_user_not_found() | |
{ | ||
//update user | ||
$response = $this->putJson( | ||
route('v1.user.update', ['uuid' => $this->faker->uuid]), | ||
route('api.v1.user.update', ['uuid' => $this->faker->uuid]), | ||
[ | ||
'name' => $this->faker->name, | ||
'email' => $this->faker->userName . '@gmail.com', | ||
|