Commit Graph

2187 Commits

Author SHA1 Message Date
stealth35
3759ff0777 [Locale] StubNumberFormatter allow to parse 64bit number in 64bit mode 2011-12-11 17:45:39 +01:00
lsmith77
b1ca0cdfe9 added several tests to the serializer (mainly for deserialization) 2011-12-11 12:09:53 +01:00
Fabien Potencier
c22652f5d7 merged branch aboks/doctrine_data_collector (PR #2733)
Commits
-------

bb0d202 Switched sanitizeParameter() for existing varToString()-method; now always stores a string representation of each parameter
4fe4dfd Fixed vendor version mismatch in tests
28730e9 [DoctrineBridge] Added unit tests
4535abe [DoctrineBridge] Fixed attempt to serialize non-serializable values

Discussion
----------

[DoctrineBridge] Fixed attempt to serialize non-serializable values

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

The Doctrine DBAL type system does not pose any restrictions on the php-types of parameters in queries. Hence one could write a doctrine-type that uses a resource or an `\SplFileInfo` as its corresponding php-type. Parameters of these types are logged in the `DoctrineDataCollector` however, which is then serialized in the profiler. Since resources or `\SplFileInfo` variables cannot be serialized this throws an exception.

This PR fixes this problem (for known cases) by sanitizing the query parameters to only contain serializable types. The `isNotSerializable`-check surely is not complete yet, but more non-serializable classes can be added on a case-by-case basis.

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

by fabpot at 2011/12/07 07:04:43 -0800

Tests do not pass for me.

Furthermore, let's reuse what we already have in the framework (see https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/HttpKernel.php#L187 -- yes you can just copy/paster the existing code).

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

by aboks at 2011/12/09 01:41:14 -0800

@fabpot I fixed the tests (seems I had the wrong vendor versions in my copy) and reused the `varToString()`-code. This introduces a tiny BC break in the rare case that someone writes his own templates for the web profiler (the parameters returned by the data collector are now always a string; could be any type before).

After merging this PR, merging 2.0 into master would give a merge conflict and failing tests (because of the changes related to the introduction of the `ManagerRegistry` interface). To prevent this, please merge #2820 into master directly after merging this PR (so before merging 2.0 into master). After that 2.0 can be cleanly merged into master.

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

by stof at 2011/12/09 03:43:38 -0800

it is not a BC break. Using ``yaml_encode`` on a string will not break the template
2011-12-09 16:12:04 +01:00
Joseph Bielawski
5f2226807c [Profiler] Sync with master 2011-12-09 11:51:29 +01:00
Arnout Boks
bb0d202250 Switched sanitizeParameter() for existing varToString()-method; now always stores a string representation of each parameter 2011-12-08 18:14:27 +01:00
Arnout Boks
4fe4dfd116 Fixed vendor version mismatch in tests 2011-12-08 18:09:06 +01:00
Kris Wallsmith
41872cd40e [Security] added SecurityContextInterface::getUser()
This changes helps the common use case of fetching the current user and better complies with the Law of Demeter (http://en.wikipedia.org/wiki/Law_of_Demeter).

Before (still works):

    $token = $context->getToken();
    $user = $token ? $token->getUser() : null;

After:

    $user = $context->getUser();
2011-12-08 08:53:01 -08:00
Christophe Coevoet
2c3e9adcd1 [DependencyInjection] Made the reference case insensitive
The container is case insensitive so using capital letters in a reference
made it fail in some cases when checking the dependencies.
Closes #2807
2011-12-08 16:30:50 +01:00
Oscar Cubo Medina
600066eda4 [Templating] fixed 'scheme://' not detected as absolute path 2011-12-08 15:42:21 +01:00
Oscar Cubo Medina
b50ac5be36 [Config] fixed 'scheme://' not detected as absolute path
This also allows the use of configuration files stored in phar files.
2011-12-08 15:42:21 +01:00
Fabien Potencier
4730f4303b merged 2.0 2011-12-08 15:36:57 +01:00
Fabien Potencier
2cb6260d07 changed the default XLIFF extension to .xlf instead of .xliff (this is BC and .xliff files are still valid) 2011-12-07 22:39:27 +01:00
Fabien Potencier
237c36a167 [HttpKernel] fixed tests that can sporadically fail 2011-12-07 21:39:45 +01:00
Fabien Potencier
43a6aa9db2 merged branch Seldaek/cookiefix (PR #2698)
Commits
-------

e06cea9 [HttpFoundation] Cookie values should not be restricted

Discussion
----------

[HttpFoundation] Cookie values should not be restricted

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

The restriction I removed makes no sense IMO because we do not use setrawcookie() to send cookies. setrawcookie() does throw a warning when the cookie value contains incorrect characters, but not setcookie(). The latter will just urlencode() the value so it becomes valid. This is also what is done by `Cookie::__toString`, so this could be used in combination with header() to just send raw cookies that are valid, even with values that are invalid in their decoded form.

PHP urldecodes cookies on input, so it all works fine.
2011-12-07 16:37:58 +01:00
Fabien Potencier
1c4bfb4c0d [Validator] added some unit tests for previous merge 2011-12-07 16:27:15 +01:00
vagrant
2a61714df6 [HttpKernel] added PostResponseEvent dispatching to HttpKernel 2011-12-06 11:18:45 -08:00
vagrant
915f440cad [HttpKernel] removed BC breaks, introduced new TerminableInterface 2011-12-06 10:41:41 -08:00
Jordi Boggiano
7efe4bcb87 [HttpKernel] Add Kernel::terminate() and HttpKernel::terminate() for post-response logic 2011-12-06 11:09:36 +01:00
Fabien Potencier
7e2ca4ad93 merged branch jmikola/master-DependencyInjectionExceptions (PR #2786)
Commits
-------

da0773c Note DependencyInjection exception changes in the 2.1 changelog
9a090bc [DependencyInjection] Fix class check and failure message in PhpDumper test
2334596 [DependencyInjection] Use component's SPL classes in dumped service container
3c02ea2 [DependencyInjection] Use exception class for API doc generation
47256ea [DependencyInjection] Make exceptions consistent when ContainerBuilder is frozen
b7300d2 [DependencyInjection] Fix up @throws documentation
123f514 [DependencyInjection] Use component-specific SPL exceptions
cf2ca9b [DependencyInjection] Create additional SPL exceptions
ba8322e [DependencyInjection] Format base exception classes consistently

Discussion
----------

[DependencyInjection] Refactor usage of SPL exceptions

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

This was something discussed on the mailing list recently and a topic at the last IRC meeting. The DependencyInjection component was what I had in mind while discussing this with @lsmith a few weeks ago, as I found that it already had some local SPL exceptions, which weren't being used directly (only as base classes for the compiler exceptions). This PR replaces uses of core SPL exceptions with the component's equivalents. I've listed it as BC-breaking to be safe, but I don't think it should cause any trouble, since the new exceptions are sub-classes of those originally used.

I purposely avoided changing the exceptions in the dumped PHP container. If we agree that's worth doing, it would be a trivial addition to the PR.

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

by jmikola at 2011/12/04 22:38:47 -0800

One question I came across while implementing this PR: the doc blocks in ContainerInterface reference InvalidArgumentException (actually the component's local SPL equivalent), but there is no practical need for that class to be used in the file. How will the API doc generator handle this? Do we need to change the doc block reference to the full class path?

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

by fabpot at 2011/12/05 01:20:31 -0800

Why have you not replaced the exception in the dumped container code? I don't see any drawback.

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

by stof at 2011/12/05 03:39:25 -0800

it would even be better to be consistent in the generated code

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

by jmikola at 2011/12/05 09:48:05 -0800

I'll update the exceptions in the dumped container code as well. Thanks for the feedback.

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

by jmikola at 2011/12/05 10:41:21 -0800

Ok, this should be ready to review and merge. Tests needed some updating, but they still pass.
2011-12-06 09:42:14 +01:00
Jeremy Mikola
9a090bc37d [DependencyInjection] Fix class check and failure message in PhpDumper test 2011-12-05 10:05:21 -08:00
Jeremy Mikola
2334596d2b [DependencyInjection] Use component's SPL classes in dumped service container 2011-12-05 10:04:50 -08:00
Fabien Potencier
839dd2aaa4 merged branch drak/patch-1 (PR #2784)
Commits
-------

541888d [EventDispatcher] Added missing object destruction in test tearDown() and removed duplicated tests.

Discussion
----------

[EventDispatcher] Merge two test cases into one.

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

Ref 667c24d73d (commitcomment-766966)

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

by stof at 2011/12/04 19:43:32 -0800

``testGetName`` could also be removed as it is already tested by ``getSetName``, and same for the event dispatcher.

Basically, you cannot test the setter without testing the associated getter so no need for 2 tests for them as it is forced to be duplicate for part of them (and no need to use so long names IMO)

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

by drak at 2011/12/05 00:49:22 -0800

I've refactored the test to remove duplication, I pushed as a rebase so the new commit is 541888d referencing the same discussion.
2011-12-05 10:22:47 +01:00
Fabien Potencier
30262878f0 merged branch jmikola/2.0-LoaderResolverInterface (PR #2785)
Commits
-------

7c1cbb9 [Config] Use LoaderResolverInterface for type-hinting
48b084e fixed typo
8ad94fb merged branch hhamon/doctrine_bridge_cs (PR #2775)
240796e [Bridge] [Doctrine] fixed coding conventions.
7cfc392 check for session before trying to authentication details
648fae7 merged branch proofek/domcrawlerform-radiodisabled (PR #2768)
3976b7a [DoctrineBridge] fixed CS
9a04783 merged branch beberlei/SecurityEntityRepositoryIdentifierFix (PR #2765)
3c83b89 [DoctrineBridge] Catch user-error when the identifier is not serialized with the User entity.
36c7d03 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

Discussion
----------

[Config] Use LoaderResolverInterface for type-hinting

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

I've listed this as a BC break because we're changing the argument type-hint, but I think it's unlikely to affect anyone.
2011-12-05 10:21:19 +01:00
Drak
541888d0a5 [EventDispatcher] Added missing object destruction in test tearDown() and removed duplicated tests. 2011-12-05 14:32:28 +05:45
Fabien Potencier
648fae7746 merged branch proofek/domcrawlerform-radiodisabled (PR #2768)
Commits
-------

36c7d03 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

Discussion
----------

Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

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

I wasn't really sure about the correct approach. This one is very minimalistic and following the existing concept of not duplicating nodes of the same name, but only storing multiple values for the same node. If you think that should be changed, let me know. Hints appreciated.

Thanks
2011-12-02 13:26:19 +01:00
Benjamin Eberlei
3c83b89c5e [DoctrineBridge] Catch user-error when the identifier is not serialized with the User entity. 2011-12-01 20:17:08 +01:00
Fabien Potencier
8a4f9ea512 merged 2.0 2011-12-01 15:45:30 +01:00
Fabien Potencier
d6f01df790 merged branch excelwebzone/dev (PR #2706)
Commits
-------

8710a13  Added example to the change log file
c9a2b49  Fixed xml encoder test script, and group `item` tags into an array
a0561e5  Replaced `item` with `*item` when parsing XML string

Discussion
----------

Replaced `item` with `*item` when parsing XML string

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

by fabpot at 2011/11/23 22:14:12 -0800

Tests do not pass:

1) Symfony\Tests\Component\Serializer\Encoder\XmlEncoderTest::testDecode
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
         'key2' => 'val'
-        'A B' => 'bar'
         'Barry' => Array (...)
+        'item' => Array (...)
     )
     'qux' => '1'
 )

.../tests/Symfony/Tests/Component/Serializer/Encoder/XmlEncoderTest.php:173

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

by fabpot at 2011/11/24 22:57:37 -0800

I don't understand the patch anymore. I don't see any use of `*item` in the code.

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

by excelwebzone at 2011/11/24 23:04:07 -0800

I run some testing and you can't use '*item' XML parser reject it. So I modified it to convert it to an array.. Look at the test script change

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

by fabpot at 2011/11/24 23:13:30 -0800

So, you probably need to change the CHANGELOG as well? You should add an example which shows a before/after example.

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

by excelwebzone at 2011/11/24 23:15:51 -0800

Yes, forgot to change that..

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

by fabpot at 2011/11/25 01:27:42 -0800

ping @Seldaek, @lsmith77

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

by Seldaek at 2011/11/25 04:16:43 -0800

There are other meta-names available in the XmlEncoder, @-something for attributes, then there is something happening with a # but I'm not quite sure what. I'm just saying, maybe *item isn't the best name, if it introduces a third metacharacter. Apart from that I'm fine with it.

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

by excelwebzone at 2011/11/25 08:45:31 -0800

Maybe we can rename it to `wildcard` instead

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

by excelwebzone at 2011/11/25 15:12:09 -0800

Any chance we can push this throw?

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

by lsmith77 at 2011/11/27 04:06:25 -0800

here is the old PR #2682
@Seldaek: i think your comment was made for an older version of the patch.

overall I am fine with the change, the Serializer component takes a fairly simple approach. it is also not designed to really produce XML or JSON cleanly from the same data. it will really only be able to output a clean API for one or the other with the same data structure.

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

by excelwebzone at 2011/12/01 06:25:24 -0800

@fabpot can we merge this change
2011-12-01 15:44:03 +01:00
Fabien Potencier
654352f8d1 merged branch pscheit/master (PR #2742)
Commits
-------

63e2a99 [CssSelector] Fixed Issue for XPathExprOr: missing prefix in string conversion

Discussion
----------

[CssSelector] Issue for XPathExprOr: missing prefix in string conversion

Hi there,

I created a small and dumb test for the issue. I looked at the original implementation and i think the problem is, that private properties are used in the parent class for xPathExprOr. so that the prefix cannot be accessd with $this->prefix in XPathExprOr
However I think the distribution for the prefix should be put in the parts of the or-sub-expressions the way it is shown in the test.

Hope this helps.

Best regards
Philipp
2011-12-01 08:46:19 +01:00
Fabien Potencier
416b70d5b2 merged branch conf/test-fixes-for-ci.qa.php.net-2.0 (PR #2750)
Commits
-------

c1a798e Another style fix.
eba9de1 Code style fix.
0b1abb3 1. Separated testing diacritic letters with additional check for mbstring in Symfony\Tests\Component\Console\Helper\FormatterHelperTest.php. 2. Added check if French locale was correctly set, skip the test otherwise in  Symfony\Tests\Component\Yaml\InlineTest.php. 3. Inverted check for Windows platform since testing finding php with suffixes has meaning only in Windows in Symfony\Tests\Component\Process\PhpExecutableFinderTest.php.

Discussion
----------

Test fixes for ci.qa.php.net 2.0

This is remake of https://github.com/symfony/symfony/pull/2749 against 2.0 as requested by stof. Code style fix also applied.

Original message below:
My name is Shein Alexey and I'm writing on behalf of php-qa team. As you probably know we've set up build server for testing major php versions (5.3, 5.4 and trunk for now) on the url http://ci.qa.php.net. There's also an initiative also check these versions against major php projects with good test coverage like symfony.
In our symfony builds some tests constantly fail (see http://ci.qa.php.net/view/php-userland/job/php-symfony2/420/testReport/ for example) so here are the fixes I come up with:

Separated testing diacritic letters with additional check for mbstring in Symfony\Tests\Component\Console\Helper\FormatterHelperT
Added check if French locale was correctly set, skip the test otherwise in Symfony\Tests\Component\Yaml\InlineTest.php.
Inverted check for Windows platform since testing finding php with suffixes has meaning only in Windows in Symfony\Tests\Component\Process\PhpExecutableFinderTest.php.
There is also erratic test Symfony\Tests\Component\HttpKernel\HttpCache\HttpCacheTest:testFetchesFullResponseWhenCacheStaleAndNoValidatorsPresent which randomly fails when Age header is non-zero, I'm not sure what to do here, maybe this check should be deleted since page can have age greater than zero.

Let me know what you think.
Thank you.
2011-12-01 08:33:56 +01:00
Dariusz Górecki
769c17bb95 Throw exceptions in case someone forgot to set method name in call.
Bug fix: yes
Feature add: no
Symfony2 tests pass: yes
Symfony2 tests added: yes

In general without this exception generated by php dumper container class, will cause PHP fatal error, bacause method call will look like this: `$instance->(/* arguments*/);`.
2011-11-30 15:59:17 +01:00
Shein Alexey
c1a798e2d7 Another style fix. 2011-11-30 02:46:26 +05:00
Shein Alexey
eba9de1593 Code style fix. 2011-11-30 02:22:43 +05:00
Shein Alexey
0b1abb3a57 1. Separated testing diacritic letters with additional check for mbstring in Symfony\Tests\Component\Console\Helper\FormatterHelperTest.php.
2. Added check if French locale was correctly set, skip the test otherwise in  Symfony\Tests\Component\Yaml\InlineTest.php.
3. Inverted check for Windows platform since testing finding php with suffixes has meaning only in Windows in Symfony\Tests\Component\Process\PhpExecutableFinderTest.php.
2011-11-30 02:22:13 +05:00
pscheit
63e2a993eb [CssSelector] Fixed Issue for XPathExprOr: missing prefix in string conversion 2011-11-28 22:00:26 +01:00
Fabien Potencier
1f9cf94a1d merged branch ericclemmons/2545-expanded-grouped-choices (PR #2731)
Commits
-------

7a8e1b3 ChoiceType flattens nested Choices when expanded
82b0b37 Added ChoiceType test for flattening grouped Choices when expanded

Discussion
----------

Fixed #2545 - ChoiceType flattens grouped Choices when expanded

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

**Problem**: With PR #2464, a bug was discovered when nested choices threw a exception during rendering.

**Solution**: Nested choices are flattened prior to creating checkbox/radio fields.
2011-11-27 14:43:50 +01:00
Arnout Boks
28730e9149 [DoctrineBridge] Added unit tests 2011-11-27 13:43:02 +01:00
Arnout Boks
a4e0697f39 [HttpKernel] Fixed failing Stopwatch tests due to usleep() accuracy on Windows 2011-11-27 13:18:15 +01:00
Eric Clemmons
82b0b3715c Added ChoiceType test for flattening grouped Choices when expanded 2011-11-26 17:37:07 -08:00
Sebastian Marek
36c7d03040 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements 2011-11-26 14:07:00 +00:00
excelwebzone
c9a2b49eb7 Fixed xml encoder test script, and group item tags into an array 2011-11-24 09:09:38 -08:00
Fabien Potencier
7b1dda84b9 [HttpKernel] added unit tests for previous merge 2011-11-24 08:39:49 +01:00
Fabien Potencier
2b5d4b90d8 merged 2.0 2011-11-24 07:16:52 +01:00
Fabien Potencier
5878490b16 removed unused use statements 2011-11-24 07:16:14 +01:00
Jordi Boggiano
e06cea9aaa [HttpFoundation] Cookie values should not be restricted 2011-11-23 11:38:46 +01:00
Fabien Potencier
a1d12324f9 merged 2.0 2011-11-23 11:23:27 +01:00
Fabien Potencier
286ce0ea40 merged branch pulzarraider/proxy_ip_fix (PR #2695)
Commits
-------

11b6156 updated unittest
a931e21 get correct client IP from X-forwarded-for header

Discussion
----------

[HttpFoundation] Get correct client IP when using trusted proxy (Varnish)

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
Note: This is reopened PR #2686 for 2.0 branch.

If using trusted proxy (Varnish, ...) the client IP must be identified from X-Forwarded-For header. The header has de-facto standard format:

X-Forwarded-For : client1, proxy1, proxy2,

where the value is a comma+space separated list of IP addresses, the left-most being the farthest downstream client, and each successive proxy that passed the request adding the IP address where it received the request from. See: http://en.wikipedia.org/wiki/X-Forwarded-For

Function getClientIp should return only one client IP, not a list of all nonimportant IPs as it's now. Similar example can be seen in Cake framework: http://api.cakephp.org/view_source/request-handler-component/#line-477

There are many ways how to chose the first IP from X-Forwarded-For header. Any other faster and more reliable way is welcome.
2011-11-23 11:22:06 +01:00
Andrej Hudec
11b6156530 updated unittest 2011-11-22 22:28:38 +01:00
hlecorche
38f64a1bd9 [Form] added some unit tests 2011-11-22 10:31:25 +01:00
Fabien Potencier
a8fd2c4b46 merged 2.0 2011-11-22 10:13:00 +01:00
Drak
667c24d73d [EventDispatcher] Add name property to Events refs #2572
Should be merged/cherry-picked after #2572 closes.
2011-11-22 09:49:57 +01:00
Fabien Potencier
bd5eda38fa merged branch Seldaek/eventdisp (PR #2572)
Commits
-------

fabe818 [EventDispatcher] Add reference to the EventDispatcher on the Event

Discussion
----------

[EventDispatcher] Add reference to the EventDispatcher on the Event

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

I don't like registering event listeners unless they are really used, it seems wasteful. So I tend to register listeners for the response event in other listeners, only when they will be required. @stof has [brought to my attention](fb243ace83 (commitcomment-696467)) that this may cause issues in Silex or any other situation where event listeners are not lazy loaded, since it creates a circular reference in that case.

With this PR, avoiding the circular reference is possible, without bloating the response listener with unnecessary "do I need to do anything?" code.

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

by schmittjoh at 2011/11/06 05:28:39 -0800

Did you do any benchmarks? It's just a feeling, but registering a listener at runtime might be more expensive than just having it always executed.

Also, I find these dynamic listeners a bit of a code smell. They are not easily testable, and the control flow is harder to track. Besides, you do not take into account subrequests which might happen in between.

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

by Seldaek at 2011/11/06 09:34:27 -0800

I don't see why it would be slower, if it's a commonly fired event yes you blast away the `sorted` listener cache every time you add one, but most of the time those optional listeners are for the response, which is typically not sorted yet when you add the listener, so I don't think there is any overhead.

As for the code smell, of course it's a matter of preference, but I have the opposite view on control flow, I find it weird that listeners are registered when they are not used in the end, while doing it my way I think it's more clear what happens.

For sub-requests, I'm not sure what you mean. In this instance, and in most response listeners I have seen, the sub-requests are always ignored anyway by the listener.

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

by drak at 2011/11/10 06:07:45 -0800

I don't see how loading up the dispatcher with a bunch of callables can be expensive - it's just loading an array basically.

Wouldn't it be better to have a separate `DispatcherAwareEvent extends Event`

    class DispatcherAwareEvent extends Event
    {
        protected $dispatcher;

        public function setDispatcher(EventDispatcher $dispatcher)
        {
            $this->dispatcher = $dispatcher;
        }

        public function getDispatcher()
        {
            return $this->dispatcher;
        }

This can then be used as a base class for what you need `MyEvent extends DispatcherAwareEvent`

       $event = new MyEvent($dispatcher, $foo);
       $dispatcher->dispatch($event);

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

by Seldaek at 2011/11/10 06:18:57 -0800

@drak: Every event is part the event dispatching system and therefore should be aware of the dispatcher imo. It's not like the ContainerAwareInterface which is gluing things that do not especially have to know about the DIC together.

If we do that, then we have to start arguing every time we need the dispatcher in a given event, because the original author did not think it was necessary, and then that will only make it into the next minor version, etc. Not fun at all.

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

by drak at 2011/11/10 06:36:26 -0800

By the way, the event dispatchers looks to be pretty well optimized given the fact that it only sorts listeners if they are called, and then only once.

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

by drak at 2011/11/10 12:33:28 -0800

It just seems weird.  I mean, following on, why isn't the event name a compulsory parameter also? - again, you can say both ways, if you need it, make it part of your custom Event class, or since it's a required param to be able to dispatch an event in the first place, make it part of the base Event class.  All I'm saying it it seems suspicious when it could be achieved a different way.

For example, you could inject the dispatcher into the listener itself and then the event handler could access the dispatcher if it needs:

    class MyListener
    {
        public function __construct(EventDispatcher $eventDispatcher)
        {
            //...
        }

        public function someListener(Event $event)
        {
            //...
        }
    }

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

by stof at 2011/11/10 15:20:07 -0800

@drak The issue when injecting the dispatcher in the listener is described in the issue: circular dependency: you need to create the dispatcher before the listener (as it is injected in it) and when the listener is not lazy-loaded (in Silex for instance), you need to create it before the dispatcher.

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

by drak at 2011/11/10 21:15:45 -0800

Indeed, although it might not unreasonable to expect to create the dispatcher first...  but anyway I'm convinced!

Injecting the dispatcher could lead to some __very interesting possibilities__ as standard.  While we are at it though, we should have a getter and setter for `$name` in the `Event` class and `$event->setName($eventname)` in the `dispatch()` method.  Allowing an event to know it's name is very useful.  It allows a single listener to be registered for multiple names, and even makes the event object reusable. I don't know why $name was removed, it was in the Symfony 1 dispatcher and while the new dispatcher is brilliant from an OO point of view, missing the name as standard is a big shame.

+1 from me.
2011-11-22 09:32:53 +01:00
Fabien Potencier
c98c2ef5fb merged the two Locale listener hooks (this hack was needed when the Firewall was registered before the Routing; this is not needed anymore) 2011-11-17 14:22:57 +01:00
Fabien Potencier
e886d733fb merged the two Router listener hooks (this hack was needed when the Firewall was registered between those two hooks; this is not needed anymore) 2011-11-17 14:22:57 +01:00
Dariusz Górecki
264a033728 Fixed uncompatible closure declaraction in FileldTypeValidatorExtensionTest
This is just for keeping things clear, this Closure declaration was errorneous
and may trick users that 2 parameters are given to callable.
2011-11-17 10:03:46 +01:00
Fabien Potencier
bd708247f0 merged 2.0 2011-11-17 07:00:22 +01:00
Kris Wallsmith
79ae3fced9 [Form] fixed radio and checkbox when data is not bool 2011-11-16 13:39:36 -08:00
Christophe Coevoet
58c227681e Skipped tests when PDO is not available 2011-11-14 18:39:47 +01:00
Fabien Potencier
1340ea67a6 Merge branch '2.0'
* 2.0:
  [HttpKernel] fixed Content-Length header when using ESI tags (closes #2623)
  [HttpFoundation] added an exception to MimeTypeGuesser::guess() when no guesser are available (closes #2636)
  [Security] fixed HttpUtils::checkRequestPath() to not catch all exceptions (closes #2637)
  [DoctrineBundle] added missing default parameters, needed to setup and use DBAL without ORM
  [Transation] Fix grammar.
  [TwigBundle] Fix trace to not show 'in at line' when file/line are empty.
2011-11-14 14:32:22 +01:00
Fabien Potencier
f7c5bf1db2 [HttpKernel] fixed Content-Length header when using ESI tags (closes #2623) 2011-11-14 13:46:20 +01:00
Fabien Potencier
0462a89562 [Security] fixed HttpUtils::checkRequestPath() to not catch all exceptions (closes #2637) 2011-11-14 13:10:32 +01:00
Fabien Potencier
21cec043d7 Merge branch '2.0'
* 2.0:
  [Form] fixed previous merge
  [Form] simplified previous merge
  Also identify FirePHP by the X-FirePHP-Version header
  [TwigBundle] Extract output buffer cleaning to method
  [TwigBundle] Do not clean output buffering below initial level
  Fixed rendering of FileType (value is not a valid attribute for input[type=file])
  Added tests for string fix in DateTimeToArrayTransformer (8351a11286).
  Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609
  [Translation] removed unneeded methods
  [Translation] added detection for circular references when adding a fallback catalogue
  [DomCrawler] trim URI in getURI
  [Yaml][Tests] Fixed missing locale string for Windows platforms which caused test to fail
2011-11-11 22:52:07 +01:00
Fabien Potencier
7f32043f19 merged branch jalliot/file_widget (PR #2608)
Commits
-------

e83e00a Fixed rendering of FileType (value is not a valid attribute for input[type=file])

Discussion
----------

Fixed rendering of FileType

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

According to the W3C validator, `value` is not a valid attribute for `input[type=file]`.

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

by fabpot at 2011/11/10 23:01:24 -0800

Instead of creating yet another block, what about modifying the `field_widget` to not render the `value` attribute if the value is empty? Also, the PHP template must be fixed too.

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

by jalliot at 2011/11/11 02:02:52 -0800

@fabpot Changed ;)
2011-11-11 22:01:59 +01:00
Fabien Potencier
7475a3924c merged branch ondrowan/2.0 (PR #2614)
Commits
-------

2582fcb Added tests for string fix in DateTimeToArrayTransformer (8351a11286).
8351a11 Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609

Discussion
----------

Fix for #2609

Second take for fix for #2609, hope it's ok now. Tests are failing without my fix and passing with it.
2011-11-11 21:48:12 +01:00
Jordan Alliot
e83e00a7b8 Fixed rendering of FileType (value is not a valid attribute for input[type=file]) 2011-11-11 11:01:38 +01:00
ondrowan
2582fcb1e1 Added tests for string fix in DateTimeToArrayTransformer (8351a11286). 2011-11-11 10:00:41 +01:00
Fabien Potencier
45b218e7c4 [Translation] added detection for circular references when adding a fallback catalogue 2011-11-11 08:29:16 +01:00
Fabien Potencier
632a99fd7c merged branch stealth35/fix_2599 (PR #2601)
Commits
-------

a245e15 [DomCrawler] trim URI in getURI

Discussion
----------

[DomCrawler] trim URI in getURI

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2599
2011-11-11 08:09:10 +01:00
stealth35
a245e15434 [DomCrawler] trim URI in getURI 2011-11-10 15:38:28 +01:00
Arnout Boks
e7acb23636 [Yaml][Tests] Fixed missing locale string for Windows platforms which caused test to fail 2011-11-10 12:50:53 +01:00
stealth35
56cb7a515b [Translation] add gettext PO and MO Dumper 2011-11-10 00:24:31 +01:00
Fabien Potencier
8ca8aef151 merged branch stof/gettext_loader (PR #2412)
Commits
-------

d974a4a Merge pull request #4 from stealth35/test_mo_loader
cf05646 delete useless tests
19f9de9 [Translation] fix gettext tests
965f2bf Merge pull request #3 from stealth35/test_mo_loader
9c2a26d [Translation] add Mo loader tests
9af2342 [Translation] Added the gettext loaders

Discussion
----------

[Translation] Added the gettext loaders

This is the squashed version of the work done by @xaav in #634.

@stealth35 you said you will work on the dumpers. do you have some stuff on it ?

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

by drak at 2011/10/24 19:28:43 -0700

Is there any more progress with this?

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

by stealth35 at 2011/10/25 00:57:19 -0700

I work on the dumpers, but the Po loader is wrong, caus' the Po ressource can be multiline,

     msgid ""
     "Here is an example of how one might continue a very long string\n"
     "for the common case the string represents multi-line output.\n"

http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files

Anyway the Po format is an intermediate format to Mo file, (like .txt to .res file for ICU), IMO we can just support the real gettext format : Mo

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

by stealth35 at 2011/11/03 02:00:24 -0700

@stof The MO Dumper is ready (stealth35/symfony@f2d1d5b4de), should we keep the PO format ?

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

by fabpot at 2011/11/07 08:50:59 -0800

@stealth35: The PO is what people will use for their translations. They will then dump it to MO. So, we need both PO and MO loaders and dumpers.

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

by stealth35 at 2011/11/08 01:25:39 -0800

@fabpot, I'm ready for both dumpers, you can merge this, and I'll open a PR for the dumpers

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

by fabpot at 2011/11/08 22:37:47 -0800

I've just had a look at this PR code again and I see that the unit tests are pretty slim. Is it possible to add some tests for the mo loader?

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

by stealth35 at 2011/11/09 01:15:25 -0800

@fabpot test send to @stof ✌️

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

by stof at 2011/11/09 02:22:55 -0800

and merged in this branch

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

by fabpot at 2011/11/09 02:39:09 -0800

The tests do not pass for me:

    There was 1 error:

    1) Symfony\Tests\Component\Translation\Loader\MoFileLoaderTest::testLoadDoesNothingIfEmpty
    InvalidArgumentException: MO stream content has an invalid format.

    /Users/fabien/work/symfony/git/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php:79
    /Users/fabien/work/symfony/git/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php:46
    /Users/fabien/work/symfony/git/symfony/tests/Symfony/Tests/Component/Translation/Loader/MoFileLoaderTest.php:34

    --

    There was 1 failure:

    1) Symfony\Tests\Component\Translation\Loader\PoFileLoaderTest::testLoad
    Failed asserting that two arrays are equal.
    --- Expected
    +++ Actual
    @@ @@
     Array (
    -    'foo' => 'bar'
     )

    /Users/fabien/work/symfony/git/symfony/tests/Symfony/Tests/Component/Translation/Loader/PoFileLoaderTest.php:25
2011-11-09 22:00:02 +01:00
stealth35
cf05646cc7 delete useless tests 2011-11-09 12:11:16 +01:00
stealth35
19f9de9e8f [Translation] fix gettext tests 2011-11-09 12:08:40 +01:00
stealth35
9c2a26db12 [Translation] add Mo loader tests 2011-11-09 10:13:06 +01:00
Fabien Potencier
4f3e7bb698 merged branch canni/enable_validation_groups_callback (PR #2498)
Commits
-------

d08ec5e Add DelegatingValidator tests
e1822e7 Enable dynamic set of validation groups by a callback or Closure

Discussion
----------

[Form][Validator] Enable dynamic set of validation groups based on callback

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Symfony2 tests written for new feature: yes
closes tickets: #2498 #1151

This will allow developer to pass a Closure or a callback array as a Validation groups option of a form. Eg:

```
class ClientType extends AbstarctType
{
// ...
    public function getDefaultOptions(array $options)
    {
        return array(
            'validation_groups' => function(FormInterface $form){
                // return array of validation groups based on submitted user data (data is after transform)
                $data = $form->getData();
                if($data->getType() == Entity\Client::TYPE_PERSON)
                    return array('Default', 'person');
                else
                    return array('Default', 'company');
            },
        );
    }
// ...
}
```

```
class ClientType extends AbstarctType
{
// ...
    public function getDefaultOptions(array $options)
    {
        return array(
            'validation_groups' => array(
                'Acme\\AcmeBundle\\Entity\\Client',
                'determineValidationGroups'
            ),
        );
    }
// ...
}
```

This will make developers life easier !

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

by schmittjoh at 2011/10/27 06:39:56 -0700

Does that work if your ClientType were added to another form type?

e.g.

```php
<?php

class MyComplexType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder->add('client', new ClientType());
    }

    // ...
}
```

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

by canni at 2011/10/27 06:44:33 -0700

This is doing nothing more than injecting array of validation groups, should work, but I have not tested this use case.

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

by canni at 2011/10/28 01:58:26 -0700

PHPUnit output

```
OK, but incomplete or skipped tests!
Tests: 5011, Assertions: 12356, Incomplete: 36, Skipped: 32.
```

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

by canni at 2011/11/02 11:37:47 -0700

Now functionality is complete, test are written, and implementation is clean. :)

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

by stloyd at 2011/11/02 11:50:44 -0700

Can tou `squash` your commits ? Thanks.

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

by canni at 2011/11/02 11:58:41 -0700

Done

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

by fabpot at 2011/11/07 07:51:18 -0800

Can you add some tests for the `DelegatingValidator` class, which is where we can ensure that the new feature actually works as expected?

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

by canni at 2011/11/07 13:53:16 -0800

OK, I've written proof-of-concept tests, also I've squashed few commits to make things clear.
Personally I think this should go straight into 2.0 series, as it do not beak BC, and a feature is really nice to use.

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

by stof at 2011/11/07 14:17:15 -0800

@canni the 2.0 branch is for bug fixes, not for new features. This is the difference between maintenance releases and minor releases.
2011-11-08 09:05:41 +01:00
Fabien Potencier
290734353c merged 2.0 2011-11-08 08:38:14 +01:00
Fabien Potencier
9d2ab9ca9c [Doctrine] fixed security user reloading when the user has been changed via a form with validation errors (closes #2033) 2011-11-08 08:33:49 +01:00
Fabien Potencier
414d4be7e8 [Doctrine] refactored unit tests 2011-11-08 08:23:31 +01:00
Fabien Potencier
318576b3ac merged branch ericclemmons/2295-serializer-normalizable-traversable (PR #2578)
Commits
-------

7346896 Changed Serialized#supportsNormalization to PRIVATE
e851efc Updated SerializerTest with "normalizeTraversable" & "testNormalizeGivesPriorityToInterfaceOverTraversable"
d789f94 Serializer#normalize gives precedence to objects that support normalization
9e6ba9a Added protected Serializer#supportsNormalization

Discussion
----------

[Serializer] `normalize` should use supported normalizer before Traversable

Bug fix: yes
Feature addition: no
Backwards compatibility break: no (discussion needed)
Symfony2 tests pass: yes
Fixes the following tickets: #2295

**Same as PR #2539, except rebased onto `2.0`**

Should I abstract out a `supportsDenormalization` function just for symmetry?
2011-11-08 07:46:27 +01:00
Eric Clemmons
e851efc8d6 Updated SerializerTest with "normalizeTraversable" & "testNormalizeGivesPriorityToInterfaceOverTraversable" 2011-11-07 19:25:58 -08:00
Fabien Potencier
8d9ea7c1ce merged branch dpb587/patch-sectok (PR #2414)
Commits
-------

ab9caa0 [Security] Check for request's session before attempting writes.
dabff0e [Security] Support removing tokens from a session.

Discussion
----------

[Security] Support removing tokens from a session.

Currently there is no way to remove a session's security token without invalidating the entire session and all its data (the ContextListener will only update the session if a token is non-null and non-anonymous). This patch fixes that.

I consider this a bug and I found no tests to prove otherwise. Let me know if I'm mistaken. Originally mentioned at https://groups.google.com/d/topic/symfony-devs/ojLvh0WUbfo/discussion

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

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

by ms937 at 2011/10/24 05:19:21 -0700

This change looks good to me. In fact I'm using similar patch in my app and it works as intended. Also, several other people requested this on the mailing list. Could someone from Symfony team merge this? Thanks.
2011-11-07 23:19:37 +01:00
Dariusz Górecki
d08ec5e55f Add DelegatingValidator tests 2011-11-07 22:48:01 +01:00
Dariusz Górecki
e1822e7807 Enable dynamic set of validation groups by a callback or Closure
This will enable developer, to set a callback or a closure as a `'validation_groups'` form option,
this is usefull when we have to determine validation groups based on a client submitted data.
2011-11-07 22:48:01 +01:00
Fabien Potencier
a7296e7c84 [Security] made exceptions thrown by the user checker and the checkAuthentication() method use the hideUserNotFoundExceptions flag 2011-11-07 22:43:16 +01:00
Fabien Potencier
18c6a86291 [HttpKernel] fixed some unit tests 2011-11-07 22:31:58 +01:00
Fabien Potencier
5d91849999 merged 2.0 2011-11-07 20:53:25 +01:00
Fabien Potencier
6f05544424 [Console] added an exception when overriding an existing argument (added some unit tests for option and arguments overriding) 2011-11-07 17:22:50 +01:00
Jordi Boggiano
fabe818124 [EventDispatcher] Add reference to the EventDispatcher on the Event 2011-11-06 13:48:47 +01:00
Fabien Potencier
dbba79651a [Yaml] fixed dumper for floats when the locale separator is not a dot 2011-11-04 08:47:39 +01:00
Fabien Potencier
c18f5a8d94 merged branch IamPersistent/collection (PR #2416)
Commits
-------

fbd2a0e make suggested changes for default value
c507b1d update variable name to match the option name
b53f000 add the ability to set the form prototype name in CollectionType. this will aid in handling nested collections in forms

Discussion
----------

[Form] Collection

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: [#1324](https://github.com/symfony/symfony/issues/1324)

add the ability to set the form prototype name in CollectionType. this will aid in handling nested collections in forms

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

by IamPersistent at 2011/10/17 02:54:45 -0700

Actually, as an afterthought, I looked over at the issues and this is basically https://github.com/symfony/symfony/issues/1324 just adding an extra option instead of using the prototype option.

@stloyd, my thought was handling the case where someone was "clever" enough to set the 'prototype_name' option to "". But I could be over-thinking :)

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

by stloyd at 2011/10/17 03:00:23 -0700

@IamPersistent IMO if someone is setting this option, he should be aware of that problem, also AFAIK `$$$$` could be *valid* name too ;-)

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

by IamPersistent at 2011/10/17 03:02:14 -0700

@stloyd, I'm fine with changing it, I'll wait to see what everyone else has to say about this request vs using the prototype option for the name in 1324

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

by IamPersistent at 2011/10/17 03:28:49 -0700

@stloyd, @stof, I made the suggested changes, now I suppose, let the debate begin over PR1324 vs this

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

by stloyd at 2011/10/17 03:47:53 -0700

IMO this PR makes changing prototype name in more clean way, so I would prefer this one over that proposed in #1324.
2011-11-02 14:50:07 +01:00
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
Fabien Potencier
2e90a813a4 merged branch mrtorrent/integer_transformer_cast_fix (PR #2520)
Commits
-------

c9d05d7 Let NumberFormatter handle integer type casting

Discussion
----------

Let NumberFormatter handle integer type casting

The integer to localised string transformer is currently casting everything it gets to an integer, even if it is not a number. This responsibility should be passed off to NumberFormatter.

Partially addresses #2389 by not mistakenly typecasting a boolean false into an integer 0

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

by mrtorrent at 2011/10/30 15:04:28 -0700

Apologies, forgot the template:

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2389 (partial)
2011-11-02 14:36:23 +01:00
Fabien Potencier
af6f0d5548 [Form] removed some incomplete unit tests, added some new ones 2011-11-02 07:19:01 +01:00
Fabien Potencier
a554541cb4 [Process] removed an incomplete test that cannot be fixed 2011-11-02 06:58:56 +01:00
Eric Clemmons
eca414b8b2 Fixed incomplete EntityType tests
* testOverrideChoices
* testSetDataToUninitializedEntityWithNonRequired
2011-11-01 19:24:06 -07:00
Fabien Potencier
67bb80f526 merged branch benjamindulau/type_validator (PR #2532)
Commits
-------

05a4e9d [Validators][Type] Added support for ctype_* functions + tests

Discussion
----------

[Validators][Type] Added support for ctype_* functions + tests

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

Not sure if the ctype_* functions support should be included in the AssertTypeValidator or in a dedicated one.
What do you think ?
2011-11-01 15:28:13 +01:00
Fabien Potencier
3f38b9c537 merged branch ericclemmons/1735-entity_choice_list_group_by (PR #2464)
Commits
-------

6cb7acf CS - camelCase & curly braces
d9b7abb Added EntityChoiceList test for `group_by` and invalid, deep property paths
e6554d6 Removed Closure support from group_by (PropertyPath strings only)
037933a CS - (String) renamed to (string)
7ad0f05 Added group_by test for EntityType
882482a Added group_by tests for EntityChoiceList
040e988 `EntityChoiceList` now supports grouping of entities by property path or closure
b171a6a Added `group_by` to EntityType

Discussion
----------

[Doctrine] [Form] EntityType+EntityChoiceList supports grouping choices

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

Per the discussion in #1735, `EntityType` does not immediately support grouping options, though I updated support for it in `EntityChoiceList` in fb9d951b1d.

This PR accomplishes the following:

* Adds optional `group_by` property to `EntityType` that supports either a `PropertyPath` or a `\Closure` that is evaluated on the entity choices
* Support for groups is added via the constructor in `EntityChoiceList`
* Groups are created prior to `EntityChoiceList#loadEntities` via a new `groupEntities` function
* Added tests for `EntityChoiceList`
* Added test for `EntityType` `group_by` support

*There is an alternative version that only modifies `EntityType`, but that requires the addition of `EntityType#buildView(...)`, which is messy, IMO: https://github.com/ericclemmons/symfony/compare/master...1735-entity_type_group_by*

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

by fabpot at 2011/10/25 01:48:23 -0700

ping @beberlei

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

by beberlei at 2011/10/25 03:06:05 -0700

I didnt run the tests, but generally this looks very good and is a good extension.

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

by beberlei at 2011/11/01 06:25:09 -0700

@fabpot i revewied this and it looks very good, tests all pass, i think this is a very nice addition.
2011-11-01 15:23:39 +01:00
Benjamin Eberlei
149bdb962b Enhance error messages with regard to form type properties. 2011-11-01 14:16:02 +01:00
Benjamin Dulau
05a4e9d386 [Validators][Type] Added support for ctype_* functions + tests 2011-11-01 13:01:54 +01:00
Fabien Potencier
8a62e3249f merged 2.0 2011-11-01 12:32:44 +01:00
Henrik Westphal
dec1858223 Fixed typo 2011-10-31 09:00:49 +01:00
Miquel Rodríguez Telep / Michael Rodríguez-Torrent
89cd64a4a5 Set error code when number cannot be parsed. Fixes #2389 2011-10-30 22:02:16 +00:00
Miquel Rodríguez Telep / Michael Rodríguez-Torrent
c9d05d7236 Let NumberFormatter handle integer type casting
Partially addresses #2389 by not mistakenly typecasting a boolean false into
an integer 0
2011-10-30 21:17:28 +00:00
Fabien Potencier
d34d50f0b0 fixed CS 2011-10-29 12:05:45 +02:00
Fabien Potencier
99a96d35b5 Merge branch '2.0'
* 2.0:
  fixed CS
2011-10-29 12:04:03 +02:00
Fabien Potencier
68b7662400 fixed CS 2011-10-29 12:03:59 +02:00
Fabien Potencier
8550f372fb removed unused use statements 2011-10-29 12:01:53 +02:00
Fabien Potencier
dec43f5539 merged 2.0 2011-10-29 12:01:39 +02:00
Fabien Potencier
851eb73778 removed unused use statements 2011-10-29 11:56:30 +02:00
Jeremy Mikola
80f0b980ba [DependencyInjection] Fix DefinitionDecorator::getArgument() for replacements
While Definition::getArgument() could be used to fetch replaced values, it relied upon bad comparison logic (e.g. "index_1" > 1). Additionally, storing original arguments and replacements in the same array makes Definition::getArguments()'s bounds check unreliable. A single argument and its replacement would count twice, allowing getArgument(2) to pass the bounds check and result in an array index error.

With this new method, fetching of replacement arguments is more straightforward and bounds checking functions as it should.
2011-10-27 18:03:51 -04:00
Jeremy Mikola
4bbb685557 [DependencyInjection] Test Definition and DefinitionDecorator exceptions 2011-10-27 17:59:47 -04:00
Fabien Potencier
8c0517f305 merged 2.0 2011-10-27 06:56:53 +02:00
Fabien Potencier
6c538dfb22 merged branch beberlei/ProcessPipesWindows (PR #2483)
Commits
-------

fee217f Update tests/Symfony/Tests/Component/Process/ProcessTest.php
d58e682 GH-2287 - Skip Process:processTest on Windows due to PHP bug #60120

Discussion
----------

[Process] Test with pipes hang on windows

Rebased onto 2.0
2011-10-26 23:08:26 +02:00
Benjamin Eberlei
fee217f56f Update tests/Symfony/Tests/Component/Process/ProcessTest.php 2011-10-26 20:18:39 +02:00
Benjamin Eberlei
d58e68269a GH-2287 - Skip Process:processTest on Windows due to PHP bug #60120 2011-10-26 20:18:39 +02:00
Fabien Potencier
ac5b8a4c37 merged 2.0 2011-10-26 14:29:19 +02:00
Fabien Potencier
5404a46c45 [HttpFoundation] marked some tests as skipped when intl is not available 2011-10-26 14:28:56 +02:00
Fabien Potencier
408414c252 [Form] marked some tests as skipped when intl is not available 2011-10-26 14:23:39 +02:00
Danny Berger
ab9caa0a61 [Security] Check for request's session before attempting writes. 2011-10-25 14:19:34 -04:00
Eric Clemmons
6cb7acfa75 CS - camelCase & curly braces 2011-10-25 09:12:57 -07:00
Eric Clemmons
d9b7abb7c7 Added EntityChoiceList test for group_by and invalid, deep property paths
This is a common case with optional Entity associations:
  $user->getGroup()->getName()

The property path `group.name` (traversing from the User Entity), when
the User is not assigned to a Group, will throw an UnexpectedTypeException.
This is caught so that the User can still be listed as an option, just without
any nesting.
2011-10-25 09:05:26 -07:00
Eric Clemmons
e6554d6d45 Removed Closure support from group_by (PropertyPath strings only) 2011-10-25 08:55:31 -07:00
Fabien Potencier
bc330d4487 merged branch lsmith77/fix_q_handling (PR #2365)
Commits
-------

d3f137b cosmetic tweak
2877883 anything in front of ;q= is part of the mime type, anything after may be ignored

Discussion
----------

[HttpFoundation] fix splitHttpAcceptHeader() parsing of parameters

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

anything in front of ;q= is part of the mime type, anything after may be ignored

see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1

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

by lsmith77 at 2011/10/09 04:00:12 -0700

i must admit .. i am not 100% that my implemention is correct either .. but i am sure the current one isn't.

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

by lsmith77 at 2011/10/09 07:57:33 -0700

@fabpot: I am also not sure if getFormat() should optionally not support matching parameters, aka anything before ``;q=..``
2011-10-25 17:26:31 +02:00
Eric Clemmons
7ad0f0527b Added group_by test for EntityType 2011-10-24 18:52:40 -07:00
Eric Clemmons
882482a308 Added group_by tests for EntityChoiceList 2011-10-24 18:46:19 -07:00
Vadim Tyukov
808088a3ca added the ability to use dot and single quotes in the keys and values 2011-10-24 12:45:36 +03:00
Fabien Potencier
24b93928bf [Routing] added a matcher that helps debugging matching problems 2011-10-24 09:08:36 +02:00
Fabien Potencier
14055c2504 [Routing] added a unit test to document an intended behavior (defaults and requirements are overriden when defined in the addPrefix method) 2011-10-23 14:45:47 +02:00
Fabien Potencier
6aee641a1e revert 89fd965 (refs #2339) 2011-10-23 14:09:54 +02:00
Fabien Potencier
2e1344eb7e [Routing] added the possibility to define default values and requirements for placeholders in prefix 2011-10-23 11:57:55 +02:00
Fabien Potencier
3134ef132a [HttpKernel] removed usage of assertCount which has been introduced in PHPUnit 3.6 2011-10-23 09:41:19 +02:00
Fabien Potencier
c5ca40c711 [Routing] added support for _scheme requirement in UrlMatcher (see 07aae98495) 2011-10-22 08:04:10 +02:00
Fabien Potencier
106ebdbe18 [HttpKernel] added a Stopwatch 2011-10-21 07:39:32 +02:00
Fabien Potencier
347053c363 Moved most of the logic from ResponseListener to the Response::prepare() method
That allows projects that only use HttpFoundation and not HttpKernel to be able to
enforce the HTTP specification "rules".

$request = Request::createFromGlobals();
$response = new Response();

// do whatever you want with the Respons

// enforce HTTP spec
$response->prepare($request);

$response->send();

Within Symfony2, the prepare method is automatically called by the ResponseListener.
2011-10-18 09:04:20 +02:00
IamPersistent
b53f000061 add the ability to set the form prototype name in CollectionType. this will aid in handling nested collections in forms 2011-10-17 02:43:24 -07:00
Fabien Potencier
de9cf88676 merged 2.0 2011-10-17 02:33:13 +02:00
Fabien Potencier
2b0af5e93b [HttpKernel] fixed profile parent/children for deep-nested requests 2011-10-17 02:32:06 +02:00
Fabien Potencier
360053d95a [DoctrineBridge] fixed a unit test 2011-10-16 22:45:12 +02:00
Christophe Coevoet
a1784c2b97 [DoctrineBridge] Updated the code to use the new registry 2011-10-16 14:57:14 +02:00
Fabien Potencier
2aa1e4d351 merged branch stloyd/tests-fix (PR #2401)
Commits
-------

205f524 [Tests] Skip MimeTypeTest if running as root
d3e9104 [Tests] Skip Routing annotation tests when Doctrine is not available.

Discussion
----------

[Tests] Fix tests when some vendor is not available.
2011-10-16 09:19:00 +02:00
Tobias Schultze
c73643675f fixed language in test 2011-10-16 07:53:44 +03:00
Fabien Potencier
ae8efc4da9 merged 2.0 2011-10-16 03:34:55 +02:00
Joseph Bielawski
205f524758 [Tests] Skip MimeTypeTest if running as root 2011-10-15 13:45:35 +02:00
Joseph Bielawski
d3e9104b52 [Tests] Skip Routing annotation tests when Doctrine is not available. 2011-10-15 13:06:22 +02:00
Joseph Bielawski
d9d9c6b57a [Tests] Skip Monolog test if it's not available. 2011-10-15 13:00:48 +02:00
Fabien Potencier
6b3c7ac62d Merge branch '2.0'
* 2.0:
  [Doctrine] GH-1635 - UniqueValidator now works with associations
2011-10-15 11:07:39 +02:00
Benjamin Eberlei
9d8046e407 [Doctrine] GH-1635 - UniqueValidator now works with associations 2011-10-15 09:20:06 +02:00
Fabien Potencier
3ca1ccbf67 [DoctrineBridge] removed the Xml and Yaml driver as they are now part of Doctrine 2011-10-15 04:25:55 +02:00
Fabien Potencier
3bbb6e5993 merged branch hhamon/type_validator_fix (PR #2379)
Commits
-------

73312ab [Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".

Discussion
----------

[Validator] The Type constraint now accepts the "Boolean" type instead of

[Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".

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

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

by stloyd at 2011/10/11 03:43:24 -0700

As this is bugfix only, this should be made againts __2.0__ branch.

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

by hhamon at 2011/10/11 05:03:52 -0700

@stloyd I don't really know if it's a bug fix or an improvement. We could not use "Boolean" but we could use "boolean" or "bool" only. So that's why I just improved this constraint validator.
2011-10-15 03:12:16 +02:00
Danny Berger
dabff0e4d5 [Security] Support removing tokens from a session. 2011-10-14 20:27:53 -04:00
Fabien Potencier
5b69dae9c8 [HttpKernel] fixed profiler file storage for children 2011-10-15 01:52:05 +02:00
Fabien Potencier
4dc5953100 merged 2.0 2011-10-15 00:56:57 +02:00
Fabien Potencier
d35fb9ff70 merged branch alexandresalome/file-storage-children-fix (PR #2368)
Commits
-------

ba6bd4b [HttpKernel] Fix the FileProfileStorage, according to the tests
1654473 [HttpKernel] Create a test to outline the problem with file storage

Discussion
----------

[HttpKernel] Fix the file storage

The file storage was not correctly fetching children back.

* First the test showing the problem
* Second the fix to the test

Solution is to add a file for each stored profile file, containing the list of children tokens.
2011-10-15 00:48:58 +02:00
Chris Smith
d8dfca21f2 [BrowserKit] Added additional unit tests for capital letters in cookies 2011-10-14 20:31:31 +01:00
Chris Smith
00cbd39813 [BrowserKit] Fixed cookie expiry discard when attribute contains capitals 2011-10-14 20:23:34 +01:00
Hugo Hamon
73312ab5e9 [Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-11 12:27:45 +02:00
Christophe Coevoet
6e4269f9eb [Form] Added the ability to specify the translation domain 2011-10-10 17:58:32 +02:00
Fabien Potencier
4539e5c554 moved configuration of the default HTTP and HTTPS ports from RouterListener to RequestContext 2011-10-10 13:24:45 +02:00
Fabien Potencier
8f15794274 moved LocaleListener and RouterListener to the HttpKernel component 2011-10-10 13:03:55 +02:00
alexandresalome
1654473a4c [HttpKernel] Create a test to outline the problem with file storage 2011-10-09 22:32:11 +02:00
Lukas Kahwe Smith
28778834c7 anything in front of ;q= is part of the mime type, anything after may be ignored
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
2011-10-09 12:58:45 +02:00
Fabien Potencier
a8faa83708 merged 2.0 2011-10-08 22:58:00 +02:00
Fabien Potencier
74bc699b27 moved management of the locale from the Session class to the Request class
The locale management does not require sessions anymore.

In the Symfony2 spirit, the locale should be part of your URLs. If this is the case
(via the special _locale request attribute), Symfony will store it in the request
(getLocale()).

This feature is now also configurable/replaceable at will as everything is now managed
by the new LocaleListener event listener.

How to upgrade:

The default locale configuration has been moved from session to the main configuration:

Before:

framework:
    session:
        default_locale: en

After:

framework:
    default_locale: en

Whenever you want to get the current locale, call getLocale() on the request (was on the
session before).
2011-10-08 18:34:49 +02:00
Miha Vrhovnik
395f580fd7 Rebuild resource files with genrb from ICU 4.2. as ICU 4.4 by default builds them in newer format.
Also added all files necessary to build resources.dat with pkgdat because syntax for command is so cryptic
2011-10-08 16:41:17 +02:00
Miha Vrhovnik
438581deda Skip test if running as superuser as it will fail 2011-10-08 14:10:49 +02:00
stealth35
ae0685a314 [Translation] Loader should only load local files 2011-10-07 18:30:56 +02:00
Fabien Potencier
f22566ca19 merged branch stloyd/ScalarTransformer (PR #2341)
Commits
-------

95049ef [Form] Added type check to `ScalarToChoiceTransformer`

Discussion
----------

[2.0][Form] Added type check to ScalarToChoiceTransformer

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-07 14:06:24 +02:00
Fabien Potencier
4cdf6ac9f4 merged branch stloyd/FormUtil (PR #2340)
Commits
-------

18a83c6 [Form] Simplified a bit `FormUtil` and extended test coverage

Discussion
----------

[2.0][Form] Simplified a bit `FormUtil` and extended test coverage

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-07 14:05:47 +02:00
stloyd
18a83c67f4 [Form] Simplified a bit FormUtil and extended test coverage 2011-10-07 12:04:26 +02:00
stloyd
95049ef902 [Form] Added type check to ScalarToChoiceTransformer 2011-10-07 12:01:07 +02:00
Jordi Boggiano
deb6dea76d [Translation] Add failing tests to verify that UTF-8 lang files can't be used with another charset 2011-10-07 11:20:16 +02:00
Joseph Bielawski
d7c9644d29 [Validator] Extend and fix DateValidator & TimeValidator tests 2011-10-07 10:47:59 +02:00
Fabien Potencier
0e852fe232 Merge branch '2.0'
* 2.0:
  [DoctrineBundle] fixed a unit test (detected thanks to PHP 3.6.0)
  [Form] Fixed lacking attributes in DateTimeType
2011-10-06 21:40:44 +02:00
Katsuhiro OGAWA
828b18f467 [Form] Fixed lacking attributes in DateTimeType 2011-10-05 17:57:43 +09:00
Fabien Potencier
55e7e1a198 [Translation] changed some unit tests for PHPUnit 3.6.0 compatibility 2011-10-04 09:36:09 +02:00
Fabien Potencier
fbe9aa526e merged 2.0 2011-10-04 09:32:13 +02:00
Fabien Potencier
92d19063a8 [Translation] changed some unit tests for PHPUnit 3.6.0 compatibility 2011-10-04 08:43:04 +02:00
Fabien Potencier
5c8a2fb48d [Routing] fixed route overriden mechanism when using embedded collections (closes #2139) 2011-09-30 12:01:46 +02:00
Danny Berger
e70c884f49 [Bridge/Monolog] Fix WebProcessor to accept a Request object. 2011-09-30 01:58:45 -04:00
Fabien Potencier
41a55ba8d7 Merge branch '2.0'
* 2.0:
  [Validator] added support for grapheme_strlen when mbstring is not installed but intl is installed
  removed separator of choice widget when the separator is null
2011-09-29 16:17:23 +02:00
Fabien Potencier
d6c4bfb001 added a Size validator 2011-09-29 15:56:37 +02:00
Fabien Potencier
b9ba117208 [Validator] added a SizeLength validator 2011-09-29 15:45:52 +02:00
Fabien Potencier
d429594afb removed separator of choice widget when the separator is null 2011-09-29 10:14:34 +02:00
Fabien Potencier
029223d760 merged branch jalliot/subscriber-improv (PR #2148)
Commits
-------

5146a1f [EventDispatcher] Added possibility for subscribers to subscribe several times for same event

Discussion
----------

[EventDispatcher] Added possibility for subscribers to subscribe several times for same event

[EventDispatcher] Added possibility for subscribers to subscribe several times for same event

closes #2146

And it is of course fully BC :)

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

by jalliot at 2011/09/09 17:34:07 -0700

If merged, #2021 will have to reflect the change too
2011-09-28 18:24:57 +02:00
Fabien Potencier
885bb33791 merged 2.0 2011-09-28 16:08:31 +02:00
Fabien Potencier
6eeca8e36d merged branch stealth35/fix_2142 (PR #2290)
Commits
-------

b12ce94 [HttpFoundation] fix #2142 PathInfo parsing/checking

Discussion
----------

[HttpFoundation] fix #2142 PathInfo parsing/checking

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2142
2011-09-28 15:02:56 +02:00
stealth35
b12ce94c38 [HttpFoundation] fix #2142 PathInfo parsing/checking
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2142
2011-09-28 13:18:44 +02:00
Fabien Potencier
b4028350d2 [HttpFoundation] standardized cookie paths (an empty path is equivalent to /) 2011-09-28 10:49:50 +02:00
Fabien Potencier
128468193f [BrowserKit] standardized cookie paths (an empty path is equivalent to /) 2011-09-28 10:49:26 +02:00
xaav
9af2342076 [Translation] Added the gettext loaders 2011-09-28 10:24:34 +02:00
Fabien Potencier
a57a4aff55 [DomCrawler] added a way to get parsing errors for Crawler::addHtmlContent() and Crawler::addXmlContent() via libxml functions 2011-09-28 10:00:18 +02:00
Fabien Potencier
7b204ed23a merged branch drak/paramaterbag_filter (PR #2261)
Commits
-------

c4a0f79 Updates according to suggestions.
6aec789 Added tests.
54454ba Added generic filtering to ParameterBag.

Discussion
----------

Added generic filtering to ParameterBag.

Adds filtering convenience using PHP's filter_var() e.g.

    $request->get->filter($key, '', false, FITLER_SANITIZE_STRING);

See http://php.net/manual/en/filter.filters.php for capabilities.

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

by GromNaN at 2011/09/25 15:41:50 -0700

What is the use case ?

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

by drak at 2011/09/25 15:52:19 -0700

Input variable validation/sanitization.  ParameterBag has a few built in like `getAlnum()` for example.  This method offer's PHP's full filtering and sanitization suite.

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

by fabpot at 2011/09/27 00:56:41 -0700

Can you add some unit tests for this new feature?

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

by drak at 2011/09/27 00:58:56 -0700

Sure thing.

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

by drak at 2011/09/27 01:07:03 -0700

Before I make the commit, is the method name ok for you or would you prefer it is called `getFiltered()`?

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

by fabpot at 2011/09/27 01:13:46 -0700

`filter` sounds good to me.

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

by drak at 2011/09/27 02:37:01 -0700

I've added some tests.

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

by stloyd at 2011/09/27 02:42:42 -0700

@drak IMO you must check that user don't use unknown filter and/or flags for filter.

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

by drak at 2011/09/27 02:48:38 -0700

@stloyd - I'm not sure that's practical at all, this is a wrapper for a built-in PHP function and I don't understand why we would need validate arguments for a PHP function - it's the coder's job to use the API correctly - none of the inputs to this function are coming from a web request.  It would also mean that the API would need to keep track of any upstream changes to constants in the PHP engine (which are just integers after all).  It's really just not practical.

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

by stealth35 at 2011/09/27 05:16:50 -0700

@drak it's could be cool to use `filter_id` ✌️

    if (is_string) {
        $filter = filter_id($filter);
    }

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

by drak at 2011/09/27 07:05:42 -0700

@stealth35 regarding this

    if (is_string) {
        $filter = filter_id($filter);
    }

I believe strongly in the use of IDEs when coding and autocomplete nicely provides when you type `FILTER_`.  Additionally, `filter_id()` only works on filters, but not for the flags, so I'm not entirely sure how useful it would be overall compared to using a good IDE (which you need when working with complex frameworks anyhow, imo :)

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

by drak at 2011/09/27 07:30:10 -0700

Ok check it now.
2011-09-27 17:21:30 +02:00
Drak
c4a0f799af Updates according to suggestions.
- Simplified logic of tests.
- Added more comments/docblocks.
- Added more convenience.
2011-09-27 20:14:32 +05:45
Drak
6aec7898e3 Added tests. 2011-09-27 15:20:51 +05:45
Fabien Potencier
9b37637184 [Form] added tests for previous merge 2011-09-27 10:12:54 +02:00
Josef Cech
85ed5c67dc [ClassLoader] Fixed state when trait_exists doesn't exists 2011-09-25 19:25:50 +02:00
Fabien Potencier
1103ca8185 merged 2.0 2011-09-25 11:52:31 +02:00
Fabien Potencier
49c585ebd2 Revert "merged branch stealth35/ini_bool (PR #2235)"
This reverts commit 363057b181, reversing
changes made to 545cd4cd63.
2011-09-25 11:33:22 +02:00
Fabien Potencier
fa13469bba Revert "[DependencyInjection] fixed array support for the ini loader"
This reverts commit e0ace8eaee.
2011-09-25 11:33:07 +02:00
Fabien Potencier
27fc06785b Revert "[DepedencyInjection] fixed unit tests"
This reverts commit b8e5a155e4.
2011-09-25 11:33:00 +02:00
Fabien Potencier
ea401564ba [Form] reverted partially previous commit 2011-09-24 16:42:12 +02:00
Fabien Potencier
78ebe11a0c [Form] added some missing tests for previous merge 2011-09-24 15:28:16 +02:00
Fabien Potencier
c832b71600 merged branch stloyd/repeatedtype (PR #1453)
Commits
-------

67c33a8 Rebased with master, and fixed wrong behavior with proper tests coverage
f8a6a4b Be sure that both fields have same value for required option in RepeatedType
0679220 Additional test coverage for changes in RepeatedType
b23d47d moved options test form from class->method scope
5fe5556 fixed accidental permission change
a969434 [Form] fixed CS, merged options, added tests
8819db3 [Form] Allow setting different options to repeating fields

Discussion
----------

[2.1] [Form] Allow setting different options at RepeatedType fields

This an test covered version of #1348 (rebased with master).

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

by stloyd at 2011/06/27 04:18:19 -0700

@fabpot What do you think about this ? I'm just not sure that we should allow setting `required` per field, IMO better would be forcing this option from default `$options['options']` and ignore that field in `$options['first_options']` and/or `$options['second_options']`.

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

by stloyd at 2011/07/02 00:00:04 -0700

@fabpot ping.

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

by fabpot at 2011/07/06 05:45:56 -0700

Let's discuss this new feature for 2.1.

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

by stloyd at 2011/08/24 01:12:59 -0700

Rebased with master.

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

by stof at 2011/09/04 05:02:42 -0700

@fabpot What do you think about this feature ? It is now time to discuss it :)

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

by fabpot at 2011/09/22 00:18:29 -0700

Tests do not pass.

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

by stloyd at 2011/09/24 01:54:42 -0700

@fabpot Should be ok now.
2011-09-24 15:22:26 +02:00
stloyd
67c33a8e02 Rebased with master, and fixed wrong behavior with proper tests coverage 2011-09-24 10:44:47 +02:00
stloyd
f8a6a4b1e5 Be sure that both fields have same value for required option in RepeatedType 2011-09-24 10:25:07 +02:00
stloyd
0679220b45 Additional test coverage for changes in RepeatedType 2011-09-24 10:25:06 +02:00
Helmer Aaviksoo
b23d47d274 moved options test form from class->method scope 2011-09-24 10:25:06 +02:00
Helmer Aaviksoo
5fe5556bea fixed accidental permission change 2011-09-24 10:25:06 +02:00
Helmer Aaviksoo
a96943482b [Form] fixed CS, merged options, added tests 2011-09-24 10:25:05 +02:00
Fabien Potencier
85ba3d0274 merged 2.0 2011-09-23 21:10:42 +02:00
Fabien Potencier
d830253876 [Routing] fixed unit tests broken by previous merge 2011-09-23 20:56:18 +02:00
Alberto Pirovano
ae3aded83f Added PCRE_DOTALL modifier to RouteCompiler to allow urlencoded linefeed in route parameters. 2011-09-23 16:53:06 +02:00
Fabien Potencier
b8e5a155e4 [DepedencyInjection] fixed unit tests 2011-09-23 11:59:37 +02:00
Fabien Potencier
e0ace8eaee [DependencyInjection] fixed array support for the ini loader 2011-09-23 11:45:30 +02:00
Fabien Potencier
ee12b67e4e [TwigBridge] rewrote the Twig translation extractor
* The extractor is now reusable as this is a proper Twig node visitor
* The new extractor covers more cases
2011-09-23 09:38:20 +02:00
Fabien Potencier
b6c8f639f0 [TwigBridge] fixed message keys extraction when no domain is defined in the template 2011-09-23 08:39:02 +02:00
Fabien Potencier
645bd8215e [DomCrawler] added unit tests for previous merge 2011-09-23 08:10:01 +02:00
Fabien Potencier
98abc8ed05 [DependencyInjection] changed the default YAML indentation to 4 spaces instead of 2 2011-09-23 08:05:09 +02:00
Fabien Potencier
e5294fee12 fixed unit tests broken by previous merge 2011-09-23 07:59:44 +02:00
stealth35
11c441289a [DependencyInjection] fix 2219 IniFileLoader accept Boolean 2011-09-21 22:14:12 +02:00
Fabien Potencier
dd8e1e0fdb merged 2.0 2011-09-21 20:14:11 +02:00
Matthieu Bontemps
e3f6b4fc0d [Translation] Add a failing test when translating a non existent string with a fallback 2011-09-21 19:43:20 +02:00
stealth35
cf736ccde3 [DomCrawler] Add test for ChoiceFormField without value 2011-09-20 18:30:35 +02:00
Fabien Potencier
e2463caacd merged branch snc/mongodb-profiler (PR #2129)
Commits
-------

a0329c3 Added lifetime/cleanup support.
365e73a Fixed the find() method and changed the way the profile data is stored.
beeec5e Allow socket dsn (for example mongodb:///tmp/mongodb-27017.sock).
218eaba Fixed storage of time value.
85c3806 Added support for sorting by time like other profiler storage implementations.
73692c6 Fixed MongoDbProfilerStorage::find() when passing empty parameters.
4cd2dec Use token as identifier to make usage of the automatically created index.

Discussion
----------

[2.1] [HttpKernel] MongoDB profiler updates

I fixed one issue within the MongoDbProfilerStorage::find() function and made some more changes.

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

by snc at 2011/09/11 02:28:35 -0700

Please don't merge this in yet. There are some more commits pending...

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

by fabpot at 2011/09/14 01:07:39 -0700

@snc: is it ready for a merge?

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

by snc at 2011/09/14 01:20:32 -0700

Unfortunately not... while testing I found out that the currently merged in implementation does not work completely. The web profiler search function errors because the find function returns the wrong data. I fixed this already but now I have some strange "maximum function nesting level reached" errors when viewing profiles with children. I will work on it later today.

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

by snc at 2011/09/14 13:27:50 -0700

Now only one thing is missing... the generated container code looks like this:

`$this->services['profiler'] = $instance = new \Symfony\Component\HttpKernel\Profiler\Profiler(new \Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage('mongodb://localhost/sf2-mongo-profiler/profiler', '', '', 86400), $a);`

The current constructor only uses the first parameter (dsn). What about the username, password and lifetime? Username and passwort can already be passed via the dsn... but the lifetime feature is not part of the interface... should I implement it?

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

by fabpot at 2011/09/15 11:03:02 -0700

The `lifetime` is used to cleanup the database (see https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php#L136). So, it should probably be implemented for MongoDB as well (but it can probably be done in another PR).

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

by snc at 2011/09/19 13:42:52 -0700

Sorry for the delay, lifetime support is now implemented. What do you think about an AbstractProfilerStorageTest class to share some testing code between the different implementations (of cause in a separate PR)?
2011-09-20 07:19:49 +02:00
H. Westphal
a0329c37c9 Added lifetime/cleanup support. 2011-09-19 22:37:12 +02:00
Fabien Potencier
9a886ac73f merged branch stealth35/trans_ini (PR #2212)
Commits
-------

903ab81 [Translation] support Ini file

Discussion
----------

[Translation] support Ini file
2011-09-19 17:13:47 +02:00
stealth35
903ab81434 [Translation] support Ini file 2011-09-19 17:00:58 +02:00
Fabien Potencier
8c64202979 merged branch Seldaek/wintest (PR #2204)
Commits
-------

88ebe0c Adjust the way of checking for windows

Discussion
----------

Adjust the way of checking for windows
2011-09-19 07:36:55 +02:00
Fabien Potencier
6fa1d64f84 Merge branch '2.0'
* 2.0:
  [HttpKernel] fixed typo
  fixed previous merge, done the same change to other occurences
  fixes usage of mb_*
  Profiler session import fixed.
  [Process] workaround a faulty implementation of is_executable on Windows
  Swedish translation fix.
  [Locale] Fix #2179 StubIntlDateFormatter support yy format
  Fixed fourth argument of Filesystem->mirror()
2011-09-17 22:18:22 +02:00
Jordi Boggiano
88ebe0cfc4 Adjust the way of checking for windows 2011-09-17 12:57:47 +02:00
Jordan Alliot
5146a1f0d0 [EventDispatcher] Added possibility for subscribers to subscribe several times for same event
closes #2146
2011-09-16 18:13:00 +01:00
Johannes M. Schmitt
a1491e8b54 added some missing accessors/mutators 2011-09-16 13:43:09 +02:00
stealth35
43b55efd04 [Locale] Fix #2179 StubIntlDateFormatter support yy format
Fix #2179 Year limit is 2031 like IntlDateFormatter
2011-09-16 13:12:22 +02:00
Fabien Potencier
5526072dba [Translation] added support for more than one fallback locale 2011-09-15 08:19:52 +02:00
Fabien Potencier
3a4d1a6a22 merged 2.0 branch 2011-09-15 07:39:20 +02:00
Fabien Potencier
c50a3a194d [Translation] fixed transchoice when used with a fallback 2011-09-14 22:31:09 +02:00
H. Westphal
365e73aa71 Fixed the find() method and changed the way the profile data is stored. 2011-09-14 22:15:57 +02:00
Fabien Potencier
c985ffaa99 [Translation] fixed message selector when the message is empty (closes #2144) 2011-09-14 22:04:39 +02:00
Fabien Potencier
55eaf4e0f5 merged branch danielholmes/master (PR #2031)
Commits
-------

777f876 [HttpFoundation] Added test that exposes error in session saving

Discussion
----------

[HttpFoundation] Added test that exposes error in session saving

Noticed this commit in the recent release:

https://github.com/symfony/symfony/commit/34a1b53

And noticed that the save in __destruct won't be fired if a manual save has been called. The testSavedOnDestructAfterManualSave test I've added fails on 2.0.1 but it passes with 2.0.0. An example:

$session->set('foo', 'value');
$session->__destruct(); // eventually called during shutdown, triggers a save
// During next request, $session->get('foo') returns 'value'

$session->set('foo', 'value');
$session->save();
$session->set('foo', 'newvalue');
$session->__destruct(); // eventually called during shutdown, however WON'T trigger save
// During next request, $session->get('foo') returns 'value'

In my eyes the save on destruction should still happen whether a save has been called manually or not - it's more predictable. But i can see arguments for the opposite as well.

If consensus is that this is a bug, I'm happy to provide a fix but wanted to get feedback on the 2 options:

 * Save optimisation can be reverted
 * Can make the save optimisation more intelligent so a write to storage is only done if something has changed. The best way to do this would be to close down the api and mark the session as invalid when an attribute is set for example, however all properties are currently protected and would need to be private, so it might break some people's extensions of session

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

by stof at 2011/09/04 02:13:52 -0700

@fabpot what about it ?
2011-09-14 20:55:06 +02:00
Fabien Potencier
c697b8fc1c merged branch aboks/classloader_test (PR #2154)
Commits
-------

a7b5c1c [Classloader] Fixed failing test on Windows

Discussion
----------

[Classloader] Fixed failing test on Windows
2011-09-14 10:45:09 +02:00
Fabien Potencier
73c8d2ba74 [Form] fixed error bubbling for Date and Time types when rendering as multiple choices (closes #2062) 2011-09-14 08:30:47 +02:00
Fabien Potencier
affb0cbca2 merged branch stealth35/trans_rb (PR #2136)
Commits
-------

e6e5146 [Translation] now support ResourceBundle

Discussion
----------

[2.1][Translation] now support ResourceBundle

support `.res` and `.dat` bundles

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

by marijn at 2011/09/08 08:59:39 -0700

There are a few references to `ressource`, I guess that is a typo...

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

by stealth35 at 2011/09/08 09:13:32 -0700

@marijn thank, done

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

by fabpot at 2011/09/11 00:42:37 -0700

Is it possible to add a dumper like we have for all other loaders?

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

by stof at 2011/09/11 03:46:39 -0700

Btw, you need to rebase your branch as it conflicts with master

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

by stealth35 at 2011/09/11 04:04:23 -0700

@fabpot it's more difficult (or the easy way it's to use `exec` with `derb`), I can create the text resources
@stof oki

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

by fabpot at 2011/09/11 23:52:19 -0700

@stealth35: Can you remove the `@api` tags? We will review what is included into the public API later on. thanks.

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

by stealth35 at 2011/09/12 04:18:07 -0700

@fabpot done
2011-09-13 08:49:05 +02:00
Fabien Potencier
51403530b9 merged branch stealth35/http_found_auth (PR #2029)
Commits
-------

aecfd0a [HttpFoundation] Support user and password in url

Discussion
----------

[HttpFoundation] Support user and password in url

Allow `http://user:password@test.com` for url request and `basic auth`

Added Methods for `Request`
  - `getUser`
  - `getPassword `

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

by stealth35 at 2011/08/26 07:52:57 -0700

@seldaek @stof thanks guys it's done

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

by stof at 2011/08/28 11:52:11 -0700

btw, you should rebase your branch on top of the upstream master branch as it conflicts

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

by stealth35 at 2011/08/28 13:15:55 -0700

@stof done

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

by stof at 2011/09/04 02:09:11 -0700

@stealth35 you made an error when rebasing: you merged the previous version of the branch instead of forcing the push, thus duplicating all commits in the PR (rebasing rewrites the history so it creates new commits). Could you clean your branch ?

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

by stealth35 at 2011/09/05 02:00:17 -0700

@stof 👍

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

by stealth35 at 2011/09/06 08:21:00 -0700

should be 2.0 ?

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

by fabpot at 2011/09/11 23:52:30 -0700

@stealth35: Can you remove the `@api` tags? We will review what is included into the public API later on. thanks.

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

by stealth35 at 2011/09/12 04:02:01 -0700

@fabpot done
2011-09-13 08:47:11 +02:00
Arnout Boks
a7b5c1c076 [Classloader] Fixed failing test on Windows 2011-09-12 13:21:31 +02:00
stealth35
e6e5146ccb [Translation] now support ResourceBundle 2011-09-12 13:17:14 +02:00
stealth35
aecfd0a891 [HttpFoundation] Support user and password in url 2011-09-12 13:01:04 +02:00
H. Westphal
218eaba265 Fixed storage of time value. 2011-09-11 12:26:12 +02:00
H. Westphal
3e2f1a4b13 Removed executable bits from all php files 2011-09-09 15:16:17 +02:00
Fabien Potencier
18d3dfe0bf merged branch snc/chmod-fixes (PR #2130)
Commits
-------

a0a97c6 Removed executable bits from all php files

Discussion
----------

Removed executable bits from all PHP files

Some files had a file mode of 755 and this PR changes them to 644. The reason behind this is that git always thinks that those files are changed when accessing the repository via a samba share on windows (tested with PhpStorm).

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

by fabpot at 2011/09/09 05:51:30 -0700

That was on my radar too. Can you do the same for the 2.0 branch?
2011-09-09 14:51:44 +02:00
Fabien Potencier
b99bb1e31b merged branch michelsalib/translation-command (PR #2051)
Commits
-------

ef322f6 -- add command that extracts translation messages from templates

Discussion
----------

[2.1] Extracting translation messages from templates

As seen here #1283 and here #2045, I push the command that extract translation from templates.

There are still a lot of new things here, but it seems more manageable.

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

by stof at 2011/09/04 02:04:40 -0700

@michelsalib Could you try to refactor the code to make it more flexible by moving the creating of the file to the dumpers to support other outputs (database...) ?

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

by michelsalib at 2011/09/04 02:35:50 -0700

You are right, I shall do it tonight.

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

by michelsalib at 2011/09/04 11:53:35 -0700

I just pushed a refactoring that should allow more flexibility. Dumpers are now responsive for writing the files. This way it is now possible to implement the DumperInterface that dump to a database and add it to the TranslationWriter.
I updated the tests accordingly.

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

by fabpot at 2011/09/05 23:27:27 -0700

To be consistent with other dumpers in the framework, the dumpers extending `FileDumper` should use `FileDumper` as a suffix like in `YmlFileDumper`.

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

by fabpot at 2011/09/05 23:41:12 -0700

A general note on PHPDoc: The first line of a phpdoc ends with a dot and starts with a present verb like in  `Extracts translation messages from template files.`

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

by michelsalib at 2011/09/06 01:23:31 -0700

I fixed most of the remarks. I just need to go through the phpdoc (in a few minutes).

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

by stloyd at 2011/09/06 01:28:55 -0700

@michelsalib you should use `git rebase` (see [docs](http://symfony.com/doc/current/contributing/code/patches.html#id1)) instead of `git merge`.

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

by michelsalib at 2011/09/06 01:31:06 -0700

@stloyd sorry. I will rebase (squash) everything when I am finished.

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

by kaiwa at 2011/09/06 01:31:18 -0700

Hey, it might be a little bit late, but may i ask a not code-related question?

Is it correct that the `--force` option only means to write the output to a file instead of writing it to stdout?

If so,

1. is it semantically correct? I mean... i'm not a native english speaker, but from unix programs i'm used to interpret a `--force` option as something like "overwrite", "ignore errors" or "suppress warnings". An option which is used in case of trouble most time. Feels confusing to me to be forced ;-) to use the `--force` option for simply writing to files.

2. does it makes sense to have a default behaviour instead of requiring the user to give either `--force` or `--dump-messages`? In which cases does the user wants to dump the messages to the console? Is it only for debugging / to review the messages?

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

by michelsalib at 2011/09/06 01:33:58 -0700

@kaiwa Your concerns seems perfectly right. Initially I just wanted to mimic the `doctrine:schema:update` command. But it can be changed.
@fabpot what do you think ?

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

by michelsalib at 2011/09/06 02:01:22 -0700

@stloyd I tried to do a `git rebase` and I am quite lost. I think I messed something when merge instead of rebase. How can I clean/squash my PR properly ?

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

by stloyd at 2011/09/06 02:11:29 -0700

@michelsalib for now just work as it is ;-) When I back from work I will try to help you to rebase it properly.

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

by michelsalib at 2011/09/06 02:12:17 -0700

@stloyd Thank you !

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

by stloyd at 2011/09/06 12:39:18 -0700

@michelsalib I was trying to rebase your code and revert it this _bad_ commit (merge), but without success.

IMO best way would be making _brand new_ branch based on symfony/master, and the `git cherry-pick` ([hint](http://ariejan.net/2010/06/10/cherry-picking-specific-commits-from-another-branch)) commits you need (almost all in this PR but without this one with merge), then you will need to apply again _by hand_ changes from commit fce24c7fa2 (this clean up you have done there).

I'm sorry I can't give you more help...

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

by michelsalib at 2011/09/07 09:41:36 -0700

@stloyd I finally succeed to fix this PR. Thanks to your help! I must admit the whole thing with `cherry-pick` command was quite epic.
@fabpot Don't be sorry, I am about to fix the PHPDoc. I shall squash right after.

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

by michelsalib at 2011/09/07 10:07:20 -0700

I just squashed and did a last polish of the code. You might want to read it again before merge.

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

by fabpot at 2011/09/07 11:40:48 -0700

 ok, code looks really good now. I think the only missing thing is some more unit tests (for the extractors for instance).

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

by michelsalib at 2011/09/07 12:18:59 -0700

Thanks, I'll look into it tomorrow.

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

by michelsalib at 2011/09/08 15:13:10 -0700

Hi,
I just added unit tests for both extractors (php and yaml).
Concerning the yaml extractor, the test is quite tricky because I need to mock the twig environment while returning a twig tree that contain a trans block and a trans filter. But it work fine with as little side effects as possible. Also I am not sure that the test should be in the TwigBundle.
IMO, the PR seems ready.

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

by stof at 2011/09/08 15:34:41 -0700

As the extractor is in bridge, the tests should be in the folder containing the tests for the bridge in tests/

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

by michelsalib at 2011/09/08 15:41:45 -0700

Thanks @stof, it is now fixed.

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

by michelsalib at 2011/09/09 00:48:47 -0700

thanks @stloyd, it is fixed now.

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

by michelsalib at 2011/09/09 01:25:24 -0700

Fixed again ;)
2011-09-09 11:17:04 +02:00
Michel Salib
ef322f680d -- add command that extracts translation messages from templates
-- add missing files

-- tweak translation command files

-- dumpers are now responsive for writting the files

-- moved the twig extractor the bridge

-- clear temp files after unit tests
-- check the presence of dumper in translation writer

-- General cleaning of the code

-- clean phpDoc

-- fix PHPDoc

-- fixing class name in configuration

-- add unit tests for extractors (php and twig)

-- moved test to correct location

-- polish the code

-- polish the code
2011-09-09 10:23:54 +02:00
Jordan Alliot
0bc2a6d67b [HttpFoundation] Added check for disposition value 2011-09-08 10:20:37 +01:00
H. Westphal
a0a97c6a22 Removed executable bits from all php files 2011-09-07 22:51:20 +02:00
H. Westphal
85c380647c Added support for sorting by time like other profiler storage implementations. 2011-09-07 22:38:22 +02:00
H. Westphal
73692c62cf Fixed MongoDbProfilerStorage::find() when passing empty parameters. 2011-09-07 22:32:54 +02:00
Fabien Potencier
f75d8ff653 merged branch benjamindulau/ImageValidator (PR #1214)
Commits
-------

89f4791 Fixed CS
a348efe Removed trailing whitespaces
135531a Replaced setExpectedException() methods by annotations
6ad83e7 Updated according to PR review
2de243c * Added Fixtures 2x2px test.gif image file * Updated tests for using fixture image instead of imagecreate function
a5a2dfa [ImageValidator] Added dedicated ImageValidator class with min width, max width, min height and max height validations

Discussion
----------

[2.1] [ImageValidator] Improved ImageValidator + tests

Added dedicated ImageValidator class with min width, max width, min height and max height validations

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

by kriswallsmith at 2011/06/04 10:32:56 -0700

This is nice but doesn't belong in the core as it adds a dependency on GD.

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

by benjamindulau at 2011/06/04 10:41:02 -0700

@kriswallsmith i'm not sure, php.net doc says :

    Note:

    This function does not require the GD image library.

Well, that could also be a mistake :)

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

by pborreli at 2011/06/04 11:17:25 -0700

i think @benjamindulau is right

```
$ php -m
[PHP Modules]
bcmath
calendar
com_dotnet
Core
ctype
date
dom
ereg
filter
ftp
hash
iconv
json
libxml
mcrypt
mhash
mysqlnd
odbc
pcre
PDO
Phar
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
zip
zlib
```

```
$ php -r "var_dump(getimagesize(__DIR__.'/src/Symfony/Bundle/FrameworkBund
le/Resources/public/images/blue_picto_less.gif'));"
array(7) {
  [0]=>
  int(18)
  [1]=>
  int(18)
  [2]=>
  int(1)
  [3]=>
  string(22) "width="18" height="18""
  ["bits"]=>
  int(5)
  ["channels"]=>
  int(3)
  ["mime"]=>
  string(9) "image/gif"
}
```

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

by benjamindulau at 2011/06/04 11:22:57 -0700

However, the tests use imagejpeg and imagedestroy, that's not valid.
But, i'm not sure how to correctly test the validator then.

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

by benjamindulau at 2011/06/04 11:31:51 -0700

Can i use an image from FrameworkBundle resources ?

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

by pborreli at 2011/06/06 03:47:24 -0700

just add your own image inside Fixture folder (smaller the better, 1x1, 1x2 ..)

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

by stof at 2011/09/04 05:27:42 -0700

@benjamindulau could you rebase your PR and update it according to the comments ?

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

by benjamindulau at 2011/09/04 06:31:34 -0700

Yep, i think i can find some time today to do that

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

by benjamindulau at 2011/09/04 09:27:29 -0700

I've updated the PR.

A big thank to Stof who helped me with my git mess ;-)
2011-09-06 08:18:07 +02:00
Fabien Potencier
22548d0537 merged branch stealth35/csv_dumper (PR #2092)
Commits
-------

dea46c7 [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper [Translation] support CsvDumper

Discussion
----------

[2.1][Translation] support CsvDumper

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

by michelsalib at 2011/09/05 04:56:47 -0700

The DumperInterface is probably going to change soon, it should be considered when merging : #2051.
2011-09-06 08:03:26 +02:00
Fabien Potencier
6c9331650f merged branch beberlei/QtTranslations (PR #1154)
Commits
-------

f2761dd Fix typo and include suggestion by Stof
4ac380e Adjust QtTranslations patch and include QtTranslationsDumper + test aswell
5712798 Adjust QtTranslationLoader to throw RuntimeException
21b29c2 Merge symfony/master
6bf43a1 [Translation] Add .ts as file extension to search for Qt Translation files.
5808715 [Translation] Add Qt Translation component with tests

Discussion
----------

[2.1] Qt translations

Add support for QT translations - it has a GUI and www.crowdin.net supports it.

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

by stof at 2011/05/30 07:24:48 -0700

You also need to register it in FrameworkBundle.

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

by tristanbes at 2011/06/26 12:08:47 -0700

crowdin seems to be a cool service. didn't know about this website. thanks

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

by fabpot at 2011/07/11 02:58:31 -0700

Just for the record: I've just removed all usage of `\Exception` in Symfony2 master:

6a7359389d

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

by beberlei at 2011/07/11 03:02:14 -0700

I will adjust the PR.

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

by tristanbes at 2011/08/28 11:10:02 -0700

Any news @beberlei ?

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

by beberlei at 2011/08/29 01:07:28 -0700

Yes, i have to allocate some time. Havent managed to do so yet.

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

by stof at 2011/09/04 05:28:16 -0700

@beberlei the PR also need to be rebased as it conflicts with master.
2011-09-06 08:00:21 +02:00
Fabien Potencier
a00c1f5927 merged branch Wotre/profiler_mongodb (PR #1784)
Commits
-------

41b7a19 Updated the tests so that tests will be marked as skipped when there is no MongoDB server present!
233c7db Updated the code to follow the symfony coding standards
7b24de5 Updated the code to follow the symfony coding standard using stof his remarks
fbcbdde - Fixed a small bug - Updated some phpdoc
00fdfec Added a MongoDbProfilerStorage engine

Discussion
----------

[2.1] [HttpKernel] MongoDb storage for Profiler

As a documentbased database like MongoDB is [supposedly fantastic in logging](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) I implemented a storage engine for the profiler that should enable us to use this database as storage for this.

Activate it using this way:

    framework:
        profiler:
            dsn:     mongodb://user:pass@location/database/collection

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

by stof at 2011/07/24 11:23:06 -0700

btw, the MongoDB session storage has already be rejected from the core so this should probably be moved to the DoctrineMongoDBBundle (even if it uses only the PHP extension and not Doctrine). @fabpot thoughts about this ?

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

by Wotre at 2011/07/24 11:52:56 -0700

Just my personal opinion, if it is prefered that way I will move this into the DoctrineMongoDBBundle.

While it is reasonable to bundle all Mongo related things together, I do believe that in the case of logging we want to avoid as many depencies as possible. Some exceptions can occur pretty early inside the framework, and it would be a shame if those aren't logged because this layer is written on top of doctrine. I'm not exactly familliar enough with the symfony internals as I only started using it a few days ago, but I can imagine that this can make a difference with some exceptions.

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

by stof at 2011/07/24 11:59:10 -0700

I don't ask you to use Doctrine in this code. It is fine to use the extension directly if it is enough.

Btw, the profiler is *not* used early. :)

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

by Wotre at 2011/07/26 10:45:05 -0700

So... Any final remark whether this should be moved to [the DoctrineMongoDBBundle](https://github.com/symfony/DoctrineMongoDBBundle) or not?

If it has to be moved, any comment on where in that bundle this should be put?

Also, if it has to be moved, how can we arrange the configuration using DI? Currently I've put a line in the FrameworkExtension file to use this engine for everything with a $dsn starting with mongodb; I imagine this kind of ugly depency can't really exist between the FrameworkBundle and another one.

Although it seems completely illogical to me, I will move it, but I do need some directions on how to elegantly do this...

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

by stof at 2011/07/26 11:03:04 -0700

@fabpot what do you think ?

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

by stof at 2011/09/04 01:28:48 -0700

@fabpot what do you think about the place where this should be done ?
2011-09-06 07:53:28 +02:00
Fabien Potencier
ed472d36b7 merged branch alexandresalome/new-profiler-storage (PR #1772)
Commits
-------

9f0bd03 [HttpKernel] Update tests for FileProfilerStorage
b7032bc [HttpKernel] Update FileProfileStorage to search from EOF
188a5fa [HttpKernel] Override the existing tokens in FileProfilerStorage
b1b1424 [HttpKernel] Delete folders in the profiler cache
88bc3ec [HttpKernel] Fixes standards of FileProfilerStorage
affe66c Merge remote-tracking branch 'origin/master' into new-profiler-storage
ea916c3 [HttpKernel] Coding convention for the file profiler storage
9ae2c8d [HttpKernel] CS in file storage
b415efd [HttpKernel] Add a test for semicolon in file storage test
1c1215f [HttpKernel] Use subfolders for better storage in file storage of profiler
4b1dc1f [HttpKernel] Fix the folder attribute of file storage to private
70f73e1 [HttpKernel] Fix tests for the file storage of profiler
d5313d9 [HttpKernel] Add tests for the file profiler storage
09fc0a2 [HttpKernel] Add Symfony credits to the file storage class for the profiler
d1d5892 [HttpKernel] Finalize the file storage for the profiler
2f65cf2 Add POC for file storage system

Discussion
----------

[2.1] [HttpKernel] File storage for profiler

Symfony2 has some problems when dealing with multiple concurrency queries in the SQLite storage, resulting in a timeout error or terrible lack.

I've implemented after discussions with @fabpot a filesystem storage.

Enable it in your project with :

    framework:
        profiler:
          dsn:             "file:%kernel.cache_dir%/profiler"

I also studied the possibility to store only big data string in files and rest in the SQLite, but not concluant.

Results of my measures (4 concurrency, 120 total) :

* SQLite with data : 1057ms
* SQLite without data : 615ms
* MySQL : 40ms
* This File storage : 54ms

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

by alexandresalome at 2011/07/22 12:01:10 -0700

An idea for the find method : a csv file containing ip;url;token

The iteration could be done over a big file, without loading the whole file in memory.

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

by alexandresalome at 2011/07/23 14:22:32 -0700

OK new version, with as explained previously : a CSV file containing the index + file for each profile.

The speed is similar to the speed of MySQL, and no memory overhead should occur with this solution.

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

by alexandresalome at 2011/07/23 14:37:14 -0700

Hm... Created tests, duplicated from SqliteProfilerStorageTest.

Any idea on how to put this code in common ? Is it usual to create a base class for 2 tests ?

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

by alexandresalome at 2011/07/23 14:48:39 -0700

Just tested with 24.000 requests, the 24.001'th request still takes less than 50ms to execute.

The index file is about 2Mb, and iterating the whole file is fast.

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

by alexandresalome at 2011/07/23 14:53:19 -0700

I've filled the file with 120Mb of data, requests are still less than 50ms for executing.

Iterating the index takes more than 30s (so it crashed), but it's because of the amount of lines. 30 seconds = 1,400,000 lines in this computer. The file = 1,500,000 lines

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

by alexandresalome at 2011/07/23 14:56:54 -0700

I've tested it with Linux, is someone can test with Windows

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

by stloyd at 2011/07/24 00:32:32 -0700

IMO to speedup it a bit more and not end up with "crash" (to not end with "limit" of files per directory, also to many files in dir slow down every OS) you should use same method to write as Twig, split up files in to directories. If you do this you can speed up index more, because you can create smaller one per directory.

Also you should fix CS (coding standards).

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

by stloyd at 2011/07/24 02:10:20 -0700

Tested on Win 7, seems ok. Similar speed to sqlite, dunno why ;-) but used a bit less of memory.

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

by alexandresalome at 2011/07/24 02:13:21 -0700

Did you tried with concurrent requests ? It makes sense when you use assetic
and your browser hits the application 4 times simultaneously for CSS
generation

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

by alexandresalome at 2011/07/24 02:17:23 -0700

I used Apache Benchmark for producing results :

    ab -c 4 -n 120 URL

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

by alexandresalome at 2011/07/24 02:56:55 -0700

OK I used subfolders, based on last characters (because the first part of token is mostly the same between queries.

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

by stof at 2011/09/04 01:27:15 -0700

@fabpot any news about it ? Can it be merged ?
2011-09-06 07:45:55 +02:00
stealth35
dea46c721f [Translation] support CsvDumper
[Translation] support CsvDumper
[Translation] support CsvDumper
[Translation] support CsvDumper
[Translation] support CsvDumper
2011-09-05 13:14:52 +02:00
Benjamin Eberlei
4ac380e016 Adjust QtTranslations patch and include QtTranslationsDumper + test aswell 2011-09-04 20:43:59 +02:00
Benjamin Eberlei
21b29c201b Merge symfony/master 2011-09-04 20:25:40 +02:00
Benjamin Dulau
135531a2de Replaced setExpectedException() methods by annotations 2011-09-04 17:45:31 +02:00
Benjamin Dulau
6ad83e7970 Updated according to PR review 2011-09-04 17:45:25 +02:00
Benjamin Dulau
2de243cf07 * Added Fixtures 2x2px test.gif image file
* Updated tests for using fixture image instead of imagecreate function
2011-09-04 17:28:52 +02:00
Benjamin Dulau
a5a2dfaaa6 [ImageValidator] Added dedicated ImageValidator class with min width, max width, min height and max height validations 2011-09-04 17:28:46 +02:00
Wouter Van Hecke
41b7a194d5 Updated the tests so that tests will be marked as skipped when there is no MongoDB server present! 2011-09-04 16:56:09 +02:00
Fabien Potencier
dccd2d560f [HttpFoundation] implemented RFC6266 (Content-Disposition header)
references:

 * http://trac.tools.ietf.org/wg/httpbis/trac/wiki/ContentDispositionProducerAdvice
 * https://github.com/mnot/sweet/blob/master/lib/index.js
 * http://www.mnot.net/blog/2011/09/02/rfc6266_and_content-disposition
2011-09-04 09:35:13 +02:00
Fabien Potencier
e7b2d2d659 merged 2.0 branch 2011-09-04 09:28:37 +02:00
Fabien Potencier
6677dabda5 merged branch jmikola/entity-validator (PR #2076)
Commits
-------

d19f1d7 [Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results

Discussion
----------

[Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results

An entity should only be considered unique if its search criteria returns no matches or a single, identical entity. Multiple results indicates that conflicting entities exist.

Note: the DoctrineMongoDBBundle's unique validator checks identifier values if the object strict-equality check is false. This may be a worthwhile improvement, as it would prevent reporting a validation error for an enttiy which is going to overwrite its conflicting counter-part in the database.

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

by jmikola at 2011/09/01 14:23:27 -0700

This is the Doctrine bridge equivalent for my fix to DoctrineMongoDBBundle: https://github.com/symfony/DoctrineMongoDBBundle/pull/42

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

by fabpot at 2011/09/02 00:13:52 -0700

As this is a bug fix, can you base your PR on the symfony/2.0 branch? Thanks.
2011-09-02 09:43:19 +02:00
Fabien Potencier
adb7291b67 Merge branch 'EvanK-patch-1' into 2.0
* EvanK-patch-1:
  Per the [documentation][1], the `NotBlank` constraint should be using the `empty` language construct, otherwise it will not trigger on, for example, a boolean false from an unchecked checkbox field.
2011-09-02 09:39:11 +02:00
Evan Kaufman
639513a67a Per the [documentation][1], the NotBlank constraint should be using the empty language construct, otherwise it will not trigger on, for example, a boolean false from an unchecked checkbox field.
[1]: http://symfony.com/doc/2.0/reference/constraints/NotBlank.html
2011-09-02 09:37:48 +02:00
Jeremy Mikola
d19f1d7621 [Doctrine] Fix UniqueEntityValidator reporting a false positive by ignoring multiple query results
An entity should only be considered unique if its search criteria returns no matches or a single, identical entity. Multiple results indicates that conflicting entities exist.
2011-09-01 17:20:30 -04:00
Fabien Potencier
74a77af694 merged branch stealth35/mime_wildcard (PR #2075)
Commits
-------

5a47010 [Validator] FileValidator allow MIME with wildcard

Discussion
----------

[Validator] FileValidator allow MIME with wildcard

 - Allow MIME with wildcard like `image/*`
 - Image constraint use wildcard mime

(squash failed sorry #2068)
2011-09-01 16:19:23 +02:00
stealth35
5a470103f0 [Validator] FileValidator allow MIME with wildcard 2011-09-01 16:10:16 +02:00
Fabien Potencier
bddcb4cc11 fixed a unit test 2011-09-01 11:05:39 +02:00
Tom Klingenberg
e991c595b8 [Console] Improved checks for InputArgument and InputOption constructor's $mode parameter.
Check that $mode in InputArgument::__construct() is not below 1 to actually look if any of the flags are set.
Check that $mode in InputOption::__construct() is not below 1 to actually look if any of the flags are set.
Check for the correct parameter type, as in InputOption (integer).
InputArgumentTest: Added test for negative integer $mode parameter input in constructor.
InputOptionTest: Added test for negative integer $mode parameter input in constructor.
2011-08-31 23:53:00 +02:00
Fabien Potencier
946ccb6bd2 [Routing] fixed annotation loaders for abstract classes, added more unit tests 2011-08-30 20:57:43 +02:00
Fabien Potencier
93ea745397 merged branch henrikbjorn/autoload (PR #1857)
Commits
-------

ae3b128 [ClassLoader] Support for autoloading include_path incl. tests.

Discussion
----------

Autoload

GH Issue #1823

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

by stof at 2011/07/29 00:42:10 -0700

note that another fix was proposed in #1852 but this implementation is cleaner IMO

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

by henrikbjorn at 2011/08/12 01:57:45 -0700

@fabpot @stof any suggestions? need this kind of badly

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

by stof at 2011/08/12 02:06:54 -0700

for me it is fine. I guess you need to wait the end of @fabpot's holydays to see it merged.

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

by henrikbjorn at 2011/08/25 02:24:13 -0700

Added tests in the hope it will make it in soon :)

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

by henrikbjorn at 2011/08/29 03:31:08 -0700

Any other requests / suggestions ?

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

by stof at 2011/08/29 03:36:15 -0700

could you rebase the PR ? Github says that it conflicts.

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

by henrikbjorn at 2011/08/29 04:11:43 -0700

Should be rebased now or that is what git cli says :)

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

by henrikbjorn at 2011/08/29 04:16:28 -0700

And squashed.
2011-08-29 15:37:03 +02:00
alexandresalome
9f0bd0325b [HttpKernel] Update tests for FileProfilerStorage 2011-08-29 15:35:28 +02:00
Fabien Potencier
6b09498248 [Translation] simplified tests 2011-08-29 15:30:52 +02:00
Michel Salib
6278fcb306 -- add dumpers for translation component
-- update license and phpDoc

-- fix CS

-- remove pot file loader

-- add unit tests
2011-08-29 14:06:21 +02:00
alexandresalome
affe66c949 Merge remote-tracking branch 'origin/master' into new-profiler-storage 2011-08-29 13:44:52 +02:00
Henrik Bjørnskov
ae3b12801f [ClassLoader] Support for autoloading include_path incl. tests. 2011-08-29 13:15:35 +02:00
Fabien Potencier
34c1868a91 merged branch stloyd/tests_fix (PR #1860)
Commits
-------

838237d [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull"

Discussion
----------

[2.1][Tests] Use proper phpunit assertion functions

Use proper phpunit assertion functions: `assertTrue()`, `assertFalse()`, `assertNull()`.
2011-08-27 08:01:17 +02:00
Fabien Potencier
2ccee10c51 merged branch stealth35/mime_guesser (PR #1874)
Commits
-------

ea0db2d [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser

Discussion
----------

[2.1] [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser

`mime_content_type` exists just for the compat between the old PHP 5.2
`mime_magic` extension and `file_info` extension

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

by fabpot at 2011/08/19 05:31:25 -0700

I will merge it in 2.1 as some people might rely on it.

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

by stealth35 at 2011/08/19 05:46:02 -0700

ok in the meantime, we can invert the guesser checker :

```php
/**
 * Registers all natively provided mime type guessers
 */
private function __construct()
{
    if (FileBinaryMimeTypeGuesser::isSupported()) {
        $this->register(new FileBinaryMimeTypeGuesser());
    }

    if (FileinfoMimeTypeGuesser::isSupported()) {
        $this->register(new FileinfoMimeTypeGuesser());
    }

    if (ContentTypeMimeTypeGuesser::isSupported()) {
        $this->register(new ContentTypeMimeTypeGuesser());
    }
}
```

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

by stloyd at 2011/08/19 05:48:38 -0700

@stealth35 You should make new PR for change you mentioned above.

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

by stealth35 at 2011/08/19 05:53:12 -0700

@stloyd done PR #1989

EDIT : forget this
2011-08-26 17:49:56 +02:00
Daniel Holmes
777f876b90 [HttpFoundation] Added test that exposes error in session saving 2011-08-26 20:00:57 +10:00
Fabien Potencier
8f50592f31 [HttpFoundation] changed \LogicException to \InvalidArgumentException 2011-08-26 08:45:12 +02:00
stloyd
838237dc32 [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull" 2011-08-25 15:41:15 +02:00
Fabien Potencier
1c7694ff30 [HttpFoundation] added a missing exception 2011-08-25 10:38:08 +02:00
Fabien Potencier
a79f22544e [HttpKernel] added a test for uploading a file via an array instead of an UploadedFile instance 2011-08-25 10:07:28 +02:00
Jeremy Mikola
39fabab013 [EventDispatcher] Fix removeSubscriber() to work with priority syntax 2011-08-23 16:41:08 -04:00
Fabien Potencier
3380f2a039 [DomCrawler] fixed disabled fields in forms (they are available in the DOM, but their values are not submitted -- whereas before, they were simply removed from the DOM) 2011-08-23 11:21:48 +02:00
Fabien Potencier
277d75b7ce [Security] added a unit test for previous merge 2011-08-23 08:52:50 +02:00
Fabien Potencier
0b531932a0 merged branch stloyd/issue_1986 (PR #2000)
Commits
-------

c29fa9d [Form] Fix for treatment zero as empty data. Closes #1986

Discussion
----------

[Form] Fix for treatment zero as empty data. Closes #1986

For more info please read #1986.
2011-08-23 08:44:09 +02:00
Fabien Potencier
2b1bb2c357 [Form] added missing DelegatingValidator registration in the Form Extension class (used when using the Form component outside a Symfony2 project where the validation.xml is used instead) 2011-08-22 22:35:46 +02:00
stloyd
933c5aa771 [Tests] Added missing test for NumberType 2011-08-22 15:23:00 +02:00
stloyd
c29fa9d64e [Form] Fix for treatment zero as empty data. Closes #1986 2011-08-22 15:19:31 +02:00
Fabien Potencier
b66eb4db57 merged branch stloyd/form_datetime_transformer (PR #1851)
Commits
-------

d880db2 [Form] Test covered fix for invalid date (13 month/31.02.2011 etc.) send to transformer. Closes #1755
df74f49 Patched src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php to throw an exception when an invalid date is passed for transformation (e.g. 31st February)

Discussion
----------

[Form] Fix for "DateTimeToArrayTransformer" with invalid dates

Hey,

this is test covered fix from @mdavis1982 (closes #1755)

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

by stloyd at 2011/08/16 01:31:32 -0700

@fabpot Can we have this fix merged ?
2011-08-19 14:26:00 +02:00
Fabien Potencier
95719e78ad merged branch schmittjoh/requestMethodOverrideFix (PR #1980)
Commits
-------

a1d9fed updated tests
b6ee1a6 fixes a bug when overriding method via the X-HTTP-METHOD-OVERRIDE header

Discussion
----------

Request method override fix
2011-08-19 14:13:57 +02:00
Fabien Potencier
46bbfff336 merged branch lsmith77/create_from_globals_tests (PR #1983)
Commits
-------

8c9ccf6 added more tests for Request::createFromGlobals()

Discussion
----------

added more tests for Request::createFromGlobals()
2011-08-18 19:44:05 +02:00
Lukas Kahwe Smith
8c9ccf6bc2 added more tests for Request::createFromGlobals() 2011-08-18 19:10:51 +02:00
Johannes Schmitt
a1d9fed988 updated tests 2011-08-18 12:19:27 +02:00
Victor Berchet
1518a81ea7 [HttpKernel] Simplify test code 2011-08-18 09:32:26 +02:00
Fabien Potencier
0b5d87d484 [HttpFoundation] fixed a unit tests 2011-08-14 10:56:48 +02:00
Alexey Popkov
81fb8e16e7 [DomCrawler] fix finding charset in addContent 2011-08-10 13:41:07 +04:00
Fabien Potencier
9fd6b3c021 merged branch stloyd/console_fixtures (PR #1915)
Commits
-------

9f66263 [Console] Fix fixtures from failing tests

Discussion
----------

[Console] Fix fixtures from failing tests
2011-08-08 23:21:52 +02:00
Fabien Potencier
be031f54a1 [HttpKernel] fixed ControllerResolver when the controller is a class name with an __invoke() method 2011-08-08 23:20:03 +02:00
stloyd
9f662634fe [Console] Fix fixtures from failing tests 2011-08-07 10:00:06 +02:00
stealth35
ea0db2d6f4 [HttpFoundation] Remove useless ContentTypeMimeTypeGuesser
mime_content_type exists just for the compat between the old PHP 5.2
mime_magic extension and file_info extension
2011-07-31 14:07:00 +02:00
stloyd
d880db2791 [Form] Test covered fix for invalid date (13 month/31.02.2011 etc.) send to transformer. Closes #1755 2011-07-28 12:16:58 +02:00
Fabien Potencier
8700cd6154 fixed CS 2011-07-27 08:27:46 +02:00
Fabien Potencier
422522bcf8 merged branch aboks/mimetype_test (PR #1775)
Commits
-------

1283c47 [HttpFoundation] Fixed incorrect test; MimeTypeGuesser should be (and is) able to detect a path that is not a file also without the 'fileinfo' extension

Discussion
----------

[HttpFoundation] Fixed incorrect test when 'fileinfo' extension is not enabled

This test failed on my box with `fileinfo` disabled. The `FileNotFoundException` is thrown also when the `fileinfo`-extension is not enabled, so it should be expected.
2011-07-27 08:24:12 +02:00
Fabien Potencier
de9f8ab47e added a unit test for previous merge 2011-07-27 08:00:56 +02:00
Fabien Potencier
c6308a5daf merged branch stof/trans_locale (PR #1808)
Commits
-------

85c0087 [TwigBridge] Made the locale configurable for the trans and transchoice tags
3ea31a0 [TwigBridge] Made the locale configurable for the trans and transchoice filters

Discussion
----------

Trans locale

This allows setting the locale when translating in a Twig template. This was already allowed in the Translator and in the PHP templates
2011-07-27 07:44:42 +02:00
Fabien Potencier
853935fbab [HttpFoundation] made PHP_AUTH_PW optional 2011-07-26 09:32:45 +02:00
Fabien Potencier
acd9d09ada [HttpKernerl] fixed some unit tests 2011-07-26 09:28:27 +02:00
Fabien Potencier
91a41020a8 merged branch sasezaki/BrowserKit_useragent (PR #1789)
Commits
-------

266e60e Don't tell a lie to every WebServers

Discussion
----------

Please don't tell a lie to every WebServers

Fake Useragent name should be only in test case .
2011-07-26 09:21:10 +02:00
Christophe Coevoet
85c0087825 [TwigBridge] Made the locale configurable for the trans and transchoice tags 2011-07-26 01:27:09 +02:00
Christophe Coevoet
3ea31a0263 [TwigBridge] Made the locale configurable for the trans and transchoice filters 2011-07-26 01:25:25 +02:00
Johannes Schmitt
0b3ff39704 fix supported cookie date formats 2011-07-24 21:28:31 +02:00
alexandresalome
b415efd395 [HttpKernel] Add a test for semicolon in file storage test 2011-07-24 11:54:46 +02:00
alexandresalome
1c1215fdce [HttpKernel] Use subfolders for better storage in file storage of profiler 2011-07-24 11:52:27 +02:00
sasezaki
266e60e7a2 Don't tell a lie to every WebServers 2011-07-24 14:01:26 +09:00
alexandresalome
d5313d9778 [HttpKernel] Add tests for the file profiler storage 2011-07-23 23:33:51 +02:00
Wouter Van Hecke
00fdfec860 Added a MongoDbProfilerStorage engine 2011-07-23 20:05:48 +02:00
Arnout Boks
0635548800 [Process] Fixed tests on Windows by using escapeshellarg to escape argument 2011-07-23 18:13:57 +02:00
Fabien Potencier
d236fc3662 merged branch aboks/icu_version (PR #1776)
Commits
-------

86aeb04 [Form] Added skip for tests that require a higher version of the ICU library (needed by intl) than installed

Discussion
----------

[Form] Skip tests that are incompatible with the installed ICU (intl) library

Two tests for the `DateTimeToLocalizedStringTransformer` depend on a datetime-format that has only been added in version 3.8 of the ICU library (used by `intl`), see http://bugs.icu-project.org/trac/changeset/21815#file60. Some PHP-versions still ship with ICU 3.6 however.

This PR skips these tests when an incompatible version of the ICU library is detected. Unfortunately I had to copy-paste some code from `Symfony\Tests\Component\Locale\TestCase`, but I don't see any other way without creating a strange dependency between the tests for the Form and Locale components.

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

by Abhoryo at 2011/07/22 16:42:40 -0700

PHP 5.3.5 = ICU 3.6
PHP 5.3.6 = ICU 3.8
PHP 5.3.7rc4 = ICU 4.6

Since the RC3 of Symfony, config/check script recommends ICU 4.0+

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

by aboks at 2011/07/23 00:33:12 -0700

I noticed, but since it's not a hard requirement (and difficult for some people to install ICU 4.0+ at the moment) this PR would at least prevent false positives when people unable to upgrade run the test suite.
2011-07-23 16:15:26 +02:00
Fabien Potencier
9d3700427a merged branch aboks/console_test_decoration (PR #1774)
Commits
-------

04d0b6c [Console] Forced undecorated output in tests that rely on Application/Command-output being equal to a fixed value

Discussion
----------

[Console] Fixed tests that rely on undecorated Application/Command-output

Some tests compare the output of an `Application`/`Command` run to a fixed string. The output is decorated however (at least) when run on a Windows box with Ansicon installed.
This PR fixes these failing tests by forcing the `Application`/`Command`-output to be undecorated.
2011-07-23 16:13:19 +02:00
Arnout Boks
1283c47f98 [HttpFoundation] Fixed incorrect test; MimeTypeGuesser should be (and is) able to detect a path that is not a file also without the 'fileinfo' extension 2011-07-22 22:19:09 +02:00
Arnout Boks
86aeb042a1 [Form] Added skip for tests that require a higher version of the ICU library (needed by intl) than installed 2011-07-22 22:16:48 +02:00
Fabien Potencier
18894762ee merged branch ericclemmons/fix-router-generator-empty-query-string (PR #1773)
Commits
-------

03c7cfe UrlGenerator no longer appends '?' if query string is empty

Discussion
----------

UrlGenerator no longer appends '?' if query string is empty

If you generate a URL using null parameters (`array('foo' => null, 'bar' => null')`), `http_build_query` returns an empty string, resulting in a trailing `?` at the end of the generated URL.

This fixes that so that, if there are `$extra` params & `http_build_query` is empty, the URL is no longer appended.

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

by fabpot at 2011/07/22 10:15:26 -0700

Can you add unit tests?

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

by ericclemmons at 2011/07/22 10:52:21 -0700

Yes sir, will do.

-Eric Clemmons
 Sent from my iPad Nano

On Jul 22, 2011, at 12:15 PM, fabpot<reply@reply.github.com> wrote:

> Can you add unit tests?
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1773#issuecomment-1633515

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

by ericclemmons at 2011/07/22 11:55:30 -0700

**Added passing test.**

Currently `master` fails test:

```
1) Symfony\Tests\Component\Routing\Generator\UrlGeneratorTest::testUrlWithNullExtraParameters
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-http://localhost/app.php/testing
+http://localhost/app.php/testing?

//tests/Symfony/Tests/Component/Routing/Generator/UrlGeneratorTest.php:114
```
2011-07-22 22:00:27 +02:00
Arnout Boks
04d0b6c821 [Console] Forced undecorated output in tests that rely on Application/Command-output being equal to a fixed value 2011-07-22 21:06:35 +02:00
Eric Clemmons
03c7cfed5e UrlGenerator no longer appends '?' if query string is empty 2011-07-22 11:53:54 -07:00
Fabien Potencier
e9d82506f7 merged branch marcw/revert-1758 (PR #1769)
Commits
-------

d43d621 [Form] Reverted PR #1758.

Discussion
----------

[Form] Reverted PR #1758.

Revert "[Form] CollectionType now checks for data_class parameter instead of only class."

This reverts commit 2e024f87a3.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php

Revert "[Form] Added ObjectFactoryListener. Fixes #1746."

This reverts commit 0327beb0b9.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
2011-07-22 17:43:42 +02:00
marc.weistroff
d43d621829 [Form] Reverted PR #1758.
Revert "[Form] CollectionType now checks for data_class parameter instead of only class."

This reverts commit 2e024f87a3.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php

Revert "[Form] Added ObjectFactoryListener. Fixes #1746."

This reverts commit 0327beb0b9.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
2011-07-22 16:42:50 +02:00
Fabien Potencier
aab0bf7e2c merged branch schmittjoh/httpUtilFixes (PR #1739)
Commits
-------

eae6a77 fixed wrong case
d0a175b fixes #1659
f300ede fixes several bugs
a4f05ac added some tests

Discussion
----------

Http util fixes

Fixes several bugs in the http utils.

Please don't add anymore features without sufficient tests. Especially for the Security\Http namespace, regressions are very likely otherwise.

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

by fabpot at 2011/07/19 22:37:26 -0700

Tests do not pass for me:

    There were 2 errors:

    1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #0 ('en')
    InvalidArgumentException: The current node list is empty.

    .../src/Symfony/Component/DomCrawler/Crawler.php:604
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16

    2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #1 ('de')
    InvalidArgumentException: The current node list is empty.

    .../src/Symfony/Component/DomCrawler/Crawler.php:604
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16

    --

    There were 4 failures:

    1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #0 ('en')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -http://localhost/en/login
    +http://localhost/login

    .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38

    2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #1 ('de')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -http://localhost/de/login
    +http://localhost/login

    .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38

    3) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #0 ('en')
    HTTP/1.0 302 Found
    Cache-Control:  no-cache
    Content-Length: 299
    Content-Type:   text/html; charset=UTF-8
    Date:           Wed, 20 Jul 2011 05:36:27 GMT
    Location:       http://localhost/login
    Set-Cookie: PHPSESSID=11c9c6a7e7620e13bddef223a5ba46d9; path=/; domain=

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>
    Failed asserting that <integer:0> matches expected <integer:1>.

    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50

    4) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #1 ('de')
    HTTP/1.0 302 Found
    Cache-Control:  no-cache
    Content-Length: 299
    Content-Type:   text/html; charset=UTF-8
    Date:           Wed, 20 Jul 2011 05:36:28 GMT
    Location:       http://localhost/login
    Set-Cookie: PHPSESSID=2bbe63786a088471ade3717917f4ba4f; path=/; domain=

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>
    Failed asserting that <integer:0> matches expected <integer:1>.

    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50

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

by schmittjoh at 2011/07/19 23:47:29 -0700

I fixed a wrong case, but I couldn't reproduce the other errors (tested on Ubuntu).

My guess is that the temporary directory on your machine couldn't be deleted for some reason, and the test runs with the configuration of some of the previous tests.

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

by fabpot at 2011/07/20 00:28:41 -0700

That does not make any difference for me. For instance, in `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request to `'/'.$locale.'/login'` returns the following Response:

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>

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

by schmittjoh at 2011/07/20 00:31:34 -0700

That's weird, did you make sure that the temporary directory does not exist?

``rm -Rf /tmp/StandardFormLogin/``

On Wed, Jul 20, 2011 at 9:28 AM, fabpot <
reply@reply.github.com>wrote:

> That does not make any difference for me. For instance, in
> `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request
> to `'/'.$locale.'/login'` returns the following Response:
>
>    <html>
>        <head>
>            <meta http-equiv="Content-Type" content="text/html;
> charset=utf-8" />
>            <meta http-equiv="refresh" content="1;url=
> http://localhost/login" />
>        </head>
>        <body>
>            Redirecting to <a href="http://localhost/login">
> http://localhost/login</a>.
>        </body>
>    </html>
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1739#issuecomment-1613504
>

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

by fabpot at 2011/07/20 00:33:40 -0700

Yes, I've just checked and the directory does not exist.

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

by schmittjoh at 2011/07/20 00:39:55 -0700

Sorry, I can't reproduce it on Ubuntu and unless someone wants to sponsor me a Mac, there is not much I can do.
2011-07-22 14:45:54 +02:00
Fabien Potencier
c6115cee7f [BrowserKit] changed Cookie::fromString() to not take the secure setting into account if the URL is not present or is not HTTPS 2011-07-22 13:29:57 +02:00
marc.weistroff
257f86cb20 [Form] Collection's prototype is not not a child anymore. 2011-07-22 11:03:06 +02:00
marc.weistroff
2b4cc9bd06 [Form] Changed collection prototype rendering.
Based on PR 1500. It is now rendered inside an attribute of collection
tag.
2011-07-22 11:01:55 +02:00
marc.weistroff
2e024f87a3 [Form] CollectionType now checks for data_class parameter instead of only class. 2011-07-21 19:50:40 +02:00
marc.weistroff
0327beb0b9 [Form] Added ObjectFactoryListener. Fixes #1746. 2011-07-21 15:02:52 +02:00
Fabien Potencier
e42a2dede1 [Validator] fixed unit tests when intl is not installed 2011-07-20 14:45:35 +02:00
Fabien Potencier
e5fa78af31 [Form] fixed unit tests when intl is not installed 2011-07-20 14:36:55 +02:00
Fabien Potencier
9e7cb0a020 [Routing] fixed default value for Routes as they can be anything if they don't need to be used as default values for placeholders 2011-07-19 19:18:29 +02:00
Johannes Schmitt
f300edebe4 fixes several bugs 2011-07-19 16:21:58 +02:00
Fabien Potencier
d6cbbdd26c merged branch meckhardt/create-request-with-empty-path (PR #1736)
Commits
-------

95011ce [HttpFoundation] Fixed creation of requests without a path.

Discussion
----------

[HttpFoundation] Fixed creation of requests without a path.

Providing urls with no path led to php warning that the index 'path' is
not set. This patch initializes 'path' if no path is set.
2011-07-19 11:52:50 +02:00
Martin Eckhardt
95011ce4b7 [HttpFoundation] Fixed creation of requests without a path.
Providing urls with no path led to php warning that the index 'path' is
not set. This patch initializes 'path' if no path is set.
2011-07-19 10:54:21 +02:00