Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/vite-6.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
atoff authored Dec 1, 2024
2 parents 8f8f46d + b6f6348 commit 7a156ec
Show file tree
Hide file tree
Showing 89 changed files with 447 additions and 446 deletions.
3 changes: 2 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ public function boot()
$permissionLoader->registerPermissions($gate);
});

// TODO: Remove use-permission
// TODO: Remove 'use-permission' across codebase - use user()->can instead
Gate::define('use-permission', function ($user, $permission) {
// Superadmin override
if ($user->hasRole('privacc') && config()->get('app.env') != 'production') {
return true;
}
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"laravelcollective/html": "^6.0",
"league/csv": "^9.0",
"league/oauth2-client": "^2.4",
"livewire/livewire": "^3.3",
"livewire/livewire": "^3.5",
"maatwebsite/excel": "~3.1.17",
"malahierba-lab/public-id": "dev-main",
"ohdearapp/ohdear-php-sdk": "^3.0",
Expand Down Expand Up @@ -146,7 +146,6 @@
"@php artisan key:generate"
],
"post-update-cmd": [
"@php artisan horizon:publish",
"@php artisan telescope:publish",
"@php artisan filament:upgrade"
],
Expand Down
34 changes: 17 additions & 17 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/* <body><pre>
-------------------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/API/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ValidationTest extends TestCase
use DatabaseTransactions;

/** @test */
public function itReturns400WhenPositionNotSupplied()
public function it_returns400_when_position_not_supplied()
{
$this->call('GET', route('api.validations'), ['position' => ''])
->assertStatus(400)
Expand All @@ -26,7 +26,7 @@ public function itReturns400WhenPositionNotSupplied()
}

/** @test */
public function itReturns404WhenPositionDoesNotExist()
public function it_returns404_when_position_does_not_exist()
{
$this->call('GET', route('api.validations'), ['position' => 'EGKK'])
->assertStatus(404)
Expand All @@ -36,7 +36,7 @@ public function itReturns404WhenPositionDoesNotExist()
}

/** @test */
public function itReturnsAJsonResponse()
public function it_returns_a_json_response()
{
$qualification = Qualification::code('S2')->first();
$account = Account::factory()->create();
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/Account/Auth/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected function setUp(): void
$this->account = Account::factory()->create();
}

public function testItDirectsToVatsimSSO()
public function test_it_directs_to_vatsim_sso()
{
config()->set('vatsim-connect.base', 'https://my-oauth-url.com');
config()->set('vatsim-connect.id', 12345);
Expand All @@ -40,7 +40,7 @@ public function testItDirectsToVatsimSSO()
$this->assertStringContainsString('client_id='.config('services.vatsim-net.connect.id'), $redirectUrl);
}

public function testItRedirectsWithoutVatsimSSOOnSecondaryLogin()
public function test_it_redirects_without_vatsim_sso_on_secondary_login()
{
$this->assertFalse(Auth::guard('vatsim-sso')->check());
$this->post(route('auth-secondary'))
Expand All @@ -49,7 +49,7 @@ public function testItRedirectsWithoutVatsimSSOOnSecondaryLogin()
->assertRedirect(route('landing'));
}

public function testItLogsAUserOut()
public function test_it_logs_a_user_out()
{
$this->actingAs($this->account);
$this->assertAuthenticatedAs($this->account);
Expand All @@ -59,7 +59,7 @@ public function testItLogsAUserOut()
$this->assertGuest();
}

public function testItLogsAUserOutOfTheVatsimSSOGuard()
public function test_it_logs_a_user_out_of_the_vatsim_sso_guard()
{
$this->actingAs($this->account, 'vatsim-sso');
$this->assertAuthenticatedAs($this->account, 'vatsim-sso');
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Account/DashboardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DashboardTest extends TestCase
{
use DatabaseTransactions;

public function testItRedirectsToDashboard()
public function test_it_redirects_to_dashboard()
{
Notification::query()->delete();

Expand Down
28 changes: 14 additions & 14 deletions tests/Feature/Account/EmailAssignmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EmailAssignmentTest extends TestCase

private $emailOther;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

Expand All @@ -31,15 +31,15 @@ public function setUp(): void
}

/** @test */
public function testUserCanAccessEmailAddForm()
public function test_user_can_access_email_add_form()
{
$this->actingAs($this->user)
->get(route('mship.manage.email.add'))
->assertSuccessful();
}

/** @test */
public function testRedirectOnInvalidEmail()
public function test_redirect_on_invalid_email()
{
$data = [
'new_email' => 'not_an_email.com',
Expand All @@ -53,7 +53,7 @@ public function testRedirectOnInvalidEmail()
}

/** @test */
public function testRedirectOnNonMatchingEmail()
public function test_redirect_on_non_matching_email()
{
$data = [
'new_email' => '[email protected]',
Expand All @@ -67,7 +67,7 @@ public function testRedirectOnNonMatchingEmail()
}

/** @test */
public function testSuccessfulPostEmail()
public function test_successful_post_email()
{
$data = [
'new_email' => '[email protected]',
Expand All @@ -81,7 +81,7 @@ public function testSuccessfulPostEmail()
}

/** @test */
public function testDuplicateEmailOnPost()
public function test_duplicate_email_on_post()
{
$this->user->secondaryEmails()->create(['email' => '[email protected]']);

Expand All @@ -97,7 +97,7 @@ public function testDuplicateEmailOnPost()
}

/** @test */
public function testRedirectOnSecondaryEmailDeleted()
public function test_redirect_on_secondary_email_deleted()
{
$account = $this->user->secondaryEmails()->create(['email' => '[email protected]']);

Expand All @@ -112,7 +112,7 @@ public function testRedirectOnSecondaryEmailDeleted()
}

/** @test */
public function testSuccessfulSecondaryEmailAddViaGetHasRelevantData()
public function test_successful_secondary_email_add_via_get_has_relevant_data()
{
$account = $this->user->secondaryEmails()->create(['email' => '[email protected]']);

Expand All @@ -126,7 +126,7 @@ public function testSuccessfulSecondaryEmailAddViaGetHasRelevantData()
}

/** @test */
public function testAssignmentsEmailsPassedToView()
public function test_assignments_emails_passed_to_view()
{
$verifiedEmailAddress = '[email protected]';
$unverifiedEmailAddress = '[email protected]';
Expand All @@ -150,7 +150,7 @@ public function testAssignmentsEmailsPassedToView()
}

/** @test */
public function testUserCannotDeleteOtherUsersEmail()
public function test_user_cannot_delete_other_users_email()
{
$emailInstance = $this->userOther->secondaryEmails()->create(['email' => $this->emailOther]);

Expand All @@ -159,7 +159,7 @@ public function testUserCannotDeleteOtherUsersEmail()
}

/** @test */
public function testUserCannotDeleteOtherUsersEmailOnPost()
public function test_user_cannot_delete_other_users_email_on_post()
{
$emailInstance = $this->userOther->secondaryEmails()->create(['email' => $this->emailOther]);

Expand All @@ -168,7 +168,7 @@ public function testUserCannotDeleteOtherUsersEmailOnPost()
}

/** @test */
public function testExistingAuthenticatedUserCanVerifyEmailViaGet()
public function test_existing_authenticated_user_can_verify_email_via_get()
{
$email = factory(Email::class)->states('unverified')->create();

Expand All @@ -179,7 +179,7 @@ public function testExistingAuthenticatedUserCanVerifyEmailViaGet()
}

/** @test */
public function testItTriggersAnUpdateWhenAssigningSSOEmail()
public function test_it_triggers_an_update_when_assigning_sso_email()
{
$sso_client = factory(\Laravel\Passport\Client::class)->create();
$email = factory(Email::class)->create(['account_id' => $this->user->id]);
Expand All @@ -195,7 +195,7 @@ public function testItTriggersAnUpdateWhenAssigningSSOEmail()
}

/** @test */
public function testItTriggersAnUpdateWhenUnAssigningSSOEmail()
public function test_it_triggers_an_update_when_un_assigning_sso_email()
{
$sso_email = factory(\App\Models\Sso\Email::class)->create();

Expand Down
14 changes: 7 additions & 7 deletions tests/Feature/Account/Feedback/FeedbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,45 @@ class FeedbackTest extends TestCase

private $form;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

$this->form = Form::find(1);
}

/** @test */
public function testItRedirectsFromFeedbackFormSelectorAsGuest()
public function test_it_redirects_from_feedback_form_selector_as_guest()
{
$this->get(route('mship.feedback.new'))
->assertRedirect(route('landing'));
}

/** @test */
public function testItLoadsTheFeedbackFormSelector()
public function test_it_loads_the_feedback_form_selector()
{
$this->actingAs($this->user, 'web')
->get(route('mship.feedback.new'))
->assertSuccessful();
}

/** @test */
public function testItRedirectsFromFeedbackFormAsGuest()
public function test_it_redirects_from_feedback_form_as_guest()
{
$this->get(route('mship.feedback.new.form', $this->form->slug))
->assertRedirect(route('landing'));
}

/** @test */
public function testItLoadsTheFeedbackForm()
public function test_it_loads_the_feedback_form()
{
$this->actingAs($this->user, 'web')
->get(route('mship.feedback.new.form', $this->form->slug))
->assertSuccessful();
}

/** @test */
public function testItFillsUserCidInAtcForm()
public function test_it_fills_user_cid_in_atc_form()
{
$form = Form::whereSlug('atc')->first();
if (! $form) {
Expand All @@ -64,7 +64,7 @@ public function testItFillsUserCidInAtcForm()
$request->assertSee('mycidishere');
}

public function testItRedirectsToAtcFeedback()
public function test_it_redirects_to_atc_feedback()
{
$form = Form::whereSlug('atc')->first();
if (! $form) {
Expand Down
Loading

0 comments on commit 7a156ec

Please sign in to comment.