function testUnknownType() { try { MessageFormat::get("{0,wopple}", array("111111111")); $this->fail("Since dev mode is on, an unknown formatter should throw an error."); } catch (Exception $e) { //noop } }
/** * Get value for for a given key and arguments. This uses message * formatting to substitute arguments or parse simple expressions. * * @param string $key Key to use for message lookup. * @param mixed $arguments Arguments to use for expression evaluation and * substitution. * @param boolean $strict Whether to throw an error when key not found. * * @return string Processed message. */ public function get($key, $arguments = array(), $strict = FALSE) { // convenience, if one arg passed in, need not be array if (is_scalar($arguments)) { $arguments = array($arguments); } $entry = $this->getSimple($key, $strict); if (count($arguments) > 0) { return MessageFormat::get($entry, $arguments, $this->locale); } return $entry; }