@@ -14,23 +14,22 @@ final class CustomTest extends TestCase
1414{
1515 public function test_closure_validation_passes (): void
1616 {
17- $ rule = new Custom (static fn (mixed $ value ): bool => str_contains ((string ) $ value , '@ ' ));
18-
17+ $ rule = new Custom (static fn (mixed $ value ): bool => str_contains ((string ) $ value , '@ ' ));
1918 $ this ->
assertTrue (
$ rule->
isValid (
'[email protected] ' ));
2019 $ this ->
assertTrue (
$ rule->
isValid (
'[email protected] ' ));
2120 }
2221
2322 public function test_closure_validation_fails (): void
2423 {
25- $ rule = new Custom (static fn (mixed $ value ): bool => str_contains ((string ) $ value , '@ ' ));
24+ $ rule = new Custom (static fn (mixed $ value ): bool => str_contains ((string ) $ value , '@ ' ));
2625
2726 $ this ->assertFalse ($ rule ->isValid ('username ' ));
2827 $ this ->assertFalse ($ rule ->isValid ('example.com ' ));
2928 }
3029
3130 public function test_non_string_value_fails (): void
3231 {
33- $ rule = new Custom (static fn (mixed $ value ): bool => str_contains ((string ) $ value , '@ ' ));
32+ $ rule = new Custom (static fn (mixed $ value ): bool => str_contains ((string ) $ value , '@ ' ));
3433
3534 $ this ->assertFalse ($ rule ->isValid (12345 ));
3635 $ this ->assertFalse ($ rule ->isValid (null ));
@@ -41,7 +40,6 @@ public function test_static_closure_required(): void
4140 {
4241 $ this ->expectException (\InvalidArgumentException::class);
4342
44- // Non-static closure should throw exception
45- new Custom (fn (mixed $ value ): bool => str_contains ((string ) $ value , '@ ' ));
43+ new Custom (fn (mixed $ value ): bool => str_contains ((string ) $ value , '@ ' ));
4644 }
4745}
0 commit comments