77declare (strict_types=1 );
88
99use Nette \Application \UI \ComponentReflection as Reflection ;
10- use Nette \Application \BadRequestException ;
1110use Tester \Assert ;
1211
1312require __DIR__ . '/../bootstrap.php ' ;
@@ -54,7 +53,7 @@ test(function () {
5453
5554 Assert::exception (function () use ($ method ) {
5655 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. ' );
5857});
5958
6059
@@ -66,31 +65,31 @@ test(function () {
6665
6766 Assert::exception (function () use ($ method ) {
6867 Reflection::combineArgs ($ method , []);
69- }, BadRequestException ::class, 'Missing parameter $int required by MyPresenter::hints() ' );
68+ }, Nette \InvalidArgumentException ::class, 'Missing parameter $int required by MyPresenter::hints() ' );
7069
7170 Assert::exception (function () use ($ method ) {
7271 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. ' );
7473
7574 Assert::exception (function () use ($ method ) {
7675 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() ' );
7877
7978 Assert::exception (function () use ($ method ) {
8079 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. ' );
8281
8382 Assert::exception (function () use ($ method ) {
8483 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. ' );
8685
8786 Assert::exception (function () use ($ method ) {
8887 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. ' );
9089
9190 Assert::exception (function () use ($ method ) {
9291 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. ' );
9493});
9594
9695
@@ -104,23 +103,23 @@ test(function () {
104103
105104 Assert::exception (function () use ($ method ) {
106105 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. ' );
108107
109108 Assert::exception (function () use ($ method ) {
110109 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. ' );
112111
113112 Assert::exception (function () use ($ method ) {
114113 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. ' );
116115
117116 Assert::exception (function () use ($ method ) {
118117 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. ' );
120119
121120 Assert::exception (function () use ($ method ) {
122121 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. ' );
124123});
125124
126125
@@ -134,23 +133,23 @@ test(function () {
134133
135134 Assert::exception (function () use ($ method ) {
136135 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. ' );
138137
139138 Assert::exception (function () use ($ method ) {
140139 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. ' );
142141
143142 Assert::exception (function () use ($ method ) {
144143 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. ' );
146145
147146 Assert::exception (function () use ($ method ) {
148147 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. ' );
150149
151150 Assert::exception (function () use ($ method ) {
152151 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. ' );
154153});
155154
156155
@@ -164,23 +163,23 @@ test(function () {
164163
165164 Assert::exception (function () use ($ method ) {
166165 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. ' );
168167
169168 Assert::exception (function () use ($ method ) {
170169 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. ' );
172171
173172 Assert::exception (function () use ($ method ) {
174173 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. ' );
176175
177176 Assert::exception (function () use ($ method ) {
178177 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. ' );
180179
181180 Assert::exception (function () use ($ method ) {
182181 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. ' );
184183});
185184
186185
@@ -191,17 +190,17 @@ test(function () {
191190
192191 Assert::exception (function () use ($ method ) {
193192 Reflection::combineArgs ($ method , []);
194- }, BadRequestException ::class, 'Missing parameter $req required by MyPresenter::objects() ' );
193+ }, Nette \InvalidArgumentException ::class, 'Missing parameter $req required by MyPresenter::objects() ' );
195194
196195 Assert::exception (function () use ($ method ) {
197196 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() ' );
199198
200199 Assert::exception (function () use ($ method ) {
201200 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. ' );
203202
204203 Assert::exception (function () use ($ method ) {
205204 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. ' );
207206});
0 commit comments