Skip to content

Commit

Permalink
catch MessageFormatter specific exception message test for PHP7
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Jun 8, 2015
1 parent 9243543 commit 295ce50
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/TestCase/I18n/Formatter/IcuFormatterTest.php
Expand Up @@ -101,6 +101,21 @@ public function testNativePluralSelection()
*/
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']);
}
Expand Down

0 comments on commit 295ce50

Please sign in to comment.