mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 12:42:15 +01:00
Fixed broken test
This commit is contained in:
committed by
Constantin Graf
parent
ee77de04ef
commit
0245eccaeb
@@ -65,6 +65,12 @@ class TimeEntryAggregationService
|
|||||||
if ($groupBy !== null) {
|
if ($groupBy !== null) {
|
||||||
$timeEntriesQuery->groupBy($groupBy);
|
$timeEntriesQuery->groupBy($groupBy);
|
||||||
}
|
}
|
||||||
|
if ($group1Select !== null) {
|
||||||
|
$timeEntriesQuery->orderBy('group_1');
|
||||||
|
if ($group2Select !== null) {
|
||||||
|
$timeEntriesQuery->orderBy('group_2');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$timeEntriesAggregates = $timeEntriesQuery->get();
|
$timeEntriesAggregates = $timeEntriesQuery->get();
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ namespace Tests\Unit\Service\Export;
|
|||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
use App\Models\Member;
|
use App\Models\Member;
|
||||||
use App\Models\Organization;
|
use App\Models\Organization;
|
||||||
|
use App\Models\OrganizationInvitation;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Models\ProjectMember;
|
use App\Models\ProjectMember;
|
||||||
|
use App\Models\Tag;
|
||||||
use App\Models\Task;
|
use App\Models\Task;
|
||||||
use App\Models\TimeEntry;
|
use App\Models\TimeEntry;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
@@ -27,6 +29,8 @@ class ExportServiceTest extends TestCaseWithDatabase
|
|||||||
$user1 = User::factory()->create();
|
$user1 = User::factory()->create();
|
||||||
$user2 = User::factory()->create();
|
$user2 = User::factory()->create();
|
||||||
$organization = Organization::factory()->withOwner($user1)->create();
|
$organization = Organization::factory()->withOwner($user1)->create();
|
||||||
|
OrganizationInvitation::factory()->forOrganization($organization)->create();
|
||||||
|
OrganizationInvitation::factory()->forOrganization($organization)->create();
|
||||||
$member1 = Member::factory()->forUser($user1)->forOrganization($organization)->create();
|
$member1 = Member::factory()->forUser($user1)->forOrganization($organization)->create();
|
||||||
$member2 = Member::factory()->forUser($user2)->forOrganization($organization)->create();
|
$member2 = Member::factory()->forUser($user2)->forOrganization($organization)->create();
|
||||||
$timeEntry1 = TimeEntry::factory()->forMember($member1)->create();
|
$timeEntry1 = TimeEntry::factory()->forMember($member1)->create();
|
||||||
@@ -40,6 +44,8 @@ class ExportServiceTest extends TestCaseWithDatabase
|
|||||||
$projectMember2 = ProjectMember::factory()->forMember($member2)->forProject($project1)->create();
|
$projectMember2 = ProjectMember::factory()->forMember($member2)->forProject($project1)->create();
|
||||||
$client1 = Client::factory()->forOrganization($organization)->create();
|
$client1 = Client::factory()->forOrganization($organization)->create();
|
||||||
$client2 = Client::factory()->forOrganization($organization)->create();
|
$client2 = Client::factory()->forOrganization($organization)->create();
|
||||||
|
Tag::factory()->forOrganization($organization)->create();
|
||||||
|
Tag::factory()->forOrganization($organization)->create();
|
||||||
|
|
||||||
return $organization;
|
return $organization;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user