Skip to content

Commit

Permalink
chore pint
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartinoscar committed Feb 12, 2025
1 parent 904c5c4 commit 034b92d
Show file tree
Hide file tree
Showing 58 changed files with 233 additions and 232 deletions.
3 changes: 2 additions & 1 deletion pint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"concat_space": false,
"new_with_parentheses": {"anonymous_class": false},
"not_operator_with_successor_space": false,
"ordered_imports": false
"ordered_imports": false,
"single_line_comment_spacing": false
}
}
2 changes: 1 addition & 1 deletion tests/Feature/Webhooks/DispatchWebhooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DispatchWebhooksTest extends TestCase
{
use LazilyRefreshDatabase;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();
Queue::fake();
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Webhooks/ProcessWebhooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ProcessWebhooksTest extends TestCase
{
use LazilyRefreshDatabase;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();
Http::preventStrayRequests();
Expand Down
10 changes: 5 additions & 5 deletions tests/Integration/Api/Application/EggControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class EggControllerTest extends ApplicationApiIntegrationTestCase
/**
* Test that all the eggs can be returned.
*/
public function testListAllEggs(): void
public function test_list_all_eggs(): void
{
$eggs = Egg::query()->get();

Expand Down Expand Up @@ -57,7 +57,7 @@ public function testListAllEggs(): void
/**
* Test that a single egg can be returned.
*/
public function testReturnSingleEgg(): void
public function test_return_single_egg(): void
{
$egg = Egg::query()->findOrFail(1);

Expand All @@ -79,7 +79,7 @@ public function testReturnSingleEgg(): void
/**
* Test that a single egg and all the defined relationships can be returned.
*/
public function testReturnSingleEggWithRelationships(): void
public function test_return_single_egg_with_relationships(): void
{
$egg = Egg::query()->findOrFail(1);

Expand All @@ -99,7 +99,7 @@ public function testReturnSingleEggWithRelationships(): void
/**
* Test that a missing egg returns a 404 error.
*/
public function testGetMissingEgg(): void
public function test_get_missing_egg(): void
{
$response = $this->getJson('/api/application/eggs/nil');
$this->assertNotFoundJson($response);
Expand All @@ -109,7 +109,7 @@ public function testGetMissingEgg(): void
* Test that an authentication error occurs if a key does not have permission
* to access a resource.
*/
public function testErrorReturnedIfNoPermission(): void
public function test_error_returned_if_no_permission(): void
{
$egg = Egg::query()->findOrFail(1);
$this->createNewDefaultApiKey($this->getApiUser(), [Egg::RESOURCE_NAME => AdminAcl::NONE]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ExternalUserControllerTest extends ApplicationApiIntegrationTestCase
/**
* Test that a user can be retrieved by their external ID.
*/
public function testGetRemoteUser(): void
public function test_get_remote_user(): void
{
$user = User::factory()->create(['external_id' => Str::random()]);

Expand Down Expand Up @@ -48,7 +48,7 @@ public function testGetRemoteUser(): void
/**
* Test that an invalid external ID returns a 404 error.
*/
public function testGetMissingUser(): void
public function test_get_missing_user(): void
{
$response = $this->getJson('/api/application/users/external/nil');
$this->assertNotFoundJson($response);
Expand All @@ -58,7 +58,7 @@ public function testGetMissingUser(): void
* Test that an authentication error occurs if a key does not have permission
* to access a resource.
*/
public function testErrorReturnedIfNoPermission(): void
public function test_error_returned_if_no_permission(): void
{
$user = User::factory()->create(['external_id' => Str::random()]);
$this->createNewDefaultApiKey($this->getApiUser(), [User::RESOURCE_NAME => AdminAcl::NONE]);
Expand Down
20 changes: 10 additions & 10 deletions tests/Integration/Api/Application/Users/UserControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class UserControllerTest extends ApplicationApiIntegrationTestCase
/**
* Test the response when requesting all users on the panel.
*/
public function testGetUsers(): void
public function test_get_users(): void
{
$user = User::factory()->create();

Expand Down Expand Up @@ -83,7 +83,7 @@ public function testGetUsers(): void
/**
* Test getting a single user.
*/
public function testGetSingleUser(): void
public function test_get_single_user(): void
{
$user = User::factory()->create();

Expand Down Expand Up @@ -115,7 +115,7 @@ public function testGetSingleUser(): void
/**
* Test that the correct relationships can be loaded.
*/
public function testRelationshipsCanBeLoaded(): void
public function test_relationships_can_be_loaded(): void
{
$user = User::factory()->create();
$server = $this->createServerModel(['user_id' => $user->id]);
Expand Down Expand Up @@ -146,7 +146,7 @@ public function testRelationshipsCanBeLoaded(): void
* Test that attempting to load a relationship that the key does not have permission
* for returns a null object.
*/
public function testKeyWithoutPermissionCannotLoadRelationship(): void
public function test_key_without_permission_cannot_load_relationship(): void
{
$this->createNewDefaultApiKey($this->getApiUser(), [Server::RESOURCE_NAME => AdminAcl::NONE]);

Expand Down Expand Up @@ -180,7 +180,7 @@ public function testKeyWithoutPermissionCannotLoadRelationship(): void
/**
* Test that an invalid external ID returns a 404 error.
*/
public function testGetMissingUser(): void
public function test_get_missing_user(): void
{
$response = $this->getJson('/api/application/users/nil');
$this->assertNotFoundJson($response);
Expand All @@ -190,7 +190,7 @@ public function testGetMissingUser(): void
* Test that an authentication error occurs if a key does not have permission
* to access a resource.
*/
public function testErrorReturnedIfNoPermission(): void
public function test_error_returned_if_no_permission(): void
{
$user = User::factory()->create();
$this->createNewDefaultApiKey($this->getApiUser(), [User::RESOURCE_NAME => AdminAcl::NONE]);
Expand All @@ -202,7 +202,7 @@ public function testErrorReturnedIfNoPermission(): void
/**
* Test that a user can be created.
*/
public function testCreateUser(): void
public function test_create_user(): void
{
$response = $this->postJson('/api/application/users', [
'username' => 'testuser',
Expand Down Expand Up @@ -232,7 +232,7 @@ public function testCreateUser(): void
/**
* Test that a user can be updated.
*/
public function testUpdateUser(): void
public function test_update_user(): void
{
$user = User::factory()->create();

Expand All @@ -259,7 +259,7 @@ public function testUpdateUser(): void
/**
* Test that a user can be deleted from the database.
*/
public function testDeleteUser(): void
public function test_delete_user(): void
{
$user = User::factory()->create();
$this->assertDatabaseHas('users', ['id' => $user->id]);
Expand All @@ -275,7 +275,7 @@ public function testDeleteUser(): void
* delete a user model.
*/
#[DataProvider('userWriteEndpointsDataProvider')]
public function testApiKeyWithoutWritePermissions(string $method, string $url): void
public function test_api_key_without_write_permissions(string $method, string $url): void
{
$this->createNewDefaultApiKey($this->getApiUser(), [User::RESOURCE_NAME => AdminAcl::READ]);

Expand Down
16 changes: 8 additions & 8 deletions tests/Integration/Api/Client/AccountControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
/**
* Test that the user's account details are returned from the account endpoint.
*/
public function testAccountDetailsAreReturned(): void
public function test_account_details_are_returned(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -39,7 +39,7 @@ public function testAccountDetailsAreReturned(): void
/**
* Test that the user's email address can be updated via the API.
*/
public function testEmailIsUpdated(): void
public function test_email_is_updated(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -58,7 +58,7 @@ public function testEmailIsUpdated(): void
* Tests that an email is not updated if the password provided in the request is not
* valid for the account.
*/
public function testEmailIsNotUpdatedWhenPasswordIsInvalid(): void
public function test_email_is_not_updated_when_password_is_invalid(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -77,7 +77,7 @@ public function testEmailIsNotUpdatedWhenPasswordIsInvalid(): void
* Tests that an email is not updated if an invalid email address is passed through
* in the request.
*/
public function testEmailIsNotUpdatedWhenNotValid(): void
public function test_email_is_not_updated_when_not_valid(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -104,7 +104,7 @@ public function testEmailIsNotUpdatedWhenNotValid(): void
/**
* Test that the password for an account can be successfully updated.
*/
public function testPasswordIsUpdated(): void
public function test_password_is_updated(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -130,7 +130,7 @@ public function testPasswordIsUpdated(): void
* Test that the password for an account is not updated if the current password is not
* provided correctly.
*/
public function testPasswordIsNotUpdatedIfCurrentPasswordIsInvalid(): void
public function test_password_is_not_updated_if_current_password_is_invalid(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -150,7 +150,7 @@ public function testPasswordIsNotUpdatedIfCurrentPasswordIsInvalid(): void
* Test that a validation error is returned to the user if no password is provided or if
* the password is below the minimum password length.
*/
public function testErrorIsReturnedForInvalidRequestData(): void
public function test_error_is_returned_for_invalid_request_data(): void
{
$user = User::factory()->create();

Expand All @@ -173,7 +173,7 @@ public function testErrorIsReturnedForInvalidRequestData(): void
* Test that a validation error is returned if the password passed in the request
* does not have a confirmation, or the confirmation is not the same as the password.
*/
public function testErrorIsReturnedIfPasswordIsNotConfirmed(): void
public function test_error_is_returned_if_password_is_not_confirmed(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand Down
18 changes: 9 additions & 9 deletions tests/Integration/Api/Client/ApiKeyControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function tearDown(): void
/**
* Test that the client's API key can be returned successfully.
*/
public function testApiKeysAreReturned(): void
public function test_api_keys_are_returned(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -47,7 +47,7 @@ public function testApiKeysAreReturned(): void
* after that point.
*/
#[DataProvider('validIPAddressDataProvider')]
public function testApiKeyCanBeCreatedForAccount(array $data): void
public function test_api_key_can_be_created_for_account(array $data): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand Down Expand Up @@ -79,7 +79,7 @@ public function testApiKeyCanBeCreatedForAccount(array $data): void
/**
* Block requests to create an API key specifying more than 50 IP addresses.
*/
public function testApiKeyCannotSpecifyMoreThanFiftyIps(): void
public function test_api_key_cannot_specify_more_than_fifty_ips(): void
{
$ips = [];
for ($i = 0; $i < 100; $i++) {
Expand All @@ -99,7 +99,7 @@ public function testApiKeyCannotSpecifyMoreThanFiftyIps(): void
* Test that no more than the Max number of API keys can exist at one time for an account. This prevents
* a DoS attack vector against the panel.
*/
public function testApiKeyLimitIsApplied(): void
public function test_api_key_limit_is_applied(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -119,7 +119,7 @@ public function testApiKeyLimitIsApplied(): void
/**
* Test that a bad request results in a validation error being returned by the API.
*/
public function testValidationErrorIsReturnedForBadRequests(): void
public function test_validation_error_is_returned_for_bad_requests(): void
{
$this->actingAs(User::factory()->create());

Expand Down Expand Up @@ -153,7 +153,7 @@ public function testValidationErrorIsReturnedForBadRequests(): void
/**
* Tests that an API key can be deleted from the account.
*/
public function testApiKeyCanBeDeleted(): void
public function test_api_key_can_be_deleted(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -172,7 +172,7 @@ public function testApiKeyCanBeDeleted(): void
/**
* Test that trying to delete an API key that does not exist results in a 404.
*/
public function testNonExistentApiKeyDeletionReturns404Error(): void
public function test_non_existent_api_key_deletion_returns404_error(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -193,7 +193,7 @@ public function testNonExistentApiKeyDeletionReturns404Error(): void
* Test that an API key that exists on the system cannot be deleted if the user
* who created it is not the authenticated user.
*/
public function testApiKeyBelongingToAnotherUserCannotBeDeleted(): void
public function test_api_key_belonging_to_another_user_cannot_be_deleted(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand All @@ -216,7 +216,7 @@ public function testApiKeyBelongingToAnotherUserCannotBeDeleted(): void
* Tests that an application API key also belonging to the logged-in user cannot be
* deleted through this endpoint if it exists.
*/
public function testApplicationApiKeyCannotBeDeleted(): void
public function test_application_api_key_cannot_be_deleted(): void
{
/** @var \App\Models\User $user */
$user = User::factory()->create();
Expand Down
Loading

0 comments on commit 034b92d

Please sign in to comment.