public function testProcessForAlreadyResolvedRequirement()
 {
     $context = new NormalizeValueContext();
     $context->setRequirement('test');
     $this->processor->process($context);
     $this->assertEquals('test', $context->getRequirement());
 }
Example #2
0
 /**
  * Does a value normalization (conversion to a concrete data-type) if needed.
  *
  * @param NormalizeValueContext $context
  */
 protected function processNormalization(NormalizeValueContext $context)
 {
     $value = $context->getResult();
     if (null !== $value && $this->isValueNormalizationRequired($value)) {
         if ($context->isArrayAllowed() && !is_array($value)) {
             $context->setResult($this->normalizeArrayValue($value, $context->getArrayDelimiter()));
         } else {
             $this->validateValue($value);
             $context->setResult($this->normalizeValue($value));
         }
     }
 }