Compare commits
2 Commits
35a8c59055
...
0fb259a373
Author | SHA1 | Date |
---|---|---|
|
0fb259a373 | |
|
e299e8b159 |
|
@ -33,6 +33,8 @@ class FormApiResource extends JsonResource
|
|||
'slug' => $this->slug,
|
||||
'dates' => $this->from->equalTo($this->to) ? $this->from->format('d.m.Y') : $this->from->format('d.m.Y') . ' - ' . $this->to->format('d.m.Y'),
|
||||
'image' => $this->getMedia('headerImage')->first()->getFullUrl('square'),
|
||||
'is_active' => $this->is_active,
|
||||
'is_private' => $this->is_private,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ use Tests\RequestFactories\EditorRequestFactory;
|
|||
* @method self excerpt(string $excerpt)
|
||||
* @method self registrationFrom(string|null $date)
|
||||
* @method self registrationUntil(string|null $date)
|
||||
* @method self isActive(bool $isActive)
|
||||
* @method self isPrivate(bool $isPrivate)
|
||||
*/
|
||||
class FormFactory extends Factory
|
||||
{
|
||||
|
|
|
@ -84,7 +84,9 @@ class FormApiListActionTest extends FormTestCase
|
|||
sleep(1);
|
||||
$this->get('/api/form?perPage=15&filter=' . $this->filterString(['inactive' => true]))->assertJsonCount(3, 'data');
|
||||
$this->get('/api/form?perPage=15&filter=' . $this->filterString(['inactive' => false]))->assertJsonCount(2, 'data');
|
||||
$this->get('/api/form?perPage=15&filter=' . $this->filterString([]))->assertJsonCount(2, 'data');
|
||||
$this->get('/api/form?perPage=15&filter=' . $this->filterString([]))->assertJsonCount(2, 'data')
|
||||
->assertJsonPath('data.0.is_active', true)
|
||||
->assertJsonPath('data.0.is_private', false);
|
||||
}
|
||||
|
||||
public function testItDisplaysDailyForms(): void
|
||||
|
|
|
@ -17,6 +17,8 @@ use Worksome\RequestFactories\RequestFactory;
|
|||
* @method self excerpt(string $description)
|
||||
* @method self registrationFrom(string|null $date)
|
||||
* @method self registrationUntil(string|null $date)
|
||||
* @method self isActive(bool $isActive)
|
||||
* @method self isPrivate(bool $isPrivate)
|
||||
*/
|
||||
class FormRequest extends RequestFactory
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue