@@ -46,10 +46,9 @@ function testThrowIf(float|int $foo): void
46
46
assertType ('never ' , throw_if (true , Exception::class));
47
47
assertType ('bool ' , throw_if (false , Exception::class));
48
48
assertType ('false ' , throw_if (empty ($ foo )));
49
- throw_if (is_float ($ foo ));
50
- assertType ('int ' , $ foo );
51
- throw_if ($ foo == false );
52
- assertType ('int<min, -1>|int<1, max> ' , $ foo );
49
+ assertType ('null ' , throw_if (null , Exception::class));
50
+ assertType ('string ' , throw_if ('' , Exception::class));
51
+ assertType ('never ' , throw_if ('foo ' , Exception::class));
53
52
}
54
53
55
54
function testThrowUnless (float |int $ foo ): void
@@ -58,9 +57,9 @@ function testThrowUnless(float|int $foo): void
58
57
assertType ('never ' , throw_unless (false , Exception::class));
59
58
assertType ('true ' , throw_unless (empty ($ foo )));
60
59
throw_unless (is_int ($ foo ));
61
- assertType ('int ' , $ foo );
62
- throw_unless ($ foo == false );
63
- assertType ('0 ' , $ foo );
60
+ assertType ('never ' , throw_unless ( null , Exception::class) );
61
+ assertType ( ' never ' , throw_unless ('' , Exception::class) );
62
+ assertType ('string ' , throw_unless ( ' foo ' , Exception::class) );
64
63
}
65
64
66
65
assertType ('int ' , transform ('filled ' , fn () => 1 , true ));
0 commit comments