test: Optimize tests performance
This commit is contained in:
parent
25e6f57f25
commit
3a684114bb
|
|
@ -6,9 +6,6 @@ use App\Models\AccountBalance;
|
|||
use App\Models\Bank;
|
||||
use App\Models\Category;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
$this->user = User::factory()->onboarded()->create();
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ use App\Models\Category;
|
|||
use App\Models\Label;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
$this->user = User::factory()->create([
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ use App\Models\Account;
|
|||
use App\Models\Category;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
$this->user = User::factory()->create();
|
||||
|
|
|
|||
|
|
@ -7,9 +7,6 @@ use App\Models\AccountBalance;
|
|||
use App\Models\Category;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
$this->user = User::factory()->create();
|
||||
|
|
|
|||
|
|
@ -10,11 +10,8 @@ use App\Models\Label;
|
|||
use App\Models\Transaction;
|
||||
use App\Models\User;
|
||||
use App\Models\UserMailLog;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Laravel\Cashier\Subscription;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
test('deletes user and all associated data when confirmed', function () {
|
||||
$user = User::factory()->onboarded()->create([
|
||||
'email' => 'test@example.com',
|
||||
|
|
|
|||
|
|
@ -8,12 +8,9 @@ use App\Models\Category;
|
|||
use App\Models\Label;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
use function Pest\Laravel\actingAs;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
describe('Account Balance IDOR Protection', function () {
|
||||
it('cannot update current balance for another user account via direct manipulation', function () {
|
||||
$attacker = User::factory()->create();
|
||||
|
|
|
|||
Loading…
Reference in New Issue