@@ -35,9 +35,9 @@ private function checkException(?string $message, Throwable $exception)
35
35
* @param mixed ...$params
36
36
* @throws Throwable
37
37
*/
38
- public function assertThrows ($ throws , callable $ func , array $ params = [] )
38
+ public function assertThrows ($ throws , callable $ func , ... $ params )
39
39
{
40
- $ this ->assertThrowsWithMessage ($ throws , null , $ func , $ params );
40
+ $ this ->assertThrowsWithMessage ($ throws , null , $ func , ... $ params );
41
41
}
42
42
43
43
/**
@@ -49,7 +49,7 @@ public function assertThrows($throws, callable $func, array $params = [])
49
49
* @param mixed ...$params
50
50
* @throws Throwable
51
51
*/
52
- public function assertThrowsWithMessage ($ throws , ?string $ message , callable $ func , array $ params = [] )
52
+ public function assertThrowsWithMessage ($ throws , ?string $ message , callable $ func , ... $ params )
53
53
{
54
54
if ($ throws instanceof Throwable) {
55
55
$ message = $ throws ->getMessage ();
@@ -61,7 +61,7 @@ public function assertThrowsWithMessage($throws, ?string $message, callable $fun
61
61
}
62
62
63
63
try {
64
- if ($ params !== [] ) {
64
+ if (! empty ( $ params) ) {
65
65
call_user_func_array ($ func , $ params );
66
66
} else {
67
67
call_user_func ($ func );
@@ -117,9 +117,9 @@ public function assertThrowsWithMessage($throws, ?string $message, callable $fun
117
117
* @param callable $func
118
118
* @param mixed ...$params
119
119
*/
120
- public function assertDoesNotThrow ($ throws , callable $ func , array $ params = [] )
120
+ public function assertDoesNotThrow ($ throws , callable $ func , ... $ params )
121
121
{
122
- $ this ->assertDoesNotThrowWithMessage ($ throws , null , $ func , $ params );
122
+ $ this ->assertDoesNotThrowWithMessage ($ throws , null , $ func , ... $ params );
123
123
}
124
124
125
125
/**
@@ -130,15 +130,15 @@ public function assertDoesNotThrow($throws, callable $func, array $params = [])
130
130
* @param callable $func
131
131
* @param mixed ...$params
132
132
*/
133
- public function assertDoesNotThrowWithMessage ($ throws , ?string $ message , callable $ func , array $ params = [] )
133
+ public function assertDoesNotThrowWithMessage ($ throws , ?string $ message , callable $ func , ... $ params )
134
134
{
135
135
if ($ throws instanceof Throwable) {
136
136
$ message = $ throws ->getMessage ();
137
137
$ throws = get_class ($ throws );
138
138
}
139
139
140
140
try {
141
- if ($ params !== [] ) {
141
+ if (! empty ( $ params) ) {
142
142
call_user_func_array ($ func , $ params );
143
143
} else {
144
144
call_user_func ($ func );
0 commit comments