Commit Graph

24655 Commits

Author SHA1 Message Date
David Maicher
9d9d4efb88 [Doctrine Bridge] fix priority for doctrine event listeners 2017-03-14 21:52:39 +01:00
Fabien Potencier
dd8e50baa1 minor #21994 Use PHP functions as array_map callbacks when possible (javiereguiluz)
This PR was merged into the 2.7 branch.

Discussion
----------

Use PHP functions as array_map callbacks when possible

| 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        | -

We already do that in 99% of the cases ... but there were 3 occurrences where we didn't do it.

Commits
-------

405bd4cc81 Use PHP functions as array_map callbacks when possible
2017-03-14 12:43:03 -07:00
Fabien Potencier
26198cf60a bug #21981 [Console] Use proper line endings in BufferedOutput (julienfalque)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Use proper line endings in BufferedOutput

| 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        | -

`BufferOutput` should be consistent with `StreamOutput` when writing newlines.

I faced an issue using this class in tests where the expected output was platform dependent (using `PHP_EOL` too).

Commits
-------

33946e69c0 Use proper line endings
2017-03-14 11:38:54 -07:00
Javier Eguiluz
405bd4cc81 Use PHP functions as array_map callbacks when possible 2017-03-14 12:32:10 +01:00
Nicolas Grekas
71b2c3a52e minor #21993 [Validator] revert wrong Phpdoc change (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] revert wrong Phpdoc change

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/21115#discussion_r105842876
| License       | MIT
| Doc PR        |

Commits
-------

86e8afa [Validator] revert wrong Phpdoc change
2017-03-14 09:43:35 +01:00
Christian Flothmann
86e8afaea0 [Validator] revert wrong Phpdoc change 2017-03-14 09:04:19 +01:00
Nicolas Grekas
ac89b1c548 minor #21972 [FrameworkBundle] Fix cleaning of test dirs (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix cleaning of test dirs

| 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        | -

I spent an hour or two today debugging a non existent issue that was related to a non removed temporary file.
Let's cleanup properly now in the base WebTestCase.

Commits
-------

4842c86 [FrameworkBundle] Fix cleaning of test dirs
2017-03-14 08:31:41 +01:00
Nicolas Grekas
4842c86324 [FrameworkBundle] Fix cleaning of test dirs 2017-03-13 22:39:55 +01:00
Julien Falque
33946e69c0
Use proper line endings 2017-03-13 08:27:40 +01:00
Nicolas Grekas
6831b984e1 [VarDumper] ExceptionCaster robustness fix 2017-03-12 17:00:52 +01:00
Fabien Potencier
641092fa16 bug #21957 [Form] Choice type int values (BC Fix) (mcfedr)
This PR was squashed before being merged into the 2.7 branch (closes #21957).

Discussion
----------

[Form] Choice type int values (BC Fix)

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

#21267 unnecessarily forced all choice values to be strings, this was a BC braking change.

Everything can work fine if they are strings or ints. specifically the issue was because `array_flip` is used on the `choices` array, but this function will work fine with ints as well as strings.

Normally, when using HTML forms all data comes as strings, but the `symfony/form` component has use cases beyond this, specifically, I use it with JSON data, where valid values for a `ChoiceType` might not be strings.

Commits
-------

ed211e9c74 [Form] Choice type int values (BC Fix)
2017-03-10 11:10:40 -08:00
Fred Cox
ed211e9c74 [Form] Choice type int values (BC Fix) 2017-03-10 11:10:39 -08:00
Fabien Potencier
a0945fc182 bug #21923 [travis] Test with hhvm 3.18 (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[travis] Test with hhvm 3.18

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

Needs #21922 on master to be green also.
Works around  facebook/hhvm#7722.

Commits
-------

7f1f0cb630 [travis] Test with hhvm 3.18
2017-03-08 11:42:39 -08:00
Nicolas Grekas
68f810919c minor #21920 Rename StackOverflow to Stack Overflow (lex111)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21920).

Discussion
----------

Rename StackOverflow to Stack Overflow

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

Renamed StackOverflow to Stack Overflow in README.md.

Commits
-------

e3ac705 Rename StackOverflow to Stack Overflow
2017-03-08 11:34:04 +01:00
Alexey Pyltsyn
e3ac705b69 Rename StackOverflow to Stack Overflow 2017-03-08 11:34:04 +01:00
Nicolas Grekas
7f1f0cb630 [travis] Test with hhvm 3.18 2017-03-08 10:42:29 +01:00
Nicolas Grekas
bdebb713c4 minor #21915 [travis] Disable HHVM JIT - makes tests twice as fast (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[travis] Disable HHVM JIT - makes tests twice as fast

| 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
-------

0691639 [travis] Disable HHVM JIT - makes tests twice as fast
2017-03-07 22:14:40 +01:00
Nicolas Grekas
0691639063 [travis] Disable HHVM JIT - makes tests twice as fast 2017-03-07 22:12:28 +01:00
Fabien Potencier
f3217c3bd1 minor #21903 [Yaml] Fix the tests (GuilhemN)
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] Fix the 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        |

