<?php

namespace Tests;

use Illuminate\Database\Capsule\Manager as DB;
use PHPUnit\Framework\TestCase as BaseTestCase;

class TestCase extends BaseTestCase
{
    protected function setUp(): void
    {
        parent::setUp();

        // Wrap each test in a transaction for isolation
        DB::beginTransaction();
    }

    protected function tearDown(): void
    {
        // Roll back all changes from the test
        DB::rollBack();

        parent::tearDown();
    }
}
