From cc3c7205063ef9269564387391e59417da75084c Mon Sep 17 00:00:00 2001 From: Milwad Khosravi Date: Sun, 2 Jun 2024 15:29:53 +0330 Subject: [PATCH] add `jalali_date_is_correct_with_different_default_character` test --- tests/Rules/ValidJalaliDateTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Rules/ValidJalaliDateTest.php b/tests/Rules/ValidJalaliDateTest.php index 0e915861..96550afb 100644 --- a/tests/Rules/ValidJalaliDateTest.php +++ b/tests/Rules/ValidJalaliDateTest.php @@ -62,4 +62,21 @@ public function jalali_date_is_not_string() $this->assertFalse($passes); } + + /** + * Test jalali date is correct with different default character. + * + * @test + * + * @return void + */ + public function jalali_date_is_correct_with_different_default_character() + { + $rules = ['jalali_date' => [new ValidJalaliDate('-')]]; + $data = ['jalali_date' => '1384-8-25']; + $passes = $this->app['validator']->make($data, $rules)->passes(); + + $this->assertTrue($passes); + } + }