public function testThrowsExceptionWhenFieldIsUnknown()
    {
        $expectedExceptionMessage = <<<MESSAGE
Unable to find proper separator for 'foo' 'bar' (tried foo:bar and foo.bar. Perhaps the definition is missing?
MESSAGE;
        $this->setExpectedException('RuntimeException', $expectedExceptionMessage);
        $config = new ConfigProxy(array("metadatafields" => array('saml20_idp' => array())));
        $helper = new MetadataDefinitionHelper($config);
        $helper->joinKeyParts('foo', 'bar', 'saml20-idp');
    }
Пример #2
0
 /**
  * Turns a flat collection into a nested one.
  *
  * @param array $flatCollection
  * @param MetadataDefinitionHelper $metadataDefinitionHelper
  * @return array
  */
 public function build(array $flatCollection, MetadataDefinitionHelper $metadataDefinitionHelper, $connectionType)
 {
     $flatCollection = $metadataDefinitionHelper->castData($flatCollection, $connectionType);
     $arrayPathHelper = new ArrayPathHelper();
     foreach ($flatCollection as $key => $value) {
         $arrayPathHelper->set($key, $value);
     }
     $items = $arrayPathHelper->getArray();
     return $items;
 }