diff --git a/src/Application/UI/Presenter.php b/src/Application/UI/Presenter.php index 65fc59148..d85a9e980 100644 --- a/src/Application/UI/Presenter.php +++ b/src/Application/UI/Presenter.php @@ -1029,7 +1029,7 @@ public static function argsToParams($class, $method, & $args, $supplemental = [] } if (!isset($args[$name])) { - if ($param->isDefaultValueAvailable() || $type === 'NULL' || $type === 'array' || $isClass) { + if ($param->isDefaultValueAvailable() || $type === 'NULL' || $type === 'array') { continue; } throw new InvalidLinkException("Missing parameter \$$name required by $class::{$rm->getName()}()"); diff --git a/tests/UI/Presenter.link().php7.phpt b/tests/UI/Presenter.link().php7.phpt index 027c386f2..2aa8ffdf8 100644 --- a/tests/UI/Presenter.link().php7.phpt +++ b/tests/UI/Presenter.link().php7.phpt @@ -187,8 +187,8 @@ class TestPresenter extends Application\UI\Presenter Assert::same('#error: Argument $arr passed to TestPresenter::actionDefaults() must be array, string given.', $this->link('defaults', ['int' => '1', 'bool' => '1', 'str' => '', 'arr' => ''])); Assert::same('/index.php?action=objects&presenter=Test', $this->link('objects', ['req' => new stdClass, 'opt' => new stdClass])); - Assert::same('/index.php?action=objects&presenter=Test', $this->link('objects', [])); - Assert::same('/index.php?action=objects&presenter=Test', $this->link('objects', ['req' => NULL, 'opt' => NULL])); + Assert::same('#error: Missing parameter $req required by TestPresenter::actionObjects()', $this->link('objects', [])); + Assert::same('#error: Missing parameter $req required by TestPresenter::actionObjects()', $this->link('objects', ['req' => NULL, 'opt' => NULL])); Assert::same('#error: Argument $req passed to TestPresenter::actionObjects() must be stdClass, Exception given.', $this->link('objects', ['req' => new Exception, 'opt' => NULL])); Assert::same('#error: Argument $req passed to TestPresenter::actionObjects() must be stdClass, array given.', $this->link('objects', ['req' => []])); diff --git a/tests/UI/Presenter.link().phpt b/tests/UI/Presenter.link().phpt index 74179212d..17753c4d6 100644 --- a/tests/UI/Presenter.link().phpt +++ b/tests/UI/Presenter.link().phpt @@ -155,8 +155,8 @@ class TestPresenter extends Application\UI\Presenter Assert::same('#error: Argument $arr passed to TestPresenter::actionDefaults() must be array, string given.', $this->link('defaults', ['int' => '1', 'bool' => '1', 'str' => '', 'arr' => ''])); Assert::same('/index.php?action=objects&presenter=Test', $this->link('objects', ['req' => new stdClass, 'opt' => new stdClass])); - Assert::same('/index.php?action=objects&presenter=Test', $this->link('objects', [])); - Assert::same('/index.php?action=objects&presenter=Test', $this->link('objects', ['req' => NULL, 'opt' => NULL])); + Assert::same('#error: Missing parameter $req required by TestPresenter::actionObjects()', $this->link('objects', [])); + Assert::same('#error: Missing parameter $req required by TestPresenter::actionObjects()', $this->link('objects', ['req' => NULL, 'opt' => NULL])); Assert::same('#error: Argument $req passed to TestPresenter::actionObjects() must be stdClass, Exception given.', $this->link('objects', ['req' => new Exception, 'opt' => NULL])); Assert::same('#error: Argument $req passed to TestPresenter::actionObjects() must be stdClass, array given.', $this->link('objects', ['req' => []]));