protected function _doConvertPlugin_reference_multiline_callback($matches) { $whole_match = $matches[0]; $ref_id = $matches[2]; $body = isset($matches['body']) ? $matches['body'] : ''; # lower-case and turn embedded newlines into spaces $ref_id = strtolower($ref_id); $ref_id = preg_replace('{[ ]?\\n}', ' ', $ref_id); if (isset($this->plugins[$ref_id])) { $plugin = $this->plugins[$ref_id]; $params = $plugin['params']; if ($plugin['isFlow']) { $params = YamlParams::adjustAsFlow($params); } return $this->_doConvertPlugin($plugin['id'], $params, $body, '', $whole_match); } return $this->hashPart($whole_match); }
/** * @dataProvider textProvider */ public function testText($text, $expected) { $yaml = YamlParams::adjustAsFlow($text); $result = Yaml::parse($yaml); $this->assertEquals($expected, $result); }