Add male and female for member factory
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2024-06-12 00:04:13 +02:00
parent 452505632e
commit 700d69d1a2
3 changed files with 15 additions and 5 deletions

View File

@ -28,6 +28,16 @@ class GenderFactory extends Factory
return $this->state(['name' => $name]); return $this->state(['name' => $name]);
} }
public function male(): self
{
return $this->name('Männlich');
}
public function female(): self
{
return $this->name('Weiblich');
}
public function inNami(int $namiId): self public function inNami(int $namiId): self
{ {
return $this->state(['nami_id' => $namiId]); return $this->state(['nami_id' => $namiId]);

View File

@ -36,8 +36,8 @@ class StoreTest extends TestCase
$this->withoutExceptionHandling(); $this->withoutExceptionHandling();
Tex::spy(); Tex::spy();
$this->login()->loginNami(); $this->login()->loginNami();
$member1 = Member::factory()->defaults()->for(Gender::factory())->create(['address' => 'Maxstr 44', 'zip' => '42719', 'firstname' => 'Max', 'lastname' => 'Muster']); $member1 = Member::factory()->defaults()->create(['address' => 'Maxstr 44', 'zip' => '42719', 'firstname' => 'Max', 'lastname' => 'Muster']);
$member2 = Member::factory()->defaults()->for(Gender::factory())->create(['address' => 'Maxstr 44', 'zip' => '42719', 'firstname' => 'Jane', 'lastname' => 'Muster']); $member2 = Member::factory()->defaults()->create(['address' => 'Maxstr 44', 'zip' => '42719', 'firstname' => 'Jane', 'lastname' => 'Muster']);
$response = $this->call('GET', '/contribution-generate', [ $response = $this->call('GET', '/contribution-generate', [
'payload' => ContributionRequestFactory::new()->type($type)->state([ 'payload' => ContributionRequestFactory::new()->type($type)->state([
@ -72,8 +72,8 @@ class StoreTest extends TestCase
{ {
$this->withoutExceptionHandling(); $this->withoutExceptionHandling();
Tex::spy(); Tex::spy();
Gender::factory()->create(['name' => 'Weiblich']); Gender::factory()->female()->create();
Gender::factory()->create(['name' => 'Männlich']); Gender::factory()->male()->create();
Passport::actingAsClient(Client::factory()->create(), ['contribution-generate']); Passport::actingAsClient(Client::factory()->create(), ['contribution-generate']);
$country = Country::factory()->create(); $country = Country::factory()->create();
Member::factory()->defaults()->create(['address' => 'Maxstr 44', 'zip' => '42719', 'firstname' => 'Max', 'lastname' => 'Muster']); Member::factory()->defaults()->create(['address' => 'Maxstr 44', 'zip' => '42719', 'firstname' => 'Max', 'lastname' => 'Muster']);

View File

@ -35,7 +35,7 @@ class ShowTest extends TestCase
->for(Group::factory()->name('Stamm Beispiel')) ->for(Group::factory()->name('Stamm Beispiel'))
->has(Membership::factory()->promise(now())->in('€ LeiterIn', 5, 'Jungpfadfinder', 88)->from('2022-11-19')) ->has(Membership::factory()->promise(now())->in('€ LeiterIn', 5, 'Jungpfadfinder', 88)->from('2022-11-19'))
->has(InvoicePosition::factory()->for(Invoice::factory())->price(1050)->description('uu')) ->has(InvoicePosition::factory()->for(Invoice::factory())->price(1050)->description('uu'))
->for(Gender::factory()->name('Männlich')) ->for(Gender::factory()->male())
->for(Region::factory()->name('NRW')) ->for(Region::factory()->name('NRW'))
->postBillKind() ->postBillKind()
->inNami(123) ->inNami(123)