Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tjardoo committed Feb 24, 2024
1 parent d05f033 commit 1d488ae
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 66 deletions.
7 changes: 0 additions & 7 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"require-dev": {
"orchestra/testbench": "^8.0|^9.0",
"nunomaduro/larastan": "^2.0"
"larastan/larastan": "^2.0"
},
"extra": {
"laravel": {
Expand Down
28 changes: 12 additions & 16 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
</testsuites>
<php>
<env name="DB_CONNECTION" value="testing"/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>
</php>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
3 changes: 1 addition & 2 deletions tests/Custom/CustomEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public function setUp(): void
parent::setUp();
}

/** @test */
public function it_can_add_context_to_the_database_record()
public function test_it_can_add_context_to_the_database_record()
{
$event = new \Illuminate\Auth\Events\Login('web', $this->user, false);

Expand Down
30 changes: 10 additions & 20 deletions tests/Events/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public function setUp(): void
parent::setUp();
}

/** @test */
public function it_triggers_log_auth_action_on_attempting_event()
public function test_it_triggers_log_auth_action_on_attempting_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -26,8 +25,7 @@ public function it_triggers_log_auth_action_on_attempting_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_authenticated_event()
public function test_it_triggers_log_auth_action_on_authenticated_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -36,8 +34,7 @@ public function it_triggers_log_auth_action_on_authenticated_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_failed_event()
public function test_it_triggers_log_auth_action_on_failed_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -46,8 +43,7 @@ public function it_triggers_log_auth_action_on_failed_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_lockout_event()
public function test_it_triggers_log_auth_action_on_lockout_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -56,8 +52,7 @@ public function it_triggers_log_auth_action_on_lockout_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_login_event()
public function test_it_triggers_log_auth_action_on_login_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -66,8 +61,7 @@ public function it_triggers_log_auth_action_on_login_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_logout_event()
public function test_it_triggers_log_auth_action_on_logout_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -76,8 +70,7 @@ public function it_triggers_log_auth_action_on_logout_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_other_device_logout_event()
public function test_it_triggers_log_auth_action_on_other_device_logout_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -86,8 +79,7 @@ public function it_triggers_log_auth_action_on_other_device_logout_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_password_reset_event()
public function test_it_triggers_log_auth_action_on_password_reset_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -96,8 +88,7 @@ public function it_triggers_log_auth_action_on_password_reset_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_registered_event()
public function test_it_triggers_log_auth_action_on_registered_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand All @@ -106,8 +97,7 @@ public function it_triggers_log_auth_action_on_registered_event()
$logAuthAction->shouldHaveReceived('handle')->once();
}

/** @test */
public function it_triggers_log_auth_action_on_verified_event()
public function test_it_triggers_log_auth_action_on_verified_event()
{
$logAuthAction = $this->spy(LogAuthAction::class);

Expand Down
30 changes: 10 additions & 20 deletions tests/Listeners/ListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public function setUp(): void
parent::setUp();
}

/** @test */
public function it_creates_a_database_record_on_attempting_event()
public function test_it_creates_a_database_record_on_attempting_event()
{
event(new \Illuminate\Auth\Events\Attempting('web', ['email' => $this->user->email], false));

Expand All @@ -28,8 +27,7 @@ public function it_creates_a_database_record_on_attempting_event()
->get());
}

/** @test */
public function it_does_not_create_a_database_record_on_authenticated_event()
public function test_it_does_not_create_a_database_record_on_authenticated_event()
{
event(new \Illuminate\Auth\Events\Authenticated('web', $this->user));

Expand All @@ -40,8 +38,7 @@ public function it_does_not_create_a_database_record_on_authenticated_event()
->get());
}

/** @test */
public function it_creates_a_database_record_on_failed_event()
public function test_it_creates_a_database_record_on_failed_event()
{
event(new \Illuminate\Auth\Events\Failed('web', null, ['email' => $this->user->email]));

Expand All @@ -52,8 +49,7 @@ public function it_creates_a_database_record_on_failed_event()
->get());
}

/** @test */
public function it_creates_a_database_record_on_lockout_event()
public function test_it_creates_a_database_record_on_lockout_event()
{
$request = new Request(['email' => $this->user->email]);

Expand All @@ -65,8 +61,7 @@ public function it_creates_a_database_record_on_lockout_event()
->get());
}

/** @test */
public function it_creates_a_database_record_on_login_event()
public function test_it_creates_a_database_record_on_login_event()
{
event(new \Illuminate\Auth\Events\Login('web', $this->user, false));

Expand All @@ -77,8 +72,7 @@ public function it_creates_a_database_record_on_login_event()
->get());
}

/** @test */
public function it_creates_a_database_record_on_logout_event()
public function test_it_creates_a_database_record_on_logout_event()
{
event(new \Illuminate\Auth\Events\Logout('web', $this->user));

Expand All @@ -89,8 +83,7 @@ public function it_creates_a_database_record_on_logout_event()
->get());
}

/** @test */
public function it_creates_a_database_record_on_other_device_logout_event()
public function test_it_creates_a_database_record_on_other_device_logout_event()
{
event(new \Illuminate\Auth\Events\OtherDeviceLogout('web', $this->user));

Expand All @@ -101,8 +94,7 @@ public function it_creates_a_database_record_on_other_device_logout_event()
->get());
}

/** @test */
public function it_creates_a_database_record_on_password_reset_event()
public function test_it_creates_a_database_record_on_password_reset_event()
{
event(new \Illuminate\Auth\Events\PasswordReset($this->user));

Expand All @@ -113,8 +105,7 @@ public function it_creates_a_database_record_on_password_reset_event()
->get());
}

/** @test */
public function it_creates_a_database_record_on_registered_event()
public function test_it_creates_a_database_record_on_registered_event()
{
event(new \Illuminate\Auth\Events\Registered($this->user));

Expand All @@ -125,8 +116,7 @@ public function it_creates_a_database_record_on_registered_event()
->get());
}

/** @test */
public function it_creates_a_database_record_on_verified_event()
public function test_it_creates_a_database_record_on_verified_event()
{
event(new \Illuminate\Auth\Events\Verified($this->user));

Expand Down

0 comments on commit 1d488ae

Please sign in to comment.