Returns the value of the specified argument
public getArgument ( string $argumentName ) : string | ||
$argumentName | string | Name of the argument |
return | string | Value of the argument |
/** * Maps arguments delivered by the request object to the local controller arguments. * * @return void * @throws RequiredArgumentMissingException * @api */ protected function mapRequestArgumentsToControllerArguments() { foreach ($this->arguments as $argument) { $argumentName = $argument->getName(); if ($this->request->hasArgument($argumentName)) { $argument->setValue($this->request->getArgument($argumentName)); } elseif ($argument->isRequired()) { throw new RequiredArgumentMissingException('Required argument "' . $argumentName . '" is not set.', 1298012500); } } }
/** * @test */ public function aSingleArgumentCanBeSetWithSetArgumentAndRetrievedWithGetArgument() { $this->actionRequest->setArgument('someArgumentName', 'theValue'); $this->assertEquals('theValue', $this->actionRequest->getArgument('someArgumentName')); }