/**
  * Appends an item to the given collection
  *
  * @return string
  * @throws Exception
  */
 public function evaluate()
 {
     $context = $this->getContext();
     $stateNameToRender = $this->getState();
     $context['controllerContext'] = $this->getTsRuntime()->getControllerContext();
     if (!isset($this->stateInSettings[$stateNameToRender])) {
         throw new Exception('The state "PackageFactory.Guevara.state.' . $stateNameToRender . '" was not found in the settings.', 1458814468);
     }
     return $this->stateRenderingService->computeState($this->stateInSettings[$stateNameToRender], $context);
 }
 /**
  * @test
  */
 public function recursionWorks()
 {
     $actual = $this->stateRenderingService->computeState(['key' => ['nested' => '${dynamic}']], ['dynamic' => 'foo']);
     $expected = ['key' => ['nested' => 'foo']];
     $this->assertSame($expected, $actual);
 }