7
7
declare (strict_types=1 );
8
8
9
9
use Nette \Application \UI \ComponentReflection as Reflection ;
10
- use Nette \Application \BadRequestException ;
11
10
use Tester \Assert ;
12
11
13
12
require __DIR__ . '/../bootstrap.php ' ;
@@ -54,7 +53,7 @@ test(function () {
54
53
55
54
Assert::exception (function () use ($ method ) {
56
55
Reflection::combineArgs ($ method , ['int ' => []]);
57
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::params() must be scalar, array given. ' );
56
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::params() must be scalar, array given. ' );
58
57
});
59
58
60
59
@@ -66,31 +65,31 @@ test(function () {
66
65
67
66
Assert::exception (function () use ($ method ) {
68
67
Reflection::combineArgs ($ method , []);
69
- }, BadRequestException ::class, 'Missing parameter $int required by MyPresenter::hints() ' );
68
+ }, Nette \InvalidArgumentException ::class, 'Missing parameter $int required by MyPresenter::hints() ' );
70
69
71
70
Assert::exception (function () use ($ method ) {
72
71
Reflection::combineArgs ($ method , ['int ' => '' ]);
73
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hints() must be int, string given. ' );
72
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hints() must be int, string given. ' );
74
73
75
74
Assert::exception (function () use ($ method ) {
76
75
Reflection::combineArgs ($ method , ['int ' => NULL ]);
77
- }, BadRequestException ::class, 'Missing parameter $int required by MyPresenter::hints() ' );
76
+ }, Nette \InvalidArgumentException ::class, 'Missing parameter $int required by MyPresenter::hints() ' );
78
77
79
78
Assert::exception (function () use ($ method ) {
80
79
Reflection::combineArgs ($ method , ['int ' => new stdClass ]);
81
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hints() must be int, stdClass given. ' );
80
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hints() must be int, stdClass given. ' );
82
81
83
82
Assert::exception (function () use ($ method ) {
84
83
Reflection::combineArgs ($ method , ['int ' => []]);
85
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hints() must be int, array given. ' );
84
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hints() must be int, array given. ' );
86
85
87
86
Assert::exception (function () use ($ method ) {
88
87
Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '' ]);
89
- }, BadRequestException ::class, 'Argument $bool passed to MyPresenter::hints() must be bool, string given. ' );
88
+ }, Nette \InvalidArgumentException ::class, 'Argument $bool passed to MyPresenter::hints() must be bool, string given. ' );
90
89
91
90
Assert::exception (function () use ($ method ) {
92
91
Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => '' , 'arr ' => '' ]);
93
- }, BadRequestException ::class, 'Argument $arr passed to MyPresenter::hints() must be array, string given. ' );
92
+ }, Nette \InvalidArgumentException ::class, 'Argument $arr passed to MyPresenter::hints() must be array, string given. ' );
94
93
});
95
94
96
95
@@ -104,23 +103,23 @@ test(function () {
104
103
105
104
Assert::exception (function () use ($ method ) {
106
105
Reflection::combineArgs ($ method , ['int ' => '' ]);
107
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hintsNulls() must be int, string given. ' );
106
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hintsNulls() must be int, string given. ' );
108
107
109
108
Assert::exception (function () use ($ method ) {
110
109
Reflection::combineArgs ($ method , ['int ' => new stdClass ]);
111
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hintsNulls() must be int, stdClass given. ' );
110
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hintsNulls() must be int, stdClass given. ' );
112
111
113
112
Assert::exception (function () use ($ method ) {
114
113
Reflection::combineArgs ($ method , ['int ' => []]);
115
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hintsNulls() must be int, array given. ' );
114
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hintsNulls() must be int, array given. ' );
116
115
117
116
Assert::exception (function () use ($ method ) {
118
117
Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '' ]);
119
- }, BadRequestException ::class, 'Argument $bool passed to MyPresenter::hintsNulls() must be bool, string given. ' );
118
+ }, Nette \InvalidArgumentException ::class, 'Argument $bool passed to MyPresenter::hintsNulls() must be bool, string given. ' );
120
119
121
120
Assert::exception (function () use ($ method ) {
122
121
Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => '' , 'arr ' => '' ]);
123
- }, BadRequestException ::class, 'Argument $arr passed to MyPresenter::hintsNulls() must be array, string given. ' );
122
+ }, Nette \InvalidArgumentException ::class, 'Argument $arr passed to MyPresenter::hintsNulls() must be array, string given. ' );
124
123
});
125
124
126
125
@@ -134,23 +133,23 @@ test(function () {
134
133
135
134
Assert::exception (function () use ($ method ) {
136
135
Reflection::combineArgs ($ method , ['int ' => '' ]);
137
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hintsDefaults() must be int, string given. ' );
136
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hintsDefaults() must be int, string given. ' );
138
137
139
138
Assert::exception (function () use ($ method ) {
140
139
Reflection::combineArgs ($ method , ['int ' => new stdClass ]);
141
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hintsDefaults() must be int, stdClass given. ' );
140
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hintsDefaults() must be int, stdClass given. ' );
142
141
143
142
Assert::exception (function () use ($ method ) {
144
143
Reflection::combineArgs ($ method , ['int ' => []]);
145
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::hintsDefaults() must be int, array given. ' );
144
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::hintsDefaults() must be int, array given. ' );
146
145
147
146
Assert::exception (function () use ($ method ) {
148
147
Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '' ]);
149
- }, BadRequestException ::class, 'Argument $bool passed to MyPresenter::hintsDefaults() must be bool, string given. ' );
148
+ }, Nette \InvalidArgumentException ::class, 'Argument $bool passed to MyPresenter::hintsDefaults() must be bool, string given. ' );
150
149
151
150
Assert::exception (function () use ($ method ) {
152
151
Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => '' , 'arr ' => '' ]);
153
- }, BadRequestException ::class, 'Argument $arr passed to MyPresenter::hintsDefaults() must be array, string given. ' );
152
+ }, Nette \InvalidArgumentException ::class, 'Argument $arr passed to MyPresenter::hintsDefaults() must be array, string given. ' );
154
153
});
155
154
156
155
@@ -164,23 +163,23 @@ test(function () {
164
163
165
164
Assert::exception (function () use ($ method ) {
166
165
Reflection::combineArgs ($ method , ['int ' => '' ]);
167
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::defaults() must be integer, string given. ' );
166
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::defaults() must be integer, string given. ' );
168
167
169
168
Assert::exception (function () use ($ method ) {
170
169
Reflection::combineArgs ($ method , ['int ' => new stdClass ]);
171
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::defaults() must be integer, stdClass given. ' );
170
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::defaults() must be integer, stdClass given. ' );
172
171
173
172
Assert::exception (function () use ($ method ) {
174
173
Reflection::combineArgs ($ method , ['int ' => []]);
175
- }, BadRequestException ::class, 'Argument $int passed to MyPresenter::defaults() must be integer, array given. ' );
174
+ }, Nette \InvalidArgumentException ::class, 'Argument $int passed to MyPresenter::defaults() must be integer, array given. ' );
176
175
177
176
Assert::exception (function () use ($ method ) {
178
177
Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '' ]);
179
- }, BadRequestException ::class, 'Argument $bool passed to MyPresenter::defaults() must be boolean, string given. ' );
178
+ }, Nette \InvalidArgumentException ::class, 'Argument $bool passed to MyPresenter::defaults() must be boolean, string given. ' );
180
179
181
180
Assert::exception (function () use ($ method ) {
182
181
Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => '' , 'arr ' => '' ]);
183
- }, BadRequestException ::class, 'Argument $arr passed to MyPresenter::defaults() must be array, string given. ' );
182
+ }, Nette \InvalidArgumentException ::class, 'Argument $arr passed to MyPresenter::defaults() must be array, string given. ' );
184
183
});
185
184
186
185
@@ -191,17 +190,17 @@ test(function () {
191
190
192
191
Assert::exception (function () use ($ method ) {
193
192
Reflection::combineArgs ($ method , []);
194
- }, BadRequestException ::class, 'Missing parameter $req required by MyPresenter::objects() ' );
193
+ }, Nette \InvalidArgumentException ::class, 'Missing parameter $req required by MyPresenter::objects() ' );
195
194
196
195
Assert::exception (function () use ($ method ) {
197
196
Reflection::combineArgs ($ method , ['req ' => NULL , 'opt ' => NULL ]);
198
- }, BadRequestException ::class, 'Missing parameter $req required by MyPresenter::objects() ' );
197
+ }, Nette \InvalidArgumentException ::class, 'Missing parameter $req required by MyPresenter::objects() ' );
199
198
200
199
Assert::exception (function () use ($ method ) {
201
200
Reflection::combineArgs ($ method , ['req ' => $ method , 'opt ' => NULL ]);
202
- }, BadRequestException ::class, 'Argument $req passed to MyPresenter::objects() must be stdClass, ReflectionMethod given. ' );
201
+ }, Nette \InvalidArgumentException ::class, 'Argument $req passed to MyPresenter::objects() must be stdClass, ReflectionMethod given. ' );
203
202
204
203
Assert::exception (function () use ($ method ) {
205
204
Reflection::combineArgs ($ method , ['req ' => [], 'opt ' => NULL ]);
206
- }, BadRequestException ::class, 'Argument $req passed to MyPresenter::objects() must be stdClass, array given. ' );
205
+ }, Nette \InvalidArgumentException ::class, 'Argument $req passed to MyPresenter::objects() must be stdClass, array given. ' );
207
206
});
0 commit comments