/**
  * @param FormInterface $component
  * @param array $whitelist
  * @param array $blacklist
  * @return array
  */
 protected function appendToWhiteAndBlacklistFromComponent(FormInterface $component, array $whitelist, array $blacklist)
 {
     $allowed = $component->getVariable('allowedContentTypes');
     if (NULL !== $allowed) {
         $whitelist = array_merge($whitelist, GeneralUtility::trimExplode(',', $allowed));
     }
     $denied = $component->getVariable('deniedContentTypes');
     if (NULL !== $denied) {
         $blacklist = array_merge($blacklist, GeneralUtility::trimExplode(',', $denied));
     }
     return array($whitelist, $blacklist);
 }
Exemple #2
0
 /**
  * @param Form\FormInterface $instance
  * @return array
  */
 protected function performTestBuild(FormInterface $instance)
 {
     $configuration = $instance->build();
     $this->assertIsArray($configuration);
     return $configuration;
 }
 /**
  * @param Form\FormInterface $field
  * @param array $values
  * @return array
  */
 protected function unsetInheritedValues(Form\FormInterface $field, $values)
 {
     $name = $field->getName();
     $inherit = (bool) $field->getInherit();
     $inheritEmpty = (bool) $field->getInheritEmpty();
     $empty = true === empty($values[$name]) && $values[$name] !== '0' && $values[$name] !== 0;
     if (false === $inherit || true === $inheritEmpty && true === $empty) {
         unset($values[$name]);
     }
     return $values;
 }