merged branch frosas/patch-1 (PR #4469)

Commits
-------

d55f7ed MethodNotImplementedException -> MethodArgumentValueNotImplementedException
cea6489 Accept calling setLenient(false)

Discussion
----------

Avoid IntlDateFormatter::setLenient(false) to throw an exception

Right now it is breaking because the changes introduced here:

f541844c78

---------------------------------------------------------------------------

by travisbot at 2012-05-31T01:35:44Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1483621) (merged cea6489d into 49e213ce).
This commit is contained in:
Fabien Potencier 2012-05-31 07:33:01 +02:00
commit 78747e6cc5
2 changed files with 5 additions and 3 deletions

View File

@ -416,11 +416,13 @@ class StubIntlDateFormatter
*
* @see http://www.php.net/manual/en/intldateformatter.setlenient.php
*
* @throws MethodNotImplementedException
* @throws MethodArgumentValueNotImplementedException When $lenient is true
*/
public function setLenient($lenient)
{
throw new MethodNotImplementedException(__METHOD__);
if ($lenient) {
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'lenient', $lenient, 'Only the strict parser is supported');
}
}
/**

View File

@ -906,7 +906,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase
}
/**
* @expectedException Symfony\Component\Locale\Exception\MethodNotImplementedException
* @expectedException Symfony\Component\Locale\Exception\MethodArgumentValueNotImplementedException
*/
public function testSetLenient()
{