/** * Should throw an excption if trying to convert a multiline text field * * @expectedException Exception */ public function testBadSettingsConversion() { // Cannot convert a multiline text field into a single line TextCellConverter::convertSettings(array('multiline' => 'y')); }
/** * Given decoded Matrix column settings, converts those settings to be * compatible to the specified native EE fieldtype * * @param string Target fieldtype's name, e.g. 'text', 'relationship' * @param settings Decoded settings for the Matrix column * @return string EE-equivalent fieldtype settings for specified fieldtype */ public static function mapColumnSettings($to_cell_type, $settings) { switch ($to_cell_type) { case 'date': // Matrix has no date field settings, we only have one return array('localize' => TRUE); break; case 'checkboxes': case 'radio': case 'select': case 'multi_select': return OptionsCellConverter::convertSettings($settings); break; case 'relationship': return PlayaConverter::convertSettings($settings); break; case 'file': return FileCellConverter::convertSettings($settings); break; case 'textarea': return TextareaCellConverter::convertSettings($settings); break; case 'rte': // Existing settings should be good except we have one thing to add return array_merge(array('field_text_direction' => 'ltr'), $settings); break; case 'text': return TextCellConverter::convertSettings($settings); default: return $settings; break; } return array(); }