This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component
Fabien Potencier 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
..
BrowserKit merged branch sasezaki/BrowserKit_useragent (PR #1789) 2011-07-26 09:21:10 +02:00
ClassLoader fixed CS 2011-06-08 19:56:59 +02:00
Config [Config] fixed a unit test 2011-07-01 10:15:26 +02:00
Console [Console] Fix fixtures from failing tests 2011-08-07 10:00:06 +02:00
CssSelector UnitTest 2011-06-29 18:22:32 +02:00
DependencyInjection Removed executable bits from all php files 2011-09-09 15:16:17 +02:00
DomCrawler [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
EventDispatcher [EventDispatcher] Fix removeSubscriber() to work with priority syntax 2011-08-23 16:41:08 -04:00
Finder [Finder] added a convenience method Finder::create() 2011-06-14 14:18:24 +02:00
Form [Form] fixed error bubbling for Date and Time types when rendering as multiple choices (closes #2062) 2011-09-14 08:30:47 +02:00
HttpFoundation [HttpFoundation] Added test that exposes error in session saving 2011-08-26 20:00:57 +10:00
HttpKernel [HttpKernel] added a test for uploading a file via an array instead of an UploadedFile instance 2011-08-25 10:07:28 +02:00
Locale merged branch stealth35/master (PR #1346) 2011-06-16 15:07:27 +02:00
Process [Process] Fixed tests on Windows by using escapeshellarg to escape argument 2011-07-23 18:13:57 +02:00
Routing [Routing] fixed annotation loaders for abstract classes, added more unit tests 2011-08-30 20:57:43 +02:00
Security Removed executable bits from all php files 2011-09-09 15:16:17 +02:00
Serializer fix tests 2011-06-10 01:11:51 +02:00
Templating fixed CS 2011-06-23 13:39:36 +02:00
Translation fixed CS 2011-06-08 19:56:59 +02:00
Validator Removed executable bits from all php files 2011-09-09 15:16:17 +02:00
Yaml merged branch jmikola/yaml-numeric-strings (PR #1688) 2011-07-15 08:39:27 +02:00