Skip to content

Commit

Permalink
Code style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-cintra committed Oct 30, 2024
1 parent e64c1fc commit b3122ff
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
18 changes: 9 additions & 9 deletions stubs/modules/Acl/Tests/Permission/PermissionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
$response->assertStatus(200);

$response->assertInertia(
fn(Assert $page) => $page
fn (Assert $page) => $page
->component('AclPermission/PermissionIndex')
->has(
'permissions.data',
1,
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->permission->id)
->where('name', $this->permission->name)
->where('guard', null)
Expand All @@ -51,16 +51,16 @@
});

test('permission edit can be rendered', function () {
$response = $this->loggedRequest->get('/admin/acl-permission/' . $this->permission->id . '/edit');
$response = $this->loggedRequest->get('/admin/acl-permission/'.$this->permission->id.'/edit');

$response->assertStatus(200);

$response->assertInertia(
fn(Assert $page) => $page
fn (Assert $page) => $page
->component('AclPermission/PermissionForm')
->has(
'permission',
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->permission->id)
->where('name', $this->permission->name)
->where('guard_name', $this->permission->guard_name)
Expand All @@ -71,20 +71,20 @@
});

test('permission can be updated', function () {
$response = $this->loggedRequest->put('/admin/acl-permission/' . $this->permission->id, [
$response = $this->loggedRequest->put('/admin/acl-permission/'.$this->permission->id, [
'name' => 'z Permission Name',
]);

$response->assertRedirect('/admin/acl-permission');

$redirectResponse = $this->loggedRequest->get('/admin/acl-permission');
$redirectResponse->assertInertia(
fn(Assert $page) => $page
fn (Assert $page) => $page
->component('AclPermission/PermissionIndex')
->has(
'permissions.data',
1,
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->permission->id)
->where('name', 'z Permission Name')
->where('guard', null)
Expand All @@ -93,7 +93,7 @@
});

test('permission can be deleted', function () {
$response = $this->loggedRequest->delete('/admin/acl-permission/' . $this->permission->id);
$response = $this->loggedRequest->delete('/admin/acl-permission/'.$this->permission->id);

$response->assertRedirect('/admin/acl-permission');

Expand Down
10 changes: 5 additions & 5 deletions stubs/modules/Acl/Tests/Permission/UserPermissionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@
});

test('user permissions can be rendered', function () {
$response = $this->loggedRequest->get('/admin/acl-user-permission/' . $this->user->id . '/edit');
$response = $this->loggedRequest->get('/admin/acl-user-permission/'.$this->user->id.'/edit');

$response->assertStatus(200);

$response->assertInertia(
fn(Assert $page) => $page
fn (Assert $page) => $page
->component('AclUserPermission/UserPermissionForm')
->has(
'user',
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->user->id)
->etc()
)
->has(
'userPermissions',
1,
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->permission->id)
->where('name', $this->permission->name)
)
Expand All @@ -52,7 +52,7 @@
});

test('user permissions can be updated', function () {
$response = $this->loggedRequest->put('/admin/acl-user-permission/' . $this->user->id, [
$response = $this->loggedRequest->put('/admin/acl-user-permission/'.$this->user->id, [
'userPermissions' => [$this->permission2->id],
]);

Expand Down
11 changes: 5 additions & 6 deletions stubs/modules/Acl/Tests/Role/RolePermissionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
$this->role = Role::create(['name' => 'root']);
$this->user = User::factory()->create();


$this->permission = Permission::create(['name' => 'first']);
$this->permission2 = Permission::create(['name' => 'second']);

Expand All @@ -24,23 +23,23 @@
});

test('role permissions can be rendered', function () {
$response = $this->loggedRequest->get('/admin/acl-role-permission/' . $this->role->id . '/edit');
$response = $this->loggedRequest->get('/admin/acl-role-permission/'.$this->role->id.'/edit');

$response->assertStatus(200);

$response->assertInertia(
fn(Assert $page) => $page
fn (Assert $page) => $page
->component('AclRolePermission/RolePermissionForm')
->has(
'role',
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->role->id)
->etc()
)
->has(
'role.permissions',
1,
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->permission->id)
->where('name', $this->permission->name)
)
Expand All @@ -52,7 +51,7 @@
});

test('role permissions can be updated', function () {
$response = $this->loggedRequest->put('/admin/acl-role-permission/' . $this->role->id, [
$response = $this->loggedRequest->put('/admin/acl-role-permission/'.$this->role->id, [
'rolePermissions' => [$this->permission2->id],
]);

Expand Down
18 changes: 9 additions & 9 deletions stubs/modules/Acl/Tests/Role/RoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
$response->assertStatus(200);

$response->assertInertia(
fn(Assert $page) => $page
fn (Assert $page) => $page
->component('AclRole/RoleIndex')
->has(
'roles.data',
1,
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->role->id)
->where('name', $this->role->name)
->where('guard_name', $this->role->guard_name)
Expand All @@ -49,16 +49,16 @@
});

test('role edit can be rendered', function () {
$response = $this->loggedRequest->get('/admin/acl-role/' . $this->role->id . '/edit');
$response = $this->loggedRequest->get('/admin/acl-role/'.$this->role->id.'/edit');

$response->assertStatus(200);

$response->assertInertia(
fn(Assert $page) => $page
fn (Assert $page) => $page
->component('AclRole/RoleForm')
->has(
'role',
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->role->id)
->where('name', $this->role->name)
->where('guard_name', $this->role->guard_name)
Expand All @@ -68,20 +68,20 @@
});

test('role can be updated', function () {
$response = $this->loggedRequest->put('/admin/acl-role/' . $this->role->id, [
$response = $this->loggedRequest->put('/admin/acl-role/'.$this->role->id, [
'name' => 'z Role Name',
]);

$response->assertRedirect('/admin/acl-role');

$redirectResponse = $this->loggedRequest->get('/admin/acl-role');
$redirectResponse->assertInertia(
fn(Assert $page) => $page
fn (Assert $page) => $page
->component('AclRole/RoleIndex')
->has(
'roles.data',
1,
fn(Assert $page) => $page
fn (Assert $page) => $page
->where('id', $this->role->id)
->where('name', 'z Role Name')
->where('guard_name', $this->role->guard_name)
Expand All @@ -90,7 +90,7 @@
});

test('role can be deleted', function () {
$response = $this->loggedRequest->delete('/admin/acl-role/' . $this->role->id);
$response = $this->loggedRequest->delete('/admin/acl-role/'.$this->role->id);

$response->assertRedirect('/admin/acl-role');

Expand Down

0 comments on commit b3122ff

Please sign in to comment.