Skip to content

Commit

Permalink
refactor: Move property to local variable on usage only in setUp() me…
Browse files Browse the repository at this point in the history
…thod in tests
  • Loading branch information
samsonasik committed Nov 5, 2024
1 parent bb87c07 commit ba62a54
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ final class SessionAuthenticatorTest extends DatabaseTestCase
use FakeUser;

private Session $auth;
protected $namespace;
private MockEvents $events;

protected function setUp(): void
{
Expand All @@ -51,8 +49,8 @@ protected function setUp(): void
$authenticator = $auth->factory('session');
$this->auth = $authenticator;

$this->events = new MockEvents();
Services::injectMock('events', $this->events);
$events = new MockEvents();
Services::injectMock('events', $events);

$this->db->table($this->tables['identities'])->truncate();
}
Expand Down
2 changes: 0 additions & 2 deletions tests/Authentication/Filters/JWTFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ final class JWTFilterTest extends DatabaseTestCase
{
use FeatureTestTrait;

protected $namespace;

protected function setUp(): void
{
Services::reset(true);
Expand Down
1 change: 0 additions & 1 deletion tests/Authentication/MagicLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ final class MagicLinkTest extends DatabaseTestCase
use FeatureTestTrait;

protected $refresh = true;
protected $namespace;

protected function setUp(): void
{
Expand Down
1 change: 0 additions & 1 deletion tests/Authorization/AuthorizableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ final class AuthorizableTest extends DatabaseTestCase
use FakeUser;

protected $refresh = true;
protected $namespace;

protected function setUp(): void
{
Expand Down
2 changes: 0 additions & 2 deletions tests/Controllers/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ final class LoginTest extends DatabaseTestCase
use FeatureTestTrait;
use FakeUser;

protected $namespace;

protected function setUp(): void
{
parent::setUp();
Expand Down
2 changes: 0 additions & 2 deletions tests/Controllers/RegisterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ final class RegisterTest extends DatabaseTestCase
use FeatureTestTrait;
use FakeUser;

protected $namespace;

protected function setUp(): void
{
Services::reset(true);
Expand Down

0 comments on commit ba62a54

Please sign in to comment.