<?php

namespace Tests;

use App\Services\BranchContext;
use Closure;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    protected function inBranch(int $branchId, Closure $callback): mixed
    {
        return app(BranchContext::class)->forBranch($branchId, $callback);
    }

    protected function inBranches(array $branchIds, Closure $callback): mixed
    {
        return app(BranchContext::class)->forBranches($branchIds, $callback);
    }

    protected function systemWide(Closure $callback): mixed
    {
        return app(BranchContext::class)->systemWide($callback);
    }
}
