Commit Graph

29323 Commits

Author SHA1 Message Date
Fabien Potencier
b8b6774634 bug #21841 [Console] Do not squash input changes made from console.command event (chalasr)
This PR was merged into the 2.8 branch.

Discussion
----------

[Console] Do not squash input changes made from console.command event

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/19441
| License       | MIT
| Doc PR        | n/a

Setting arguments/options from the `console.command` event is expected to work since https://github.com/symfony/symfony/pull/15938

Commits
-------

c8d364b721 [Console] Do not squash input changes made from console.command event
2017-03-05 12:03:23 -08:00
Fabien Potencier
4d91022480 Merge branch '2.8' into 3.2
* 2.8:
  [Form] backport DependencyInjectionExtension tests
  [Form] Fixed typo in a test after #21877
2017-03-05 11:53:04 -08:00
Fabien Potencier
82790559de Merge branch '2.7' into 2.8
* 2.7:
  [Form] backport DependencyInjectionExtension tests
  [Form] Fixed typo in a test after #21877
2017-03-05 11:52:29 -08:00
Fabien Potencier
4816f65c04 minor #21882 [Form] Fixed typo in a test after #21877 (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed typo in a test after #21877

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Reviewing the diff on GitHub, I realized I've missed some typos in a new test of #21877. Sorry!

Commits
-------

b21a0978de [Form] Fixed typo in a test after #21877
2017-03-05 11:48:05 -08:00
Fabien Potencier
511e0c372a minor #21868 [Form] backport DependencyInjectionExtension tests (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] backport DependencyInjectionExtension tests

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

97361f1815 [Form] backport DependencyInjectionExtension tests
2017-03-05 11:42:52 -08:00
Christian Flothmann
97361f1815 [Form] backport DependencyInjectionExtension tests 2017-03-05 20:15:18 +01:00
HeahDude
b21a0978de [Form] Fixed typo in a test after #21877 2017-03-05 20:10:06 +01:00
Fabien Potencier
16263fb04d bug #21481 [Form] Fixed empty conversion of Intl types (HeahDude)
This PR was merged into the 3.2 branch.

Discussion
----------

[Form] Fixed empty conversion of Intl types

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20759, #21475
| License       | MIT
| Doc PR        | ~

Commits
-------

e43bfafbcc [Form] Fixed empty conversion of Intl types
2017-03-05 10:16:12 -08:00
HeahDude
e43bfafbcc [Form] Fixed empty conversion of Intl types 2017-03-05 18:47:40 +01:00
Fabien Potencier
77653d15ee Merge branch '2.8' into 3.2
* 2.8:
  [Serializer] Xml encoder throws exception for valid data
  [Form] Hardened form type tests
  fixed CS
2017-03-05 09:42:14 -08:00
Fabien Potencier
663661b30f Merge branch '2.7' into 2.8
* 2.7:
  [Serializer] Xml encoder throws exception for valid data
  [Form] Hardened form type tests
  fixed CS
2017-03-05 09:40:13 -08:00
Fabien Potencier
ea8025b863 minor #21877 [Form] Hardened form type tests (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Hardened form type tests

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

This one the PRs to come targeting 2.7 needed to harden the code base before doing some changes in master.

It takes care of the form types tests part (even if some other tests will be added later, it will also be easier after it), and unlocks merging https://github.com/symfony/symfony/pull/21481.
It also back ports tests added in https://github.com/symfony/symfony/pull/18357 for the TextType.

Since it's very hard to merge branches when modifying tests because of BC, and making every test type extend the base type test would involve many function calls to get the tested type, the function `getTestedType` is no longer abstract and return a constant to override instead, it's much better for performance, I didn't change the call in the base type test to keep BC but I suggest to deprecate it in master. Even if those are tests I really think it is worth keeping BC here.

The constants also ease testing in the ecosystem of form related libraries that need to be compatible with Symfony 2.7 and 3. I think using "test" as both prefix and suffix on namespaces, classes and names of the constants should discourage using them in real application code. Since this is just about our test suite, I don't think this should be considered a feature, so tis change should be good for 2.7.

Two other PRs will follow to solve conflicts in 2.8 and 3.2.

I missed last month patches, I hope I won't this time :).

Commits
-------

