From 42ccd3274031e46403eee41819c0b633d1d32c28 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sat, 21 Sep 2024 17:46:07 +0200 Subject: [PATCH] Fix tests --- app/Form/Models/Form.php | 7 ++++--- app/Invoice/Models/Invoice.php | 8 ++------ tests/Feature/Invoice/InvoiceStoreActionTest.php | 2 +- tests/Feature/Invoice/InvoiceUpdateActionTest.php | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/Form/Models/Form.php b/app/Form/Models/Form.php index 6aeb2d6a..d4552aae 100644 --- a/app/Form/Models/Form.php +++ b/app/Form/Models/Form.php @@ -41,11 +41,12 @@ class Form extends Model implements HasMedia 'needs_prevention' => 'boolean', 'prevention_text' => EditorData::class, 'prevention_conditions' => Condition::class, + 'from' => 'datetime', + 'to' => 'datetime', + 'registration_from' => 'datetime', + 'registration_until' => 'datetime', ]; - /** @var array */ - public $dates = ['from', 'to', 'registration_from', 'registration_until']; - /** * @return SluggableConfig */ diff --git a/app/Invoice/Models/Invoice.php b/app/Invoice/Models/Invoice.php index 733125d9..f70e4696 100644 --- a/app/Invoice/Models/Invoice.php +++ b/app/Invoice/Models/Invoice.php @@ -28,12 +28,8 @@ class Invoice extends Model 'to' => 'json', 'status' => InvoiceStatus::class, 'via' => BillKind::class, - ]; - - /** @var array */ - public $dates = [ - 'sent_at', - 'last_remembered_at', + 'sent_at' => 'datetime', + 'last_remembered_at' => 'datetime', ]; /** diff --git a/tests/Feature/Invoice/InvoiceStoreActionTest.php b/tests/Feature/Invoice/InvoiceStoreActionTest.php index 13e936fe..a4d64b30 100644 --- a/tests/Feature/Invoice/InvoiceStoreActionTest.php +++ b/tests/Feature/Invoice/InvoiceStoreActionTest.php @@ -55,7 +55,7 @@ class InvoiceStoreActionTest extends TestCase ], $invoice->to); } - public function validationDataProvider(): Generator + public static function validationDataProvider(): Generator { yield [ ['to.address' => ''], diff --git a/tests/Feature/Invoice/InvoiceUpdateActionTest.php b/tests/Feature/Invoice/InvoiceUpdateActionTest.php index 6bbd8b0b..18212208 100644 --- a/tests/Feature/Invoice/InvoiceUpdateActionTest.php +++ b/tests/Feature/Invoice/InvoiceUpdateActionTest.php @@ -98,7 +98,7 @@ class InvoiceUpdateActionTest extends TestCase $this->assertDatabaseCount('invoice_positions', 0); } - public function validationDataProvider(): Generator + public static function validationDataProvider(): Generator { yield [ ['to.address' => ''],