Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#20 Updated composer.json to laravel v10 #78

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"doctrine/dbal": "^3.4",
"intervention/image": "^2.7",
"jeroennoten/laravel-adminlte": "^3.8",
"laravel/framework": "^9.26",
"laravel/framework": "^10.0",
"laravel/tinker": "^2.7",
"owen-it/laravel-auditing": "^13.0",
"robinherbots/jquery.inputmask": "^4.0",
Expand All @@ -30,7 +30,7 @@
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.3"
"spatie/laravel-ignition": "^2.0"
},
"autoload": {
"classmap": [
Expand Down
542 changes: 345 additions & 197 deletions composer.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/Feature/Http/Controllers/Auth/LoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class LoginControllerTest extends TestCase
{
use RefreshDatabase;

public function testItRendersTheLoginPage(): void
public function test_it_renders_the_login_page(): void
{
$this->get('/login')
->assertStatus(Response::HTTP_OK)
->assertSeeText('Sign in to start your session');
}

public function testItLogsInAValidUser(): void
public function test_it_logs_in_a_valid_user(): void
{
$user = User::factory()
->create(['email' => '[email protected]', 'password' => Hash::make('winds_howling')]);
Expand All @@ -31,7 +31,7 @@ public function testItLogsInAValidUser(): void
$this->assertEquals($user->id, Auth::user()->id);
}

public function testItRedirectsAnInvalidUserBackToLogin(): void
public function test_it_redirects_an_invalid_user_back_to_login(): void
{
User::factory()
->create(['email' => '[email protected]', 'password' => Hash::make('winds_howling')]);
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Http/Controllers/DashboardControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function setUp(): void
$this->user = User::factory()->active()->create();
}

public function testItLoadsCalendarEventsInProductionEnvironment()
public function test_it_loads_calendar_events_in_production_environment()
{
config(['app.env' => 'production']);
$this->app->bind(Event::class, fn () => new FakeEvent);
Expand All @@ -42,7 +42,7 @@ public function provideNonProductionEnvironments(): array
/**
* @dataProvider provideNonProductionEnvironments
*/
public function testItDoesNotLoadCalendarEventsInNonProductionEnvironment(string $environment)
public function test_it_does_not_load_calendar_events_in_non_production_environment(string $environment)
{
config(['app.env' => $environment]);
$this->app->bind(Event::class, fn () => new FakeEvent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PublicInfoControllerTest extends TestCase
/**
* @dataProvider publicUserCountData
*/
public function testPublicUserCount(int $activeUsers, int $expectedUserCount, int $hiatusUsers = 0): void
public function test_public_user_count(int $activeUsers, int $expectedUserCount, int $hiatusUsers = 0): void
{
User::factory($activeUsers)->active()->create();
User::factory($hiatusUsers)->hiatus()->create();
Expand Down
12 changes: 6 additions & 6 deletions tests/Feature/Http/Controllers/SlackInviteControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ class SlackInviteControllerTest extends TestCase
{
use RefreshDatabase;

public function testItReturnsNotFoundIfSlackAutoInviteIsNotEnabled(): void
public function test_it_returns_not_found_if_slack_auto_invite_is_not_enabled(): void
{
config(['services.slack.auto_invite.enabled' => false]);

$this->get('/slack/invite')->assertStatus(Response::HTTP_NOT_FOUND);
}

public function testItReturnsUnauthorizedWithoutAUserToken(): void
public function test_it_returns_unauthorized_without_a_user_token(): void
{
config(['services.slack.auto_invite.enabled' => true]);

$this->get('/slack/invite')->assertStatus(Response::HTTP_UNAUTHORIZED);
}

public function testItReturnsUnauthorizedWithAnInvalidUserToken(): void
public function test_it_returns_unauthorized_with_an_invalid_user_token(): void
{
config(['services.slack.auto_invite.enabled' => true]);

$this->get('/slack/invite?t=0987654321234567890')->assertStatus(Response::HTTP_UNAUTHORIZED);
}

public function testItReturnsUnauthorizedWithAValidUserTokenThatIsNotInTheDatabase(): void
public function test_it_returns_unauthorized_with_a_valid_user_token_that_is_not_in_the_database(): void
{
config(['services.slack.auto_invite.enabled' => true]);
$token = Crypt::encrypt(1234567890987654321);
Expand All @@ -57,7 +57,7 @@ public function provideNonActiveMemberStatuses(): array
}

/** @dataProvider provideNonActiveMemberStatuses */
public function testItReturnsForbiddenWithAValidUserTokenThatIsNotAnActiveMember(string $status): void
public function test_it_returns_forbidden_with_a_valid_user_token_that_is_not_an_active_member(string $status): void
{
config(['services.slack.auto_invite.enabled' => true]);
$user = User::factory()->create(['status' => $status]);
Expand All @@ -66,7 +66,7 @@ public function testItReturnsForbiddenWithAValidUserTokenThatIsNotAnActiveMember
$this->get("/slack/invite?t={$token}")->assertStatus(Response::HTTP_FORBIDDEN);
}

public function testItRedirectsToTheConfiguredSlackInviteUrlWithAValidUserToken(): void
public function test_it_redirects_to_the_configured_slack_invite_url_with_a_valid_user_token(): void
{
$redirectUrl = 'https://www.geralt.of/rivia';
config(['services.slack.auto_invite.url' => $redirectUrl]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function provideValidInviteStatuses(): array
}

/** @dataProvider provideValidInviteStatuses */
public function testItQueuesSlackInviteEmailWhenUserIsMovedFromValidStatusToActive(
public function test_it_queues_slack_invite_email_when_user_is_moved_from_valid_status_to_active(
string $status,
bool $shouldSend
): void {
Expand Down Expand Up @@ -102,7 +102,7 @@ public function testItQueuesSlackInviteEmailWhenUserIsMovedFromValidStatusToActi
}

/** @dataProvider provideValidInviteStatuses */
public function testItDoesNotQueueSlackInviteEmailWhenUserIsMovedFromValidStatusToActiveWhenNotEnabled(
public function test_it_does_not_queue_slack_invite_email_when_user_is_moved_from_valid_status_to_active_when_not_enabled(
string $status
): void {
Mail::fake();
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Http/Middleware/HttpsProtocolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class HttpsProtocolTest extends TestCase
{
public function testItRedirectsToHttpsInProductionEnvironment(): void
public function test_it_redirects_to_https_in_production_environment(): void
{
config(['app.env' => 'production']);
$_SERVER['HTTPS'] = false;
Expand All @@ -31,7 +31,7 @@ public function testItRedirectsToHttpsInProductionEnvironment(): void
}

/** @dataProvider provideNonProductionEnvironments */
public function testItDoesNotRedirectToHttpsOutsideProductionEnvironment(string $environment): void
public function test_it_does_not_redirect_to_https_outside_production_environment(string $environment): void
{
config(['app.env' => $environment]);
$_SERVER['HTTPS'] = false;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Mail/MailingListSubscribeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class MailingListSubscribeTest extends TestCase
{
use RefreshDatabase;

public function testItBuildsWithExpectedRecipientAndContent()
public function test_it_builds_with_expected_recipient_and_content()
{
config([$this->getToAddressConfigPath() => '[email protected]']);
config([$this->getPasswordConfigPath() => 'w1nd5h0wl1ng']);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Mail/SlackInviteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SlackInviteTest extends TestCase
{
use RefreshDatabase;

public function testItBuildsWithExpectedRecipientAndContent()
public function test_it_builds_with_expected_recipient_and_content()
{
$user = User::factory()->active()->create();

Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Models/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class UserNameTest extends TestCase

private $unique_name = 'noenveriovfero';

public function testGetNameWorksWithPreferredLastName(): void
public function test_get_name_works_with_preferred_last_name(): void
{
$user = User::factory()->create();

Expand All @@ -25,7 +25,7 @@ public function testGetNameWorksWithPreferredLastName(): void
$this->assertEquals($expected_name, $user->get_name());
}

public function testGetNameWorksWithPreferredFirstName(): void
public function test_get_name_works_with_preferred_first_name(): void
{
$user = User::factory()->create();

Expand All @@ -38,7 +38,7 @@ public function testGetNameWorksWithPreferredFirstName(): void
$this->assertEquals($expected_name, $user->get_name());
}

public function testGetNameWorksWithNoPreferredName(): void
public function test_get_name_works_with_no_preferred_name(): void
{
$user = User::factory()->create();

Expand All @@ -51,7 +51,7 @@ public function testGetNameWorksWithNoPreferredName(): void
$this->assertEquals($expected_name, $user->get_name());
}

public function testGetNameWorksWithBothPreferredNames(): void
public function test_get_name_works_with_both_preferred_names(): void
{
$user = User::factory()->create();

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Services/Slack/KosBotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class KosBotTest extends TestCase

private KosBot $kosBot;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();
$this->slack = $this->createMock(Slack::class);
$this->kosBot = new KosBot($this->slack);
}

public function testItPostsANewApplicantMessageToTheApplicantsSlackChannel(): void
public function test_it_posts_a_new_applicant_message_to_the_applicants_slack_channel(): void
{
config()->set('services.slack.channels.applicants', '0987654321');

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Services/Slack/Models/ChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class ChannelTest extends TestCase
{
public function testItCanBeConstructedWithAnId(): void
public function test_it_can_be_constructed_with_an_id(): void
{
$channel = new Channel('GeraltOfRivia');
$this->assertEquals('GeraltOfRivia', $channel->getId());
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Services/Slack/Models/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@

class MessageTest extends TestCase
{
public function testItCanBeConstructedWithAnId(): void
public function test_it_can_be_constructed_with_an_id(): void
{
$message = new Message('GeraltOfRivia');
$this->assertEquals('GeraltOfRivia', $message->getId());
}

public function testItCanBeConstructedWithoutAnId(): void
public function test_it_can_be_constructed_without_an_id(): void
{
$message = new Message;
$this->assertNull($message->getId());
}

public function testItCanFluentlySetTheText(): void
public function test_it_can_fluently_set_the_text(): void
{
$message = new Message;

Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Services/Slack/SlackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ class SlackTest extends TestCase
{
use MocksGuzzleHistory;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();
$this->mockGuzzleHistory($this->guzzleHistory, ['base_uri' => 'https://slack.com/api/']);
}

public function testItCanBeConstructedWithAnOauthToken(): void
public function test_it_can_be_constructed_with_an_oauth_token(): void
{
$slack = new Slack('geralt-of-rivia', $this->getGuzzleClient());
$this->assertEquals('geralt-of-rivia', $slack->getToken());
}

public function testItIsConstructedFromTheAppContainerWithTheConfiguredOauthToken(): void
public function test_it_is_constructed_from_the_app_container_with_the_configured_oauth_token(): void
{
$originalOauthToken = config('services.slack.oauth_token');
config()->set('services.slack.oauth_token', 'geralt-of-rivia');
Expand All @@ -38,7 +38,7 @@ public function testItIsConstructedFromTheAppContainerWithTheConfiguredOauthToke
config()->set('services.slack.oauth_token', $originalOauthToken);
}

public function testItMakesAnHttpRequestToPostANewMessageToAChannel(): void
public function test_it_makes_an_http_request_to_post_a_new_message_to_a_channel(): void
{
$this->appendJsonResponse(
Response::HTTP_CREATED,
Expand Down
Loading