merged branch beberlei/GH-4491 (PR #4493)

Commits
-------

4938080 MethodNotImplementedException -> MethodArgumentValueNotImplementedException
789fc14 Accept calling setLenient(false)

Discussion
----------

GH-4491 - Move patch from master to 2.0

A patch in PR-4469 fixed an issue with setLenient() and not having intl. This was only merged into master, although the original issue was created in the 2.0 branch. This PR cherry-picked the patches against 2.0 again.

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

by travisbot at 2012-06-06T15:29:19Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1527145) (merged 49380804 into 9a5e6c90).

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

by kbond at 2012-06-06T17:42:40Z

fixes #4491
This commit is contained in:
Fabien Potencier 2012-06-08 09:44:31 +02:00
commit 15b5aa4f7c
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

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