Skip to content

Commit

Permalink
Apply fixes from StyleCI (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: Harish Kumar <hkp22@users.noreply.github.com>
  • Loading branch information
hkp22 and hkp22 authored Sep 9, 2020
1 parent 4cdeeec commit 3475044
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
9 changes: 5 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function publishPackageMigrations()
*/
protected function destroyPackageMigrations()
{
File::cleanDirectory(__DIR__ . '/../vendor/orchestra/testbench-core/laravel/database/migrations');
File::cleanDirectory(__DIR__.'/../vendor/orchestra/testbench-core/laravel/database/migrations');
}

/**
Expand Down Expand Up @@ -93,8 +93,8 @@ private function setDefaultUserModel($app)
*/
protected function setUpDatabase()
{
include_once __DIR__ . '/../migrations/2018_06_25_000000_create_bans_table.php';
include_once __DIR__ . '/database/migrations/2018_06_25_000000__create_user_table.php';
include_once __DIR__.'/../migrations/2018_06_25_000000_create_bans_table.php';
include_once __DIR__.'/database/migrations/2018_06_25_000000__create_user_table.php';

(new \CreateBansTable())->up();
(new \CreateUserTable())->up();
Expand Down Expand Up @@ -129,6 +129,7 @@ public function factory($class, $attributes = [], $amount = null)
public function createUser($class = null, $attributes = [], $amount = null)
{
$class = $class ?? User::class;

return $this->factory(
$class,
array_merge(
Expand Down Expand Up @@ -161,4 +162,4 @@ public function createBan($attributes = [], $amount = null)
$amount
);
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/BanExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function it_can_throw_BannableTraitNotUsed_exception()
$response = $middleware->handle($request, function () {
});
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/BanMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ public function it_cannot_redirect_to_non_banned_user()

$this->assertEquals($response, null);
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/BanModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ public function it_can_scope_bannable_models()
$bannableModels = Ban::whereBannable($user2)->get();
$this->assertCount(2, $bannableModels);
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/BanObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ public function it_can_unset_banned_flag_to_owner_model_on_delete()

$this->assertNull($user->fresh()->banned_at);
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/BannableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ public function model_can_ban_with_expiration_date()

$this->assertEquals('2086-03-28 00:00:00', $ban->expired_at);
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/BannedScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ public function it_can_disable_banned_at_default_scope()

$this->assertCount(5, $entities);
}
}
}
6 changes: 3 additions & 3 deletions tests/Unit/ModelBannedEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function it_can_fire_event_on_helper_call()
{
$this->expectsEvents(ModelWasBanned::class);

$entity = $this->createUser(User::class);;
$entity = $this->createUser(User::class);

$entity->ban();
}
Expand All @@ -23,8 +23,8 @@ public function it_can_fire_event_on_relation_create()
{
$this->expectsEvents(ModelWasBanned::class);

$entity = $this->createUser(User::class);;
$entity = $this->createUser(User::class);

$entity->bans()->create();
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/ModelUnbannedEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function it_can_fire_event_on_relation_delete()

$ban->delete();
}
}
}

0 comments on commit 3475044

Please sign in to comment.