adrema/tests/Feature/Invoice/InvoicePositionRequestFacto...

40 lines
882 B
PHP
Raw Normal View History

2023-12-13 00:35:39 +01:00
<?php
namespace Tests\Feature\Invoice;
use App\Member\Member;
use Worksome\RequestFactories\RequestFactory;
class InvoicePositionRequestFactory extends RequestFactory
{
public function definition(): array
{
return [
'description' => 'Beitrag Abc',
'price' => 3250,
2023-12-17 00:45:03 +01:00
'member_id' => Member::factory()->defaults()->create()->id,
'id' => null,
2023-12-13 00:35:39 +01:00
];
}
public function description(string $description): self
{
return $this->state(['description' => $description]);
}
public function price(int $price): self
{
return $this->state(['price' => $price]);
}
public function member(Member $member): self
{
return $this->state(['member_id' => $member->id]);
}
2023-12-17 00:45:03 +01:00
public function id(int $id): self
{
return $this->state(['id' => $id]);
}
2023-12-13 00:35:39 +01:00
}