Fix tests that are currently useless (previously part of https://github.com/symfony/symfony/pull/19782).

Commits
-------

5107b94baf [Yaml] Fix the tests
2017-03-06 13:38:40 -08:00
Guilhem Niot
5107b94baf
[Yaml] Fix the tests 2017-03-06 21:37:41 +01:00
Fabien Potencier
44dc67dca8 minor #21898 [github] Add a reminder about CHANGELOG.md files (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[github] Add a reminder about CHANGELOG.md files

| 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        | -

Instead of calling for that each time, maybe this can help?

Commits
-------

cb452ee154 [github] Add a reminder about CHANGELOG.md files
2017-03-06 12:33:55 -08:00
Nicolas Grekas
cb452ee154 [github] Add a reminder about CHANGELOG.md files 2017-03-06 21:03:23 +01:00
Fabien Potencier
fda2472b02 minor #21902 [Filesystem] respect the umask argument in dumpFile() (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] respect the umask argument in dumpFile()

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

In #21823 we introduced a small BC break: The `dumpFile()` method of the `Filesystem` class allowed to pass the desired file permissions (support for this feature was dropped in Symfony 3.0).

Commits
-------

3a7cd08fe7 respect the umask argument in dumpFile()
2017-03-06 11:24:50 -08:00
Christian Flothmann
3a7cd08fe7 respect the umask argument in dumpFile() 2017-03-06 19:56:39 +01:00
Fabien Potencier
c91db73fbb bug #21823 dumpFile(), preserve existing file permissions (chs2)
This PR was squashed before being merged into the 2.7 branch (closes #21823).

Discussion
----------

dumpFile(), preserve existing file permissions

When calling Filesystem::dumpFile() on an already existing file, its permissions are lost.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

040a9abdbf dumpFile(), preserve existing file permissions
2017-03-06 10:29:47 -08:00
ChS
040a9abdbf dumpFile(), preserve existing file permissions 2017-03-06 10:29:45 -08:00
Fabien Potencier
3effed88e0 bug #21865 [Security] context listener: hardening user provider handling (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] context listener: hardening user provider handling

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

After the wrong fix in #21791 this is the second attempt to solve #4498. If more than one user provider support the user for the current context, all of them will be applied instead of returning prematurely when the first user provider does not find the logged in user.

Commits
-------

0fb09293fd context listener: hardening user provider handling
2017-03-06 08:15:02 -08:00
Fabien Potencier
ec134c7014 bug #21883 [HttpKernel] fix Kernel name when stored in a directory starting with a number (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] fix Kernel name when stored in a directory starting with a number

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

replaces #20750

Commits
-------

f244eb8414 [HttpKernel] fixed Kernel name when stored in a directory starting with a number
2017-03-06 07:51:41 -08:00
Nicolas Grekas
24f3135b11 minor #21886 [Form] Add validate method to mockec validator in form TypeTestCase (pierredup)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Add validate method to mockec validator in form TypeTestCase

| 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

When using the `Symfony\Component\Form\Tests\Extension\Validator\Type\TypeTestCase` class to unit test forms, the `validate` method is not mocked, which causes errors when the unit tests run.

Commits
-------

4013e7b Add validate method to mockec validator in form TypeTestCase
2017-03-06 10:17:24 +01:00
Pierre du Plessis
4013e7b998 Add validate method to mockec validator in form TypeTestCase 2017-03-06 09:20:15 +02:00
Fabien Potencier
7311ef36e9 bumped Symfony version to 2.7.26 2017-03-05 18:34:03 -08:00
Fabien Potencier
e22beacc93 Merge pull request #21884 from fabpot/release-2.7.25
released v2.7.25
2017-03-05 17:33:53 -08:00
Fabien Potencier
cb24ce3b52 updated VERSION for 2.7.25 2017-03-05 17:33:35 -08:00
Fabien Potencier
48c19f67e1 update CONTRIBUTORS for 2.7.25 2017-03-05 17:33:23 -08:00
Fabien Potencier
f90c78efe1 updated CHANGELOG for 2.7.25 2017-03-05 17:33:13 -08:00
Fabien Potencier
f244eb8414 [HttpKernel] fixed Kernel name when stored in a directory starting with a number 2017-03-05 14:37:48 -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
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
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
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
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