10000 Add test · PaolaRuby/laravel-permission@43e848e · GitHub
[go: up one dir, main page]

Skip to content

Commit 43e848e

Browse files
committed
Add test
1 parent 9006b9d commit 43e848e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/CacheTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,17 @@ public function get_all_permissions_should_use_the_cache()
203203
$this->assertQueryCount(2);
204204
}
205205

206+
/** @test */
207+
public function get_all_permissions_should_not_over_hydrate_roles()
208+
{
209+
$this->testUserRole->givePermissionTo(['edit-articles', 'edit-news']);
210+
$permissions = $this->registrar->getPermissions();
211+
$roles = $permissions->flatMap->roles;
212+
213+
// Should have same object reference
214+
$this->assertSame($roles[0], $roles[1]);
215+
}
216+
206217
/** @test */
207218
public function it_can_reset_the_cache_with_artisan_command()
208219
{

0 commit comments

Comments
 (0)
0