8cfc3e92ed [Form] Hardened form type tests
2017-03-05 09:34:46 -08:00
Fabien Potencier
69bb7582ad bug #21671 [Serializer] Xml encoder throws exception for valid data (gr1ev0us)
This PR was squashed before being merged into the 2.7 branch (closes #21671).

Discussion
----------

[Serializer] Xml encoder throws exception for valid data

| Q             | A
| ------------- | ---
| Branch?       |  2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21617
| License       | MIT
| Doc PR        | None

#21617  Xml encoder throws exception for valid data

- add tests for bool and object encoding
- fix encoding for object in array and field

Commits
-------

5c2d4c671e [Serializer] Xml encoder throws exception for valid data
2017-03-05 09:23:36 -08:00
gr1ev0us
5c2d4c671e [Serializer] Xml encoder throws exception for valid data 2017-03-05 09:23:23 -08:00
HeahDude
8cfc3e92ed [Form] Hardened form type tests 2017-03-05 17:53:01 +01:00
Fabien Potencier
125cf853c7 fixed CS 2017-03-05 08:45:00 -08:00
Fabien Potencier
28cf4ebdf2 minor #21876 Added setInputStream deprecation to UPGRADE guides (wouterj)
This PR was squashed before being merged into the 3.2 branch (closes #21876).

Discussion
----------

Added setInputStream deprecation to UPGRADE guides

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

The before/after examples of this deprecation is quite hard to figure out. Having them in the UPGRADE guides will significantly help the migration.

Commits
-------

6f53465648 Added setInputStream deprecation to UPGRADE guides
2017-03-05 08:44:07 -08:00
WouterJ
6f53465648 Added setInputStream deprecation to UPGRADE guides 2017-03-05 08:44:05 -08:00
Nicolas Grekas
d0ac91a815 minor #21874 [DI] Remove unused legacy arg in XmlFileLoaderTest (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[DI] Remove unused legacy arg in XmlFileLoaderTest

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

db4ab9d [DI] Remove unused legacy arg in XmlFileLoaderTest
2017-03-05 10:41:56 +01:00
Nicolas Grekas
db4ab9d0d6 [DI] Remove unused legacy arg in XmlFileLoaderTest 2017-03-05 01:06:55 +01:00
Fabien Potencier
fd94048285 fixed CS 2017-03-04 06:54:02 -08:00
Christian Flothmann
0fb09293fd context listener: hardening user provider handling 2017-03-04 13:36:23 +01:00
Nicolas Grekas
4ee9d563c5 Merge branch '2.8' into 3.2
* 2.8:
  [Security] fix Composer constraint
  Provide less state in getRequestFormat
  fix test class location
  Static code analysis with Php Inspections (EA Extended): dead code dropped, couple bugs fixed
2017-03-04 13:23:14 +01:00
Nicolas Grekas
6e9d1bbf32 Merge branch '2.7' into 2.8
* 2.7:
  [Security] fix Composer constraint
  Provide less state in getRequestFormat
  fix test class location
  Static code analysis with Php Inspections (EA Extended): dead code dropped, couple bugs fixed
2017-03-04 13:20:59 +01:00
Nicolas Grekas
d75ca7fa44 minor #21864 [Security] fix Composer constraint (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] fix Composer constraint

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

The `MAX_USERNAME_LENGTH` constant introduced by #18733 that is used in the `UsernamePasswordFormAuthenticationListener` was first part of Symfony 2.7.13 and 2.8.6.

Commits
-------

69a572d [Security] fix Composer constraint
2017-03-04 13:01:21 +01:00
Christian Flothmann
69a572dc5d [Security] fix Composer constraint 2017-03-04 12:40:30 +01:00
Robin Chalas
c8d364b721 [Console] Do not squash input changes made from console.command event 2017-03-04 12:00:12 +01:00
Nicolas Grekas
af40fd789c minor #21862 [Security] fix test class location (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] fix test class location

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Keeping the test file in the old location means that it is not available in the `symfony/security-http` subtree split.

Commits
-------

1ed0092 fix test class location
2017-03-04 11:57:10 +01:00
Nicolas Grekas
d45008d2d1 bug #21805 Provide less state in getRequestFormat (dawehner)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21805).

Discussion
----------

Provide less state in getRequestFormat

Let's assume you multiple lines of code calling to ```Request::getRequestFormat```providing different default values.

```
$request->getRequestFormat();
$request->getRequestFormat('json')
```

As of HEAD this causes the second call to return 'html', unless its set explicit via ```setRequestFormat()```.

IMHO this is state which can be avoided.

Note: This also helps Drupal.

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

1d43007 Provide less state in getRequestFormat
2017-03-04 11:53:39 +01:00
Daniel Wehner
1d43007f3c Provide less state in getRequestFormat 2017-03-04 11:53:31 +01:00
Christian Flothmann
1ed0092a62 fix test class location 2017-03-04 11:20:42 +01:00
Nicolas Grekas
5898ec2c5e minor #21855 SCA with Php Inspections (EA Extended) (kalessil)
This PR was merged into the 2.7 branch.

Discussion
----------

SCA with Php Inspections (EA Extended)

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

e1773ee Static code analysis with Php Inspections (EA Extended): dead code dropped, couple bugs fixed
2017-03-04 10:49:48 +01:00
Vladimir Reznichenko
e1773ee2b8 Static code analysis with Php Inspections (EA Extended): dead code dropped, couple bugs fixed 2017-03-03 17:35:37 +01:00
Fabien Potencier
2da12fc080 bug #21851 Adding use statement for InvalidArgumentException (Nyholm)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #21851).

Discussion
----------

Adding use statement for InvalidArgumentException

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This is a super minor bugfix. We should tell what InvalidArgumentException we throw. I consider this a bugfix and not a BC break because `Symfony\Component\Translation\Exception\InvalidArgumentException` has always been the intention.

Commits
-------

187f65bb33 Adding use statement for InvalidArgumentException
2017-03-03 07:24:16 -08:00
Tobias Nyholm
187f65bb33 Adding use statement for InvalidArgumentException 2017-03-03 07:24:16 -08:00
Fabien Potencier
86675f3faa Merge branch '2.8' into 3.2
* 2.8:
  fixed CS
2017-03-02 13:34:34 -08:00
Fabien Potencier
a19e3fe970 Merge branch '2.7' into 2.8
* 2.7:
  fixed CS
2017-03-02 13:33:27 -08:00
Fabien Potencier
cb12e323a5 minor #21814 fixed CS (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

fixed CS

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

ad0bb6ac53 fixed CS
2017-03-02 13:32:57 -08:00
Fabien Potencier
6aa87febf0 [Config] removed obsolete code 2017-03-02 07:58:09 -08:00
Fabien Potencier
e1558cc042 Merge branch '2.8' into 3.2
* 2.8:
  [Form] Improve rounding precision
  [Routing] Ignore hidden directories when loading routes from annotations
2017-03-02 07:57:24 -08:00
Fabien Potencier
db38c6f629 Merge branch '2.7' into 2.8
* 2.7:
  [Form] Improve rounding precision
  [Routing] Ignore hidden directories when loading routes from annotations
2017-03-02 07:56:34 -08:00
Fabien Potencier
c579b96cef bug #21832 [Routing] Ignore hidden directories when loading routes from annotations (jakzal)
This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] Ignore hidden directories when loading routes from annotations

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21497
| License       | MIT
| Doc PR        | -

The problem surfaced after implementing #18869. Therefore it doesn't exist on 2.7, but I'd still merge it there to avoid conflicts when merging between branches. Without this fix, the oldest branch the added test will fail is 3.2.

Commits
-------

ce9df0237c [Routing] Ignore hidden directories when loading routes from annotations
2017-03-02 07:54:09 -08:00
Fabien Potencier
058121819c bug #21769 [Form] Improve rounding precision (foaly-nr1)
This PR was squashed before being merged into the 2.7 branch (closes #21769).

Discussion
----------

[Form] Improve rounding precision

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 21734
| License       | MIT
| Doc PR        |

For full details see https://github.com/symfony/symfony/issues/21734 from https://github.com/symfony/symfony/issues/21734#issuecomment-282552802 onwards.

Excerpt:

```php
$number = floor(37.37*100); // double(3736)
var_dump($number);
$number = floor(bcmul(37.37, 100)); // double(3737)
var_dump($number);
```

From http://php.net/manual/en/language.types.float.php#language.types.float:

> Additionally, rational numbers that are exactly representable as floating point numbers in base 10, like 0.1 or 0.7, do not have an exact representation as floating point numbers in base 2, which is used internally, no matter the size of the mantissa. Hence, they cannot be converted into their internal binary counterparts without a small loss of precision. This can lead to confusing results: for example, floor((0.1+0.7)*10) will usually return 7 instead of the expected 8, since the internal representation will be something like 7.9999999999999991118....
>
> So never trust floating number results to the last digit, and do not compare floating point numbers directly for equality. If higher precision is necessary, the arbitrary precision math functions and gmp functions are available.

Commits
-------

e50804cef4 [Form] Improve rounding precision
2017-03-02 07:52:24 -08:00
foaly-nr1
e50804cef4 [Form] Improve rounding precision 2017-03-02 07:52:21 -08:00
Jakub Zalas
ce9df0237c
[Routing] Ignore hidden directories when loading routes from annotations 2017-03-02 14:51:26 +00:00
Fabien Potencier
b45e99f7cc Merge branch '2.8' into 3.2
* 2.8:
  disable global test listener when not registered
2017-03-01 17:46:11 -08:00
Fabien Potencier
cadc31330e bug #21825 [PhpUnitBridge] disable global test listener when not registered (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[PhpUnitBridge] disable global test listener when not registered

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

The global test listener is always initialized to register the clock
mock and DNS mock as soon as possible. However, when the listener is
registered locally through the PHPUnit config, it will never be
registered as a listener. In thise case, the state of the local
listener must be reset to correctly report expected deprecation test
results.

Commits
-------

e068661240 disable global test listener when not registered
2017-03-01 17:45:34 -08:00
Fabien Potencier
ad0bb6ac53 fixed CS 2017-03-01 11:43:24 -08:00
Christian Flothmann
e068661240 disable global test listener when not registered
The global test listener is always initialized to register the clock
mock and DNS mock as soon as possible. However, when the listener is
registered locally through the PHPUnit config, it will never be
registered as a listener. In thise case, the state of the local
listener must be reset to correctly report expected deprecation test
results.
2017-03-01 20:11:57 +01:00
Fabien Potencier
120f29344d fixed tests 2017-03-01 10:18:36 -08:00