|
|
@@ -101,6 +101,21 @@ class IcuFormatterTest extends TestCase
|
|
|
*/
|
|
|
public function testBadMessageFormat()
|
|
|
{
|
|
|
+ $this->skipIf(version_compare(PHP_VERSION, '7', '>='), 'Skiped for PHP 7 as MessageFormatter throws a different exception');
|
|
|
+ $formatter = new IcuFormatter();
|
|
|
+ $formatter->format('en_US', '{crazy format', ['some', 'vars']);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Tests that passing a message in the wrong format will throw an exception
|
|
|
+ *
|
|
|
+ * @expectedException Exception
|
|
|
+ * @expectedExceptionMessage Constructor failed
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testBadMessageFormatPHP7()
|
|
|
+ {
|
|
|
+ $this->skipIf(version_compare(PHP_VERSION, '7', '<'), 'Skiped for PHP 5.x as MessageFormatter throws a different exception');
|
|
|
$formatter = new IcuFormatter();
|
|
|
$formatter->format('en_US', '{crazy format', ['some', 'vars']);
|
|
|
}
|