This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component
Fabien Potencier 165b08986b merged branch mrtorrent/use_parse_error_code_in_stubnumberformatter (PR #2521)
Commits
-------

89cd64a Set error code when number cannot be parsed. Fixes #2389

Discussion
----------

Set error code when number cannot be parsed in StubNumberFormatter

The stub implementation of NumberFormatter never sets an error code and instead always returns the "no-error" code. This causes unexpected results when a transformer gives it bad arguments, such as transforming the input value to boolean false and causing exceptions further down the line, as in #2389.

Instead, it should set an error code when appropriate and return it when requested so that a TransformationFailedException can be raised and the input value left unaltered.

There may be other instances where an error should be set. This covers the common use case of non-numeric input.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2389
2011-11-02 14:36:52 +01:00
..
BrowserKit [BrowserKit] Added additional unit tests for capital letters in cookies 2011-10-14 20:31:31 +01:00
ClassLoader [ClassLoader] Fixed state when trait_exists doesn't exists 2011-09-25 19:25:50 +02:00
Config removed unused use statements 2011-10-29 11:56:30 +02:00
Console removed unused use statements 2011-10-29 11:56:30 +02:00
CssSelector UnitTest 2011-06-29 18:22:32 +02:00
DependencyInjection removed unused use statements 2011-10-29 11:56:30 +02:00
DomCrawler [DomCrawler] Add test for ChoiceFormField without value 2011-09-20 18:30:35 +02:00
EventDispatcher [EventDispatcher] Fix removeSubscriber() to work with priority syntax 2011-08-23 16:41:08 -04:00
Finder [Finder] added a convenience method Finder::create() 2011-06-14 14:18:24 +02:00
Form merged branch mrtorrent/integer_transformer_cast_fix (PR #2520) 2011-11-02 14:36:23 +01:00
HttpFoundation fixed CS 2011-10-29 12:03:59 +02:00
HttpKernel removed unused use statements 2011-10-29 11:56:30 +02:00
Locale Set error code when number cannot be parsed. Fixes #2389 2011-10-30 22:02:16 +00:00
Process [Process] removed an incomplete test that cannot be fixed 2011-11-02 06:58:56 +01:00
Routing fixed CS 2011-10-29 12:03:59 +02:00
Security Fixed typo 2011-10-31 09:00:49 +01:00
Serializer removed unused use statements 2011-10-29 11:56:30 +02:00
Templating removed unused use statements 2011-10-29 11:56:30 +02:00
Translation [Translation] Loader should only load local files 2011-10-07 18:30:56 +02:00
Validator removed unused use statements 2011-10-29 11:56:30 +02:00
Yaml merged branch jmikola/yaml-numeric-strings (PR #1688) 2011-07-15 08:39:27 +02:00