From b482fb784e8cc262e919fe2079d59efedea43dad Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Wed, 21 Sep 2016 12:17:18 +0100 Subject: [PATCH 1/6] [HttpFoundation] Enable memcached tests with the latest memcached extension --- .../Session/Storage/Handler/MemcachedSessionHandlerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php index 75e4a20e2a..bd023ed165 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php @@ -37,8 +37,8 @@ class MemcachedSessionHandlerTest extends \PHPUnit_Framework_TestCase parent::setUp(); - if (version_compare(phpversion('memcached'), '2.2.0', '>=')) { - $this->markTestSkipped('Tests can only be run with memcached extension 2.1.0 or lower'); + if (version_compare(phpversion('memcached'), '2.2.0', '>=') && version_compare(phpversion('memcached'), '3.0.0b1', '<')) { + $this->markTestSkipped('Tests can only be run with memcached extension 2.1.0 or lower, or 3.0.0b1 or higher'); } $this->memcached = $this->getMock('Memcached'); From 042cb6b2b2f0c7703f7782e1389f57919aed2dc0 Mon Sep 17 00:00:00 2001 From: "Konstantin.Myakshin" Date: Wed, 21 Sep 2016 18:21:51 +0300 Subject: [PATCH 2/6] Fixed regression when exception message swallowed when logging it. --- .../HttpKernel/DataCollector/LoggerDataCollector.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php index 6664a33737..79568d618c 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php @@ -147,6 +147,10 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte } if (is_object($context)) { + if ($context instanceof \Exception) { + return sprintf('Exception(%s): %s', get_class($context), $context->getMessage()); + } + return sprintf('Object(%s)', get_class($context)); } From 3693e8368f1dcc8261a0065c3effbd2342fa39a6 Mon Sep 17 00:00:00 2001 From: "Konstantin.Myakshin" Date: Wed, 21 Sep 2016 18:44:25 +0300 Subject: [PATCH 3/6] Use UUID for error codes for Form validator. --- .../Component/Form/Extension/Validator/Constraints/Form.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php index e2751e5bc8..439eb124f0 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php @@ -18,14 +18,14 @@ use Symfony\Component\Validator\Constraint; */ class Form extends Constraint { - const NOT_SYNCHRONIZED_ERROR = 1; - const NO_SUCH_FIELD_ERROR = 2; + const NOT_SYNCHRONIZED_ERROR = '1dafa156-89e1-4736-b832-419c2e501fca'; + const NO_SUCH_FIELD_ERROR = '6e5212ed-a197-4339-99aa-5654798a4854'; /** * @deprecated since version 2.6, to be removed in 3.0. * Use {@self NOT_SYNCHRONIZED_ERROR} instead. */ - const ERR_INVALID = 1; + const ERR_INVALID = self::NOT_SYNCHRONIZED_ERROR; protected static $errorNames = array( self::NOT_SYNCHRONIZED_ERROR => 'NOT_SYNCHRONIZED_ERROR', From 6dbb186f23a82b2a67acdd96ea49d3623003a900 Mon Sep 17 00:00:00 2001 From: "Konstantin.Myakshin" Date: Wed, 21 Sep 2016 18:44:25 +0300 Subject: [PATCH 4/6] Use UUID for error codes for Form validator. --- .../Component/Form/Extension/Validator/Constraints/Form.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php index e2751e5bc8..439eb124f0 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php @@ -18,14 +18,14 @@ use Symfony\Component\Validator\Constraint; */ class Form extends Constraint { - const NOT_SYNCHRONIZED_ERROR = 1; - const NO_SUCH_FIELD_ERROR = 2; + const NOT_SYNCHRONIZED_ERROR = '1dafa156-89e1-4736-b832-419c2e501fca'; + const NO_SUCH_FIELD_ERROR = '6e5212ed-a197-4339-99aa-5654798a4854'; /** * @deprecated since version 2.6, to be removed in 3.0. * Use {@self NOT_SYNCHRONIZED_ERROR} instead. */ - const ERR_INVALID = 1; + const ERR_INVALID = self::NOT_SYNCHRONIZED_ERROR; protected static $errorNames = array( self::NOT_SYNCHRONIZED_ERROR => 'NOT_SYNCHRONIZED_ERROR', From bb51ed0d20ad3585a40df7dcba9ff9f6752b110c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 21 Sep 2016 12:03:56 -0700 Subject: [PATCH 5/6] Revert "minor #20011 Use UUID for error codes for Form validator. (Koc)" This reverts commit 2cd45a5043ccb9c5795d4f6b81943fcaffcaa548, reversing changes made to d8423071deedf3a6026e3f2e8a3187063cc80a59. --- .../Component/Form/Extension/Validator/Constraints/Form.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php index 439eb124f0..e2751e5bc8 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php @@ -18,14 +18,14 @@ use Symfony\Component\Validator\Constraint; */ class Form extends Constraint { - const NOT_SYNCHRONIZED_ERROR = '1dafa156-89e1-4736-b832-419c2e501fca'; - const NO_SUCH_FIELD_ERROR = '6e5212ed-a197-4339-99aa-5654798a4854'; + const NOT_SYNCHRONIZED_ERROR = 1; + const NO_SUCH_FIELD_ERROR = 2; /** * @deprecated since version 2.6, to be removed in 3.0. * Use {@self NOT_SYNCHRONIZED_ERROR} instead. */ - const ERR_INVALID = self::NOT_SYNCHRONIZED_ERROR; + const ERR_INVALID = 1; protected static $errorNames = array( self::NOT_SYNCHRONIZED_ERROR => 'NOT_SYNCHRONIZED_ERROR', From ae118e78856271fdf596b0b10a9718e94e5ee301 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 21 Sep 2016 22:46:44 +0200 Subject: [PATCH 6/6] [VarDumper] Fix test --- src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php b/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php index 77da42f6d7..f25aac6553 100644 --- a/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php +++ b/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php @@ -31,9 +31,9 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends Twig_Template public function getSource() { - return ''; + return " foo bar + twig source + +"; } } -/* foo bar*/ -/* twig source*/ -/* */