Commit Graph

9212 Commits

Author SHA1 Message Date
Rui Marinho
fad114b76a Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags 2012-04-07 16:28:29 +01:00
Kim Hemsø Rasmussen
f1236844a8 Removed leftover from c/p 2012-04-07 17:15:32 +02:00
Bernhard Schussek
e0ce6b4c11 [Form] Fixed required value guessed by ValidatorTypeGuesser 2012-04-07 16:26:16 +02:00
marc.weistroff
1d7e9d9753 Adds a linter command for templates 2012-04-07 13:26:03 +02:00
Fabien Potencier
13aa515d65 merged branch jakzal/FilesystemTests (PR #3811)
Commits
-------

100e97e [Filesystem] Fixed warnings in makePathRelative().
f5f5c21 [Filesystem] Fixed typos in the docblocks.
d4243a2 [Filesystem] Fixed a bug in remove being unable to remove symlinks to unexisting file or directory.
11a676d [Filesystem] Added unit tests for mirror method.
8c94069 [Filesystem] Added unit tests for isAbsolutePath method.
2ee4b88 [Filesystem] Added unit tests for makePathRelative method.
21860cb [Filesystem] Added unit tests for symlink method.
a041feb [Filesystem] Added unit tests for rename method.
8071859 [Filesystem] Added unit tests for chmod method.
bba0080 [Filesystem] Added unit tests for remove method.
8e861b7 [Filesystem] Introduced workspace directory to limit complexity of tests.
a91e200 [Filesystem] Added unit tests for touch method.
7e297db [Filesystem] Added unit tests for mkdir method.
6ac5486 [Filesystem] Added unit tests for copy method.
1c833e7 [Filesystem] Added missing docblock comment.

Discussion
----------

[Filesystem] Fixed a bug in remove() being unable to unlink broken symlinks

While working on test coverage for Filesystem class I discovered a bug in remove() method.

Before removing a file a check is made if it exists:

    if (!file_exists($file)) {
        continue;
    }

Problem is [file_exists()](http://php.net/file_exists) returns false if link's target file doesn't exist. Therefore remove() will fail to delete a directory containing a broken link. Solution is to handle links a bit different:

    if (!file_exists($file) && !is_link($file)) {
        continue;
    }

Additionally, this PR improves test coverage of Filesystem component.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

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

by cordoval at 2012-04-07T00:55:59Z

✌.|•͡˘‿•͡˘|.✌

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

by fabpot at 2012-04-07T06:12:34Z

Tests do not pass for me:

    PHPUnit 3.6.10 by Sebastian Bergmann.

    Configuration read from /Users/fabien/work/symfony/git/symfony/phpunit.xml.dist

    .........................EE.......

    Time: 0 seconds, Memory: 5.25Mb

    There were 2 errors:

    1) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #0 ('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component', '../')
    Uninitialized string offset: 29

    .../rc/Symfony/Component/Filesystem/Filesystem.php:183
    .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434

    2) Symfony\Component\Filesystem\Tests\FilesystemTest::testMakePathRelative with data set #1 ('var/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../')
    Uninitialized string offset: 16

    .../rc/Symfony/Component/Filesystem/Filesystem.php:183
    .../rc/Symfony/Component/Filesystem/Tests/FilesystemTest.php:434

    FAILURES!
    Tests: 34, Assertions: 67, Errors: 2.

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

by jakzal at 2012-04-07T07:26:15Z

Sorry for this. For some reason my PHP error reporting level was to low to catch this...

