@@ -60,15 +60,21 @@ test(function () {
6060test (function () {
6161 $ method = new ReflectionMethod ('MyPresenter ' , 'hints ' );
6262
63- Assert::same ([0 , FALSE , '' , []], Reflection::combineArgs ($ method , []));
64- Assert::same ([0 , FALSE , '' , []], Reflection::combineArgs ($ method , ['int ' => NULL , 'bool ' => NULL , 'str ' => NULL , 'arr ' => NULL ]));
6563 Assert::same ([1 , TRUE , 'abc ' , [1 ]], Reflection::combineArgs ($ method , ['int ' => '1 ' , 'bool ' => '1 ' , 'str ' => 'abc ' , 'arr ' => [1 ]]));
66- Assert::same ([0 , FALSE , '' , []], Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => FALSE , 'str ' => '' , 'arr ' => []]));
64+ Assert::same ([0 , FALSE , '' , []], Reflection::combineArgs ($ method , ['int ' => 0 , 'bool ' => FALSE , 'str ' => '' ])); // missing 'arr'
65+
66+ Assert::exception (function () use ($ method ) {
67+ Reflection::combineArgs ($ method , []);
68+ }, BadRequestException::class, 'Missing parameter $int required by MyPresenter::hints() ' );
6769
6870 Assert::exception (function () use ($ method ) {
6971 Reflection::combineArgs ($ method , ['int ' => '' ]);
7072 }, BadRequestException::class, 'Argument $int passed to MyPresenter::hints() must be int, string given. ' );
7173
74+ Assert::exception (function () use ($ method ) {
75+ Reflection::combineArgs ($ method , ['int ' => NULL ]);
76+ }, BadRequestException::class, 'Missing parameter $int required by MyPresenter::hints() ' );
77+
7278 Assert::exception (function () use ($ method ) {
7379 Reflection::combineArgs ($ method , ['int ' => new stdClass ]);
7480 }, BadRequestException::class, 'Argument $int passed to MyPresenter::hints() must be int, stdClass given. ' );
@@ -184,11 +190,11 @@ test(function () {
184190
185191 Assert::exception (function () use ($ method ) {
186192 Reflection::combineArgs ($ method , []);
187- }, BadRequestException::class, 'Argument $req passed to MyPresenter::objects() must be stdClass, NULL given. ' );
193+ }, BadRequestException::class, 'Missing parameter $req required by MyPresenter::objects() ' );
188194
189195 Assert::exception (function () use ($ method ) {
190196 Reflection::combineArgs ($ method , ['req ' => NULL , 'opt ' => NULL ]);
191- }, BadRequestException::class, 'Argument $req passed to MyPresenter::objects() must be stdClass, NULL given. ' );
197+ }, BadRequestException::class, 'Missing parameter $req required by MyPresenter::objects() ' );
192198
193199 Assert::exception (function () use ($ method ) {
194200 Reflection::combineArgs ($ method , ['req ' => $ method , 'opt ' => NULL ]);
0 commit comments