public function testGetCallbackToAddDataTypeToSnaksGroupedByProperty() { $instance = new CallbackFactory(); $dataTypeLookup = $this->getPropertyDataTypeLookup(); $callback = $instance->getCallbackToAddDataTypeToSnaksGroupedByProperty($dataTypeLookup); $this->assertInternalType('callable', $callback); $array = array('P1' => array(array())); $array = $callback($array); $this->assertSame(array('P1' => array(array('datatype' => 'propertyDataType'))), $array); }
/** * @param array $array * @param string $path * * @TODO FIXME duplicated / similar code in Repo ResultBuilder * * @return array */ private function getArrayWithDataTypesInGroupedSnakListAtPath(array $array, $path) { return $this->modifier->modifyUsingCallback($array, $path, $this->callbackFactory->getCallbackToAddDataTypeToSnaksGroupedByProperty($this->dataTypeLookup)); }