remove useless comments

This commit is contained in:
tasnim 2024-08-20 16:02:43 +03:00
parent 2e5931f304
commit 23045ebd59

View File

@ -70,10 +70,9 @@ final class CategoryControllerTest extends TestCase {
public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointThenReturns200HttpCode(): void public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointThenReturns200HttpCode(): void
{ {
// act as a user // act as a user
$user = $this->createAuthenticatedUser(); $user = $this->createAuthenticatedUser();
$this->actingAs($user);
// Act as the created user
$this->actingAs($user, 'api');
$response = $this->get(route('api.v1.autocomplete.categories'), ['Accept' => 'application/json']); $response = $this->get(route('api.v1.autocomplete.categories'), ['Accept' => 'application/json']);
$response->assertStatus(200); $response->assertStatus(200);
$response->assertHeader('Content-Type', 'application/json'); $response->assertHeader('Content-Type', 'application/json');
@ -82,11 +81,9 @@ final class CategoryControllerTest extends TestCase {
public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointThenReturnsCategories(): void public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointThenReturnsCategories(): void
{ {
// act as a user
$user = $this->createAuthenticatedUser(); $user = $this->createAuthenticatedUser();
$this->actingAs($user);
// Act as the created user
$this->actingAs($user, 'api');
$this->createTestCategories(5, $user); $this->createTestCategories(5, $user);
$response = $this->get(route('api.v1.autocomplete.categories'), ['Accept' => 'application/json']); $response = $this->get(route('api.v1.autocomplete.categories'), ['Accept' => 'application/json']);
$response->assertStatus(200); $response->assertStatus(200);
@ -103,11 +100,9 @@ final class CategoryControllerTest extends TestCase {
public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointWithQueryThenReturnsCategoriesWithLimit(): void public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointWithQueryThenReturnsCategoriesWithLimit(): void
{ {
// act as a user
$user = $this->createAuthenticatedUser(); $user = $this->createAuthenticatedUser();
$this->actingAs($user);
// Act as the created user
$this->actingAs($user, 'api');
$this->createTestCategories(5, $user); $this->createTestCategories(5, $user);
$response = $this->get(route('api.v1.autocomplete.categories', [ $response = $this->get(route('api.v1.autocomplete.categories', [
'query' => 'Category', 'query' => 'Category',
@ -121,11 +116,9 @@ final class CategoryControllerTest extends TestCase {
public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointWithQueryThenReturnsCategoriesThatMatchQuery(): void public function testGivenAuthenticatedRequestWhenCallingTheCategoriesEndpointWithQueryThenReturnsCategoriesThatMatchQuery(): void
{ {
// act as a user
$user = $this->createAuthenticatedUser(); $user = $this->createAuthenticatedUser();
$this->actingAs($user);
// Act as the created user
$this->actingAs($user, 'api');
$this->createTestCategories(20, $user); $this->createTestCategories(20, $user);
$response = $this->get(route('api.v1.autocomplete.categories', [ $response = $this->get(route('api.v1.autocomplete.categories', [
'query' => 'Category 1', 'query' => 'Category 1',
@ -139,5 +132,4 @@ final class CategoryControllerTest extends TestCase {
$response->assertJsonMissing(['name' => 'Category 2']); $response->assertJsonMissing(['name' => 'Category 2']);
} }
} }