mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Add ability to update billable rate of existing time entries
This commit is contained in:
committed by
Gregor Vostrak
parent
7c26cee1ea
commit
2184b3c835
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user