Fix tests
continuous-integration/drone/push Build is failing Details

This commit is contained in:
philipp lang 2024-09-22 12:28:10 +02:00
parent c3908b714b
commit a5f1c90003
6 changed files with 12 additions and 13 deletions

View File

@ -17,6 +17,6 @@ class ListFilesAction
*/ */
public function handle(ActionRequest $request, Fileshare $fileshare): DataCollection public function handle(ActionRequest $request, Fileshare $fileshare): DataCollection
{ {
return ResourceData::collect($fileshare->type->getSubDirectories($request->input('parent')))->wrap('data'); return ResourceData::collect($fileshare->type->getSubDirectories($request->input('parent')), DataCollection::class)->wrap('data');
} }
} }

@ -1 +1 @@
Subproject commit 7c876d75c9b6ec9fd36511b743beae0d40532878 Subproject commit 3f5321af9d6d48e1e50d6041548abfb74e594de0

View File

@ -20,7 +20,7 @@ class InitializeMembersTest extends TestCase
$this->loginNami(); $this->loginNami();
$api = app(NamiSettings::class)->login(); $api = app(NamiSettings::class)->login();
app(SearchFake::class)->fetches(1, 0, 100, [ app(SearchFake::class)->fetches(1, 0, 100, [
MemberEntry::factory()->toMember(['groupId' => 100, 'id' => 20]), MemberEntry::toFactory()->toMember(['groupId' => 100, 'id' => 20]),
]); ]);
FullMemberAction::partialMock()->shouldReceive('configureJob')->once(); FullMemberAction::partialMock()->shouldReceive('configureJob')->once();
FullMemberAction::partialMock()->shouldReceive('handle')->once(); FullMemberAction::partialMock()->shouldReceive('handle')->once();
@ -32,7 +32,7 @@ class InitializeMembersTest extends TestCase
{ {
$this->loginNami(); $this->loginNami();
app(SearchFake::class)->fetches(1, 0, 100, [ app(SearchFake::class)->fetches(1, 0, 100, [
MemberEntry::factory()->toMember(['groupId' => 100, 'id' => 20]), MemberEntry::toFactory()->toMember(['groupId' => 100, 'id' => 20]),
]); ]);
FullMemberAction::partialMock()->shouldReceive('configureJob')->once(); FullMemberAction::partialMock()->shouldReceive('configureJob')->once();
FullMemberAction::partialMock()->shouldReceive('handle')->once(); FullMemberAction::partialMock()->shouldReceive('handle')->once();

View File

@ -23,8 +23,8 @@ class SearchTest extends TestCase
{ {
$this->withoutExceptionHandling(); $this->withoutExceptionHandling();
app(SearchFake::class)->fetches(1, 0, 10, [ app(SearchFake::class)->fetches(1, 0, 10, [
MemberEntry::factory()->state(['id' => 2, 'groupId' => 100, 'firstname' => 'Max', 'lastname' => 'Muster', 'birthday' => '2013-07-04 00:00:00'])->toMember(), MemberEntry::toFactory()->state(['id' => 2, 'groupId' => 100, 'firstname' => 'Max', 'lastname' => 'Muster', 'birthday' => '2013-07-04 00:00:00'])->toMember(),
MemberEntry::factory()->state(['id' => 2, 'groupId' => 150, 'firstname' => 'Jane', 'lastname' => 'Muster', 'birthday' => '2013-07-04 00:00:00'])->toMember(), MemberEntry::toFactory()->state(['id' => 2, 'groupId' => 150, 'firstname' => 'Jane', 'lastname' => 'Muster', 'birthday' => '2013-07-04 00:00:00'])->toMember(),
]); ]);
Auth::success(333, 'secret'); Auth::success(333, 'secret');
@ -53,7 +53,7 @@ class SearchTest extends TestCase
{ {
$this->withoutExceptionHandling(); $this->withoutExceptionHandling();
app(SearchFake::class)->fetches(1, 0, 10, [ app(SearchFake::class)->fetches(1, 0, 10, [
MemberEntry::factory()->noFirstname()->toMember(), MemberEntry::toFactory()->noFirstname()->toMember(),
]); ]);
Auth::success(333, 'secret'); Auth::success(333, 'secret');
@ -70,8 +70,8 @@ class SearchTest extends TestCase
{ {
$this->withoutExceptionHandling(); $this->withoutExceptionHandling();
app(SearchFake::class)->fetches(2, 10, 10, [ app(SearchFake::class)->fetches(2, 10, 10, [
MemberEntry::factory()->toMember(), MemberEntry::toFactory()->toMember(),
MemberEntry::factory()->toMember(), MemberEntry::toFactory()->toMember(),
]); ]);
Auth::success(333, 'secret'); Auth::success(333, 'secret');

View File

@ -7,7 +7,6 @@ use App\Activity;
use App\Country; use App\Country;
use App\Course\Models\Course; use App\Course\Models\Course;
use App\Course\Models\CourseMember; use App\Course\Models\CourseMember;
use App\Fee;
use App\Gender; use App\Gender;
use App\Group; use App\Group;
use App\Member\Member; use App\Member\Member;
@ -48,7 +47,7 @@ class PullCoursesActionTest extends TestCase
$activity = Activity::factory()->inNami(1003)->name('Tätigkeit')->create(); $activity = Activity::factory()->inNami(1003)->name('Tätigkeit')->create();
$member = Member::factory()->defaults()->for(Group::factory()->inNami(1000)->name('SG Wald'))->inNami(1001)->create(); $member = Member::factory()->defaults()->for(Group::factory()->inNami(1000)->name('SG Wald'))->inNami(1001)->create();
$course = Course::factory()->name('BS')->inNami(11)->create(); $course = Course::factory()->name('BS')->inNami(11)->create();
app(CourseFake::class)->fetches(1001, [50])->shows(1001, NamiCourse::factory()->toCourse([ app(CourseFake::class)->fetches(1001, [50])->shows(1001, NamiCourse::toFactory()->toCourse([
'courseId' => 11, 'courseId' => 11,
'organizer' => 'TTT', 'organizer' => 'TTT',
'eventName' => 'Schulung', 'eventName' => 'Schulung',
@ -93,7 +92,7 @@ class PullCoursesActionTest extends TestCase
->has(CourseMember::factory()->for(Course::factory()->inNami(50))->inNami(55), 'courses') ->has(CourseMember::factory()->for(Course::factory()->inNami(50))->inNami(55), 'courses')
->inNami(1001) ->inNami(1001)
->create(); ->create();
app(CourseFake::class)->fetches(1001, [55])->shows(1001, NamiCourse::factory()->toCourse(['id' => 55, 'courseId' => 50, 'organizer' => 'ZZU'])); app(CourseFake::class)->fetches(1001, [55])->shows(1001, NamiCourse::toFactory()->toCourse(['id' => 55, 'courseId' => 50, 'organizer' => 'ZZU']));
app(PullCoursesAction::class)->handle($member); app(PullCoursesAction::class)->handle($member);

View File

@ -30,7 +30,7 @@ class RemoteSearchTest extends TestCase
{ {
Auth::success(90100, 'secret'); Auth::success(90100, 'secret');
app(SearchFake::class)->fetches(1, 0, 50, [ app(SearchFake::class)->fetches(1, 0, 50, [
MemberEntry::factory()->toMember(['groupId' => 100, 'id' => 20, 'memberId' => 56, 'firstname' => 'Max', 'lastname' => 'Muster']), MemberEntry::toFactory()->toMember(['groupId' => 100, 'id' => 20, 'memberId' => 56, 'firstname' => 'Max', 'lastname' => 'Muster']),
]); ]);
$accessToken = $this->loginRemotely()->json('access_token'); $accessToken = $this->loginRemotely()->json('access_token');