Should be fixed now but I needed to modify the makePathRelative() (this bug existed before).
2012-04-07 10:18:55 +02:00
Fabien Potencier
e7dbc38941 merged branch eriksencosta/pt_BR-translations (PR #3817)
Commits
-------

bf51a58 [FrameworkBundle] fixed pt_BR translations (added commas to take a breath :)
dc94e27 [FrameworkBundle] synced pt_BR translations

Discussion
----------

synced and fixed pt_BR translations
2012-04-07 10:18:49 +02:00
Eriksen Costa
bf51a58f37 [FrameworkBundle] fixed pt_BR translations (added commas to take a breath :) 2012-04-07 04:30:12 -03:00
Eriksen Costa
dc94e27dbb [FrameworkBundle] synced pt_BR translations 2012-04-07 04:29:23 -03:00
Jakub Zalas
100e97ebe7 [Filesystem] Fixed warnings in makePathRelative(). 2012-04-07 08:23:20 +01:00
Fabien Potencier
72e854e943 fixed CS 2012-04-07 09:10:50 +02:00
Fabien Potencier
0a585b7130 merged branch eriksencosta/cs-fixes (PR #3816)
Commits
-------

abd59c3 Merge branch 'master' into cs-fixes
f5f0506 [TwigBundle] fixed CS

Discussion
----------

CS fixes
2012-04-07 09:04:09 +02:00
Eriksen Costa
abd59c3dbd Merge branch 'master' into cs-fixes 2012-04-07 03:53:28 -03:00
Fabien Potencier
d967d39d27 merged branch chmielot/3446-empty-multiple-entity-choice (PR #3734)
Commits
-------

a430f3d [#3446] [Form] Fix getChoicesForValues of EntityChoiceList on empty values

Discussion
----------

[Form] Fix reverseTransform on multiple entity form type

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3446, #3727
Todo: -

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

by stof at 2012-04-03T23:05:55Z

@bschussek ping

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

by stof at 2012-04-03T23:06:45Z

This is an alternate implementation for #3727

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

by chmielot at 2012-04-04T13:47:27Z

OK, this is another possibility to fix this issue with working tests. What do you think about this?

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

by chmielot at 2012-04-04T13:51:27Z

OK, just done.

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

by stof at 2012-04-04T13:51:39Z

@beberlei @bschussek ping

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

by bschussek at 2012-04-06T18:50:37Z

@fabpot 👍
2012-04-07 08:22:05 +02:00
Fabien Potencier
526fb7bf05 merged branch bschussek/issue3738 (PR #3807)
Commits
-------

6584721 [Form] Improved labels generated by default from form names
6e0b03a [Form] Fixed label of prototype in CollectionType
fc342d1 Merge remote branch 'umpirsky/collection-name' into issue3738
f91660d Added test for prototype label.

Discussion
----------

[Form] Fixed default label generated for the CollectionType prototype

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3738, #3739
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3738)

(the fact that the build fails seems to origin from the broken master)
2012-04-07 08:15:43 +02:00
Fabien Potencier
048f8dabba merged branch eriksencosta/patch-1 (PR #3813)
Commits
-------

46c7ae1 added composer.lock to .gitignore

Discussion
----------

added composer.lock to .gitignore
2012-04-07 08:09:20 +02:00
Fabien Potencier
1c10b0b455 merged branch eriksencosta/readme-fixes (PR #3814)
Commits
-------

f3efea3 [Propel1Bridge][TwigBridge] fixed export instructions in the README files

Discussion
----------

[Propel1Bridge][TwigBridge] fixed export instructions in the README files
2012-04-07 08:09:06 +02:00
Fabien Potencier
987e69ee56 merged branch jmikola/di-yaml-loader-test (PR #3808)
Commits
-------

1c3e4ac [DependencyInjection] Fix Yaml file loader test

Discussion
----------

[DependencyInjection] Fix Yaml file loader test

This broke when 2.0 was recently merged into master with b9daae2847, as the Yaml fixture change from 24a0d0a2dc was not included.

https://twitter.com/webmozart/status/188325579894947840
2012-04-07 08:09:01 +02:00
Eriksen Costa
f5f0506b1b [TwigBundle] fixed CS 2012-04-07 01:24:57 -03:00
Eriksen Costa
f3efea3a6e [Propel1Bridge][TwigBridge] fixed export instructions in the README files 2012-04-06 23:24:52 -03:00
Eriksen Costa
46c7ae1ed4 added composer.lock to .gitignore 2012-04-06 22:15:14 -03:00
Jakub Zalas
f5f5c21228 [Filesystem] Fixed typos in the docblocks. 2012-04-07 00:05:37 +01:00
Jakub Zalas
d4243a28b6 [Filesystem] Fixed a bug in remove being unable to remove symlinks to unexisting file or directory. 2012-04-07 00:01:32 +01:00
Jakub Zalas
11a676d672 [Filesystem] Added unit tests for mirror method. 2012-04-06 23:56:57 +01:00
Jakub Zalas
8c940699c1 [Filesystem] Added unit tests for isAbsolutePath method. 2012-04-06 23:16:46 +01:00
Jakub Zalas
2ee4b8861c [Filesystem] Added unit tests for makePathRelative method. 2012-04-06 23:05:31 +01:00
Jakub Zalas
21860cbb5d [Filesystem] Added unit tests for symlink method. 2012-04-06 22:25:57 +01:00
Kim Hemsø Rasmussen
b74a5d4f14 Updated to new cache loader pattern. 2012-04-06 22:35:56 +02:00
Jakub Zalas
a041feb4b3 [Filesystem] Added unit tests for rename method. 2012-04-06 21:21:21 +01:00
Jakub Zalas
8071859915 [Filesystem] Added unit tests for chmod method. 2012-04-06 21:17:12 +01:00
Jakub Zalas
bba0080560 [Filesystem] Added unit tests for remove method. 2012-04-06 20:38:21 +01:00
Jakub Zalas
8e861b746a [Filesystem] Introduced workspace directory to limit complexity of tests. 2012-04-06 19:59:25 +01:00
Kim Hemsø Rasmussen
7e66908c02 Added XCache class loader 2012-04-06 20:32:52 +02:00
Jeremy Mikola
1c3e4ac694 [DependencyInjection] Fix Yaml file loader test
This broke when 2.0 was recently merged into master with b9daae2847, as the Yaml fixture change from 24a0d0a2dc was not included.
2012-04-06 14:29:48 -04:00
Jakub Zalas
a91e200db7 [Filesystem] Added unit tests for touch method. 2012-04-06 19:22:22 +01:00
Jakub Zalas
7e297dbead [Filesystem] Added unit tests for mkdir method. 2012-04-06 19:10:23 +01:00
Bernhard Schussek
658472193d [Form] Improved labels generated by default from form names 2012-04-06 19:50:06 +02:00
Bernhard Schussek
6e0b03a6e2 [Form] Fixed label of prototype in CollectionType 2012-04-06 19:45:42 +02:00
Bernhard Schussek
fc342d1a5b Merge remote branch 'umpirsky/collection-name' into issue3738 2012-04-06 19:34:40 +02:00
Fabien Potencier
38e17c2e87 merged branch Seldaek/termwidth (PR #3805)
Commits
-------

7ce22f0 [Console] Add docblocks
8a2b115 [Console] Mock terminal size to prevent formatting errors on small terminals

Discussion
----------

[Console] Fixes terminal width in tests

This fixes the [tests that broke on travis-ci](http://travis-ci.org/#!/symfony/symfony/jobs/1031109) (which seems to advertise a terminal width of ~34, not sure why).
2012-04-06 19:14:31 +02:00
Jakub Zalas
6ac5486672 [Filesystem] Added unit tests for copy method. 2012-04-06 17:48:54 +01:00
Jakub Zalas
1c833e7d78 [Filesystem] Added missing docblock comment. 2012-04-06 17:48:01 +01:00
Jordi Boggiano
7ce22f0cef [Console] Add docblocks 2012-04-06 18:25:51 +02:00
Jordi Boggiano
8a2b115824 [Console] Mock terminal size to prevent formatting errors on small terminals 2012-04-06 18:24:40 +02:00
Fabien Potencier
20a9961711 merged branch jjbohn/feature/property-path-hasser (PR #3549)
Commits
-------

b6ac1aa [FORM] Give PropertyPath ability to read hassers

Discussion
----------

[Form] Give PropertyPath ability to read hassers

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

Using a `hasser` instead of `isser` for Boolean values is pretty common. I've found myself using `issers` a handful of times just to make an interface play nice with the form component, but the code reads funny now. I don't think we should be accounting for every possible `getter` variation, but I think this one is common enough that it warrants a discussion.

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

by fabpot at 2012-03-11T08:25:31Z

I tend to agree with with. What do you think @bschussek?

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

by kriswallsmith at 2012-03-16T22:42:28Z

I'm not so sure. There are lots of reasons to write a *hasser* that accepts an argument (i.e. `User::hasRole($role)`). Doesn't seem as clean as *issers* and *getters*.

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

by vicb at 2012-03-16T22:49:14Z

> There are lots of reasons to write a hasser that accepts an argument

May be can check for 0 args as we are already using reflexion ?

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

by kriswallsmith at 2012-03-16T22:55:43Z

In that case we should check that there are either 0 arguments or only optional arguments and also consider adding the same logic to the other varieties.

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

by jjbohn at 2012-03-16T23:37:47Z

Passing arguments seems like a pretty big departure for PropertyPath. How would you annotate that? I'm not sure I see a common use case for needing arguments when mapping data to and from forms.

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

by stof at 2012-03-16T23:50:22Z

@jjbohn it is not about passing arguments but about using the hasser only if it does not have required arguments

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

by jjbohn at 2012-03-17T01:54:18Z

Ah. I see. I have a tendency to read @kriswallsmith comments wrong :D. I could see that but iirc, there's not any current check like this on the other accessors. Happy to add it though if there's a consensus.

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

by fabpot at 2012-03-17T11:24:34Z

What's the point is checking the hasser/getter/isser arguments. It's up to the developer to check if he can use them or not. Let's not complexify the code for this.

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

by kriswallsmith at 2012-03-17T15:37:39Z

My concern is that someone writes a hasser method on their model that is not intended for use with the form component but it's called anyway, leading to WTFs.

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

by stof at 2012-04-03T22:28:21Z

@fabpot what's your decision about this ?

@jjbohn you need to rebase your PR. It conflicts with master as tests have been moved

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

by bschussek at 2012-04-05T14:53:55Z

@kriswallsmith is right. The check for 1 === $method->getNumberOfRequiredParameters() can (and should) easily be added to all of the if-clauses here.

Apart from that, I'm okay with adding this.
2012-04-06 15:09:38 +02:00
Fabien Potencier
85535de74b moved a fixture file 2012-04-06 14:27:17 +02:00
Fabien Potencier
245a7b7eec merged branch ruimarinho/icu-48-fix (PR #3748)
Commits
-------

8689e9c [WIP] [Locale] Fixes NumberFormatter tests failing when using ICU 4.8 or 4.8.1

Discussion
----------

[WIP] [Locale] Fixes NumberFormatter tests failing when using ICU 4.8 or 4.8.1.1

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: no
Todo: fix DateFormatter

The ICU CLDR 2.0 data has been updated on ICU 4.8 and the same data set is used on version 4.8.1.1. The problem is related to [this commit](http://bugs.icu-project.org/trac/changeset?reponame=&new=31307%40icu%2Ftrunk%2Fsource%2Fdata%2Fcurr%2Fen.txt&old=31074%40icu%2Ftrunk%2Fsource%2Fdata%2Fcurr%2Fen.txt) which has since been updated with new data and subsequently shipped with version 49.

The `DateFormatter` tests are still failing - see this [gist](https://gist.github.com/2004d40e5167286028ea). Suggestions are welcomed on how to handle this part.

Test results with PHP 5.4.0 with ICU 4.8.1.1 on OSX:

````
FAILURES!
Tests: 5917, Assertions: 12749, Failures: 26, Incomplete: 11, Skipped: 47.
```

with this WIP patch:

```
FAILURES!
Tests: 5917, Assertions: 12749, Failures: 13, Incomplete: 11, Skipped: 47.
```
2012-04-06 14:24:19 +02:00
Fabien Potencier
1387415ec3 merged branch hhamon/route_collection_better_exception_message (PR #3801)
Commits
-------

04ae7cc [Routing] fixed exception message.
f7647f9 [Routing] improved exception message when giving an invalid route name.

Discussion
----------

Route collection better exception message

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-04-06 14:22:10 +02:00
Fabien Potencier
b9daae2847 merged 2.0 2012-04-06 14:21:18 +02:00
Fabien Potencier
f2398f61a6 merged branch Seldaek/console_ex_20 (PR #3802)
Commits
-------

595cc11 [Console] Wrap exception messages to the terminal width to avoid ugly output
97f7b29 [Console] Avoid outputing \r's in exception messages

Discussion
----------

[Console] Exception rendering fixes

This fixes two things:

- `\r`'s in exception messages were output (in case of `\r\n` newlines), creating really weird results on windows.
- long exception messages were wrapping and then the "red" block was completely messed up, with half black/half red lines, now it's wrapped before output if the terminal width can be detected.

If you don't care about merging this for 2.0, you can also merge the `console_ex` branch which applies on master. Due to moving tests and renaming of some normalize stuff in the tests, the two test patches are kind of different.

RFC: I am really not sure where to put those getTerminalWidth/Height methods. I guess this is not the best place.
2012-04-06 14:15:48 +02:00
Fabien Potencier
c140386957 merged branch ruimarinho/http_digest (PR #3781)
Commits
-------

fc41d4f [Security] [HttpDigest] Fixes a configuration error caused by an invalid 'key' child node configuration

Discussion
----------

[Security] [HttpDigest] Fixes a configuration error caused by an invalid "key" child node configuration

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build status](https://secure.travis-ci.org/ruimarinho/symfony.png?branch=http_digest)
2012-04-06 14:14:53 +02:00