Skip to content

Commit a629566

Browse files
drbytegithub-actions[bot]
authored andcommitted
Fix styling
1 parent 34744b8 commit a629566

7 files changed

+18
-18
lines changed

config/permission.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
/*
7676
* Change this if you want to name the related pivots other than defaults
7777
*/
78-
'role_pivot_key' => null, //default 'role_id',
79-
'permission_pivot_key' => null, //default 'permission_id',
78+
'role_pivot_key' => null, // default 'role_id',
79+
'permission_pivot_key' => null, // default 'permission_id',
8080

8181
/*
8282
* Change this if you want to name the related model primary key other than

tests/CommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function it_can_setup_teams_upgrade()
149149

150150
$AddTeamsFields = require $matchingFiles[count($matchingFiles) - 1];
151151
$AddTeamsFields->up();
152-
$AddTeamsFields->up(); //test upgrade teams migration fresh
152+
$AddTeamsFields->up(); // test upgrade teams migration fresh
153153

154154
Role::create(['name' => 'new-role', 'team_test_id' => 1]);
155155
$role = Role::where('name', 'new-role')->first();

tests/HasPermissionsTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ public function it_does_not_run_unnecessary_sqls_when_assigning_new_permissions(
654654
$this->testUser->syncPermissions($this->testUserPermission, $permission2);
655655
DB::disableQueryLog();
656656

657-
$this->assertSame(2, count(DB::getQueryLog())); //avoid unnecessary sqls
657+
$this->assertSame(2, count(DB::getQueryLog())); // avoid unnecessary sqls
658658
}
659659

660660
/** @test */
@@ -676,7 +676,7 @@ public function calling_givePermissionTo_before_saving_object_doesnt_interfere_w
676676

677677
$this->assertTrue($user2->fresh()->hasPermissionTo('edit-articles'));
678678
$this->assertFalse($user2->fresh()->hasPermissionTo('edit-news'));
679-
$this->assertSame(2, count(DB::getQueryLog())); //avoid unnecessary sync
679+
$this->assertSame(2, count(DB::getQueryLog())); // avoid unnecessary sync
680680
}
681681

682682
/** @test */
@@ -698,7 +698,7 @@ public function calling_syncPermissions_before_saving_object_doesnt_interfere_wi
698698

699699
$this->assertTrue($user2->fresh()->hasPermissionTo('edit-articles'));
700700
$this->assertFalse($user2->fresh()->hasPermissionTo('edit-news'));
701-
$this->assertSame(2, count(DB::getQueryLog())); //avoid unnecessary sync
701+
$this->assertSame(2, count(DB::getQueryLog())); // avoid unnecessary sync
702702
}
703703

704704
/** @test */

tests/HasPermissionsWithCustomModelsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function it_does_detach_roles_and_users_when_force_deleting()
123123
$this->testUserPermission->forceDelete();
124124
DB::disableQueryLog();
125125

126-
$this->assertSame(3 + $this->resetDatabaseQuery, count(DB::getQueryLog())); //avoid detach permissions on permissions
126+
$this->assertSame(3 + $this->resetDatabaseQuery, count(DB::getQueryLog())); // avoid detach permissions on permissions
127127

128128
$permission = Permission::withTrashed()->find($permission_id);
129129

tests/HasRolesTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public function it_does_not_run_unnecessary_sqls_when_assigning_new_roles()
359359
$this->testUser->syncRoles($this->testUserRole, $role2);
360360
DB::disableQueryLog();
361361

362-
$this->assertSame(2, count(DB::getQueryLog())); //avoid unnecessary sqls
362+
$this->assertSame(2, count(DB::getQueryLog())); // avoid unnecessary sqls
363363
}
364364

365365
/** @test */
@@ -381,7 +381,7 @@ public function calling_syncRoles_before_saving_object_doesnt_interfere_with_oth
381381

382382
$this->assertTrue($user2->fresh()->hasRole('testRole2'));
383383
$this->assertFalse($user2->fresh()->hasRole('testRole'));
384-
$this->assertSame(2, count(DB::getQueryLog())); //avoid unnecessary sync
384+
$this->assertSame(2, count(DB::getQueryLog())); // avoid unnecessary sync
385385
}
386386

387387
/** @test */
@@ -403,7 +403,7 @@ public function calling_assignRole_before_saving_object_doesnt_interfere_with_ot
403403

404404
$this->assertTrue($admin_user->fresh()->hasRole('testRole2'));
405405
$this->assertFalse($admin_user->fresh()->hasRole('testRole'));
406-
$this->assertSame(2, count(DB::getQueryLog())); //avoid unnecessary sync
406+
$this->assertSame(2, count(DB::getQueryLog())); // avoid unnecessary sync
407407
}
408408

409409
/** @test */

tests/TeamHasRolesTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public function it_deletes_pivot_table_entries_when_deleting_models()
3939
/** @test */
4040
public function it_can_assign_same_and_different_roles_on_same_user_different_teams()
4141
{
42-
app(Role::class)->create(['name' => 'testRole3']); //team_test_id = 1 by main class
42+
app(Role::class)->create(['name' => 'testRole3']); // team_test_id = 1 by main class
4343
app(Role::class)->create(['name' => 'testRole3', 'team_test_id' => 2]);
44-
app(Role::class)->create(['name' => 'testRole4', 'team_test_id' => null]); //global role
44+
app(Role::class)->create(['name' => 'testRole4', 'team_test_id' => null]); // global role
4545

4646
$testRole3Team1 = app(Role::class)->where(['name' => 'testRole3', 'team_test_id' => 1])->first();
4747
$testRole3Team2 = app(Role::class)->where(['name' => 'testRole3', 'team_test_id' => 2])->first();
@@ -66,7 +66,7 @@ public function it_can_assign_same_and_different_roles_on_same_user_different_te
6666

6767
$this->testUser->assignRole('testRole3', 'testRole4');
6868
$this->assertTrue($this->testUser->hasExactRoles(['testRole', 'testRole2', 'testRole3', 'testRole4']));
69-
$this->assertTrue($this->testUser->hasRole($testRole3Team1)); //testRole3 team=1
69+
$this->assertTrue($this->testUser->hasRole($testRole3Team1)); // testRole3 team=1
7070
$this->assertTrue($this->testUser->hasRole($testRole4NoTeam)); // global role team=null
7171

7272
setPermissionsTeamId(2);
@@ -77,7 +77,7 @@ public function it_can_assign_same_and_different_roles_on_same_user_different_te
7777
$this->testUser->getRoleNames()->sort()->values()
7878
);
7979
$this->assertTrue($this->testUser->hasExactRoles(['testRole', 'testRole3']));
80-
$this->assertTrue($this->testUser->hasRole($testRole3Team2)); //testRole3 team=2
80+
$this->assertTrue($this->testUser->hasRole($testRole3Team2)); // testRole3 team=2
8181
$this->testUser->assignRole('testRole4');
8282
$this->assertTrue($this->testUser->hasExactRoles(['testRole', 'testRole3', 'testRole4']));
8383
$this->assertTrue($this->testUser->hasRole($testRole4NoTeam)); // global role team=null

tests/TestCase.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected function getEnvironmentSetUp($app)
112112
{
113113
$app['config']->set('permission.register_permission_check_method', true);
114114
$app['config']->set('permission.teams', $this->hasTeams);
115-
$app['config']->set('permission.testing', true); //fix sqlite
115+
$app['config']->set('permission.testing', true); // fix sqlite
116116
$app['config']->set('permission.column_names.model_morph_key', 'model_test_id');
117117
$app['config']->set('permission.column_names.team_foreign_key', 'team_test_id');
118118
$app['config']->set('database.default', 'sqlite');
@@ -143,8 +143,8 @@ protected function getEnvironmentSetUp($app)
143143

144144
// FOR MANUAL TESTING OF ALTERNATE CACHE STORES:
145145
// $app['config']->set('cache.default', 'array');
146-
//Laravel supports: array, database, file
147-
//requires extensions: apc, memcached, redis, dynamodb, octane
146+
// Laravel supports: array, database, file
147+
// requires extensions: apc, memcached, redis, dynamodb, octane
148148
}
149149

150150
/**
@@ -282,7 +282,7 @@ public function setUpRoutes(): void
282282
});
283283
}
284284

285-
////// TEST HELPERS
285+
// //// TEST HELPERS
286286
public function runMiddleware($middleware, $permission, $guard = null, bool $client = false)
287287
{
288288
$request = new Request;

0 commit comments

Comments
 (0)