public function testSetDefaultValueNotScalar() { $this->setExpectedException('InvalidArgumentException'); $argument = new Argument(); $argument->setDefaultValue(array()); }
/** * Creates, adds and returns a new controller argument to this composite object. * If an argument with the same name exists already, it will be replaced by the * new argument object. * * @param string $name Name of the argument * @param string $dataType Name of one of the built-in data types * @param boolean $isRequired TRUE if this argument should be marked as required * @param mixed $defaultValue Default value of the argument. Only makes sense if $isRequired==FALSE * @return \TYPO3\Flow\Mvc\Controller\Argument The new argument * @api */ public function addNewArgument($name, $dataType = 'string', $isRequired = true, $defaultValue = null) { $argument = new Argument($name, $dataType); $argument->setRequired($isRequired); $argument->setDefaultValue($defaultValue); $this->addArgument($argument); return $argument; }