public final function resolve(array &$routeValues)
{
$this->value = null;
if ($this->name === null || $this->name === '') {
return false;
}
$valueToResolve = $this->findValueToResolve($routeValues);
if (!$this->resolveValue($valueToResolve)) {
return false;
}
$routeValues = Arrays::unsetValueByPath($routeValues, $this->name);
return true;
}
/** * @test */ public function routePartValueIsNullAfterUnsuccessfulResolve() { $this->dynamicRoutPart->setName('foo'); $routeValues = ['foo' => 'bar']; $this->assertTrue($this->dynamicRoutPart->resolve($routeValues)); $routeValues = []; $this->assertFalse($this->dynamicRoutPart->resolve($routeValues)); $this->assertNull($this->dynamicRoutPart->getValue(), 'Dynamic Route Part value should be NULL when call to resolve() was not successful.'); }