mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 18:52:14 +01:00
Fixed permissions; Added tests for permission store
This commit is contained in:
committed by
Constantin Graf
parent
75a3404f46
commit
267adf52ca
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use App\Service\PermissionStore;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
@@ -20,6 +21,13 @@ abstract class TestCase extends BaseTestCase
|
||||
LogFake::bind();
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
// Note: It is necessary to clear the permission cache after each test, since the "scoped singletons" are not reset between tests.
|
||||
app(PermissionStore::class)->clear();
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
protected function assertEqualsIdsOfEloquentCollection(array $ids, Collection $models): void
|
||||
{
|
||||
$this->assertEqualsCanonicalizing($ids, $models->pluck('id')->toArray());
|
||||
|
||||
Reference in New Issue
Block a user