Add ability to update billable rate of existing time entries

This commit is contained in:
Constantin Graf
2024-06-14 16:46:39 +02:00
committed by Gregor Vostrak
parent 7c26cee1ea
commit 2184b3c835
22 changed files with 1001 additions and 25 deletions

View File

@@ -8,6 +8,7 @@ use App\Models\Member;
use App\Models\Organization;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Laravel\Jetstream\Jetstream;
@@ -40,4 +41,25 @@ abstract class TestCaseWithDatabase extends TestCase
'member' => $member,
];
}
protected function enableQueryLog(): void
{
DB::flushQueryLog();
DB::enableQueryLog();
}
protected function getQueryLog(): array
{
if (! DB::logging()) {
throw new \LogicException('Query log is not enabled. Call enableQueryLog() before calling getQueryLog()');
}
return DB::getQueryLog();
}
protected function assertQueryCount(int $count, string $message = ''): void
{
$queryLog = $this->getQueryLog();
$this->assertCount($count, $queryLog, $message);
}
}