diff --git a/CHANGELOG-4.0.md b/CHANGELOG-4.0.md index 9deacb4981..c3af769a41 100644 --- a/CHANGELOG-4.0.md +++ b/CHANGELOG-4.0.md @@ -7,6 +7,15 @@ in 4.0 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1 +* 4.0.6 (2018-03-05) + + * bug #26393 [DI] Skip resource tracking if disabled (chalasr) + * bug #26403 fix the handling of timestamp in the MongoDBSessionHandler (hjanuschka) + * bug #26355 [DI] Fix missing "id" normalization when dumping the container (nicolas-grekas) + * bug #26368 [WebProfilerBundle] Fix Debug toolbar breaks app (xkobal) + * bug #26369 Use fill instead of style for svg colors (rpkamp) + * bug #26358 [FrameworkBundle] Silence "Failed to remove directory" on cache:clear (nicolas-grekas) + * 4.0.5 (2018-03-01) * bug #26327 [Form][WCAG] Errors sign for people that do not see colors (Nyholm) diff --git a/src/Symfony/Bridge/PhpUnit/CoverageListener.php b/src/Symfony/Bridge/PhpUnit/CoverageListener.php index 79333fbd00..d41c26968f 100644 --- a/src/Symfony/Bridge/PhpUnit/CoverageListener.php +++ b/src/Symfony/Bridge/PhpUnit/CoverageListener.php @@ -18,3 +18,9 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve } else { class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV7', 'Symfony\Bridge\PhpUnit\CoverageListener'); } + +if (false) { + class CoverageListener + { + } +} diff --git a/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php b/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php index d46a79e00e..a753525b76 100644 --- a/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php +++ b/src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php @@ -18,3 +18,9 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve } else { class_alias('Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7', 'Symfony\Bridge\PhpUnit\SymfonyTestsListener'); } + +if (false) { + class SymfonyTestsListener + { + } +} diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index 2f97e32e11..a549cd7da4 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -26,8 +26,13 @@ if (PHP_VERSION_ID >= 70200) { $PHPUNIT_VERSION = '4.8'; } +if ('composer.json' !== $COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json') { + putenv('COMPOSER=composer.json'); + $_SERVER['COMPOSER'] = $_ENV['COMPOSER'] = 'composer.json'; +} + $root = __DIR__; -while (!file_exists($root.'/composer.json') || file_exists($root.'/DeprecationErrorHandler.php')) { +while (!file_exists($root.'/'.$COMPOSER_JSON) || file_exists($root.'/DeprecationErrorHandler.php')) { if ($root === dirname($root)) { break; } diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig index f0c4626daf..d6b08f7637 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig @@ -62,4 +62,4 @@ col-sm-10 {{- form_errors(form) -}} {#--#} -{%- endblock checkbox_row %} \ No newline at end of file +{%- endblock checkbox_row %} diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig index a3484d9036..2acd7086b0 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig @@ -203,7 +203,13 @@ {% set label = name|humanize %} {%- endif -%} {%- endif -%} - <{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{{- form_errors(form) -}}{{ element|default('label') }}> + <{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{% block form_label_errors %}{{- form_errors(form) -}}{% endblock form_label_errors %}{{ element|default('label') }}> + {%- else -%} + {%- if errors|length > 0 -%} +
{{ attribute.expression }}
+ {% elseif attribute.type == 'string' %}
+ {{ attribute }}
+ {% else %}
+ {{ profiler_dump(attribute) }}
+ {% endif %}
{% else %}
{{ profiler_dump(decision.attributes) }}
{% endif %}
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php
index 629ff18a0c..8d2e34aa20 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php
@@ -86,7 +86,7 @@ class UserPasswordEncoderCommandTest extends WebTestCase
$this->assertContains('Password encoding succeeded', $output);
$encoder = new Argon2iPasswordEncoder();
- preg_match('# Encoded password\s+(\$argon2id\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
+ preg_match('# Encoded password\s+(\$argon2id?\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
$hash = $matches[1];
$this->assertTrue($encoder->isPasswordValid($hash, 'password', null));
}
diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php
index 0beea40c4d..0f5c410a4b 100644
--- a/src/Symfony/Component/BrowserKit/Client.php
+++ b/src/Symfony/Component/BrowserKit/Client.php
@@ -79,7 +79,7 @@ abstract class Client
}
/**
- * Sets the maximum number of requests that crawler can follow.
+ * Sets the maximum number of redirects that crawler can follow.
*
* @param int $maxRedirects
*/
@@ -90,7 +90,7 @@ abstract class Client
}
/**
- * Returns the maximum number of requests that crawler can follow.
+ * Returns the maximum number of redirects that crawler can follow.
*
* @return int
*/
diff --git a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php
index c5b7abf896..bf8e5625ac 100644
--- a/src/Symfony/Component/Config/Resource/ReflectionClassResource.php
+++ b/src/Symfony/Component/Config/Resource/ReflectionClassResource.php
@@ -148,12 +148,16 @@ class ReflectionClassResource implements SelfCheckingResourceInterface, \Seriali
yield print_r($defaults, true);
}
- if ($class->isSubclassOf(EventSubscriberInterface::class)) {
+ if ($class->isAbstract() || $class->isInterface() || $class->isTrait()) {
+ return;
+ }
+
+ if (interface_exists(EventSubscriberInterface::class, false) && $class->isSubclassOf(EventSubscriberInterface::class)) {
yield EventSubscriberInterface::class;
yield print_r(\call_user_func(array($class->name, 'getSubscribedEvents')), true);
}
- if ($class->isSubclassOf(ServiceSubscriberInterface::class)) {
+ if (interface_exists(ServiceSubscriberInterface::class, false) && $class->isSubclassOf(ServiceSubscriberInterface::class)) {
yield ServiceSubscriberInterface::class;
yield print_r(\call_user_func(array($class->name, 'getSubscribedServices')), true);
}
diff --git a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
index 00a7901f3a..9d61c9cd83 100644
--- a/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
+++ b/src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php
@@ -55,7 +55,7 @@ class XmlUtilsTest extends TestCase
XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate'));
$this->fail();
} catch (\InvalidArgumentException $e) {
- $this->assertRegExp('/The XML file "[\w:\/\\\.-]+" is not valid\./', $e->getMessage());
+ $this->assertRegExp('/The XML file "[\w:\/\\\.~+-]+" is not valid\./', $e->getMessage());
}
$this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate')));
diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
index 5ece0fa4a5..9a109e8a1c 100644
--- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
@@ -935,9 +935,13 @@ EOF;
if (Container::class !== $baseClassWithNamespace) {
$r = $this->container->getReflectionClass($baseClassWithNamespace, false);
-
- if (null !== $r && (null !== $constructor = $r->getConstructor()) && 0 === $constructor->getNumberOfRequiredParameters()) {
- $code .= " parent::__construct();\n\n";
+ if (null !== $r
+ && (null !== $constructor = $r->getConstructor())
+ && 0 === $constructor->getNumberOfRequiredParameters()
+ && Container::class !== $constructor->getDeclaringClass()->name
+ ) {
+ $code .= " parent::__construct();\n";
+ $code .= " \$this->parameterBag = null;\n\n";
}
}
@@ -1619,7 +1623,7 @@ EOF;
private function dumpParameter(string $name): string
{
- if ($this->container->isCompiled() && $this->container->hasParameter($name)) {
+ if ($this->container->hasParameter($name)) {
$value = $this->container->getParameter($name);
$dumpedValue = $this->dumpValue($value, false);
diff --git a/src/Symfony/Component/DependencyInjection/Tests/EnvVarProcessorTest.php b/src/Symfony/Component/DependencyInjection/Tests/EnvVarProcessorTest.php
new file mode 100644
index 0000000000..b1ee044e9e
--- /dev/null
+++ b/src/Symfony/Component/DependencyInjection/Tests/EnvVarProcessorTest.php
@@ -0,0 +1,304 @@
+setParameter('env(foo)', $value);
+ $container->compile();
+
+ $processor = new EnvVarProcessor($container);
+
+ $result = $processor->getEnv('string', 'foo', function () {
+ $this->fail('Should not be called');
+ });
+
+ $this->assertSame($processed, $result);
+ }
+
+ public function validStrings()
+ {
+ return array(
+ array('hello', 'hello'),
+ array('true', 'true'),
+ array('false', 'false'),
+ array('null', 'null'),
+ array('1', '1'),
+ array('0', '0'),
+ array('1.1', '1.1'),
+ array('1e1', '1e1'),
+ );
+ }
+
+ /**
+ * @dataProvider validBools
+ */
+ public function testGetEnvBool($value, $processed)
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $result = $processor->getEnv('bool', 'foo', function ($name) use ($value) {
+ $this->assertSame('foo', $name);
+
+ return $value;
+ });
+
+ $this->assertSame($processed, $result);
+ }
+
+ public function validBools()
+ {
+ return array(
+ array('true', true),
+ array('false', false),
+ array('null', false),
+ array('1', true),
+ array('0', false),
+ array('1.1', true),
+ array('1e1', true),
+ );
+ }
+
+ /**
+ * @dataProvider validInts
+ */
+ public function testGetEnvInt($value, $processed)
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $result = $processor->getEnv('int', 'foo', function ($name) use ($value) {
+ $this->assertSame('foo', $name);
+
+ return $value;
+ });
+
+ $this->assertSame($processed, $result);
+ }
+
+ public function validInts()
+ {
+ return array(
+ array('1', 1),
+ array('1.1', 1),
+ array('1e1', 10),
+ );
+ }
+
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ * @expectedExceptionMessage Non-numeric env var
+ * @dataProvider invalidInts
+ */
+ public function testGetEnvIntInvalid($value)
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $processor->getEnv('int', 'foo', function ($name) use ($value) {
+ $this->assertSame('foo', $name);
+
+ return $value;
+ });
+ }
+
+ public function invalidInts()
+ {
+ return array(
+ array('foo'),
+ array('true'),
+ array('null'),
+ );
+ }
+
+ /**
+ * @dataProvider validFloats
+ */
+ public function testGetEnvFloat($value, $processed)
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $result = $processor->getEnv('float', 'foo', function ($name) use ($value) {
+ $this->assertSame('foo', $name);
+
+ return $value;
+ });
+
+ $this->assertSame($processed, $result);
+ }
+
+ public function validFloats()
+ {
+ return array(
+ array('1', 1.0),
+ array('1.1', 1.1),
+ array('1e1', 10.0),
+ );
+ }
+
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ * @expectedExceptionMessage Non-numeric env var
+ * @dataProvider invalidFloats
+ */
+ public function testGetEnvFloatInvalid($value)
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $processor->getEnv('float', 'foo', function ($name) use ($value) {
+ $this->assertSame('foo', $name);
+
+ return $value;
+ });
+ }
+
+ public function invalidFloats()
+ {
+ return array(
+ array('foo'),
+ array('true'),
+ array('null'),
+ );
+ }
+
+ /**
+ * @dataProvider validConsts
+ */
+ public function testGetEnvConst($value, $processed)
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $result = $processor->getEnv('const', 'foo', function ($name) use ($value) {
+ $this->assertSame('foo', $name);
+
+ return $value;
+ });
+
+ $this->assertSame($processed, $result);
+ }
+
+ public function validConsts()
+ {
+ return array(
+ array('Symfony\Component\DependencyInjection\Tests\EnvVarProcessorTest::TEST_CONST', self::TEST_CONST),
+ array('E_ERROR', E_ERROR),
+ );
+ }
+
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ * @expectedExceptionMessage undefined constant
+ * @dataProvider invalidConsts
+ */
+ public function testGetEnvConstInvalid($value)
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $processor->getEnv('const', 'foo', function ($name) use ($value) {
+ $this->assertSame('foo', $name);
+
+ return $value;
+ });
+ }
+
+ public function invalidConsts()
+ {
+ return array(
+ array('Symfony\Component\DependencyInjection\Tests\EnvVarProcessorTest::UNDEFINED_CONST'),
+ array('UNDEFINED_CONST'),
+ );
+ }
+
+ public function testGetEnvBase64()
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $result = $processor->getEnv('base64', 'foo', function ($name) {
+ $this->assertSame('foo', $name);
+
+ return base64_encode('hello');
+ });
+
+ $this->assertSame('hello', $result);
+ }
+
+ public function testGetEnvJson()
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $result = $processor->getEnv('json', 'foo', function ($name) {
+ $this->assertSame('foo', $name);
+
+ return json_encode(array(1));
+ });
+
+ $this->assertSame(array(1), $result);
+ }
+
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ * @expectedExceptionMessage Syntax error
+ */
+ public function testGetEnvInvalidJson()
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $processor->getEnv('json', 'foo', function ($name) {
+ $this->assertSame('foo', $name);
+
+ return 'invalid_json';
+ });
+ }
+
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ * @expectedExceptionMessage Invalid JSON env var
+ * @dataProvider otherJsonValues
+ */
+ public function testGetEnvJsonOther($value)
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $processor->getEnv('json', 'foo', function ($name) use ($value) {
+ $this->assertSame('foo', $name);
+
+ return json_encode($value);
+ });
+ }
+
+ public function otherJsonValues()
+ {
+ return array(
+ array(1),
+ array(1.1),
+ array(true),
+ array(false),
+ );
+ }
+
+ /**
+ * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+ * @expectedExceptionMessage Unsupported env var prefix
+ */
+ public function testGetEnvUnknown()
+ {
+ $processor = new EnvVarProcessor(new Container());
+
+ $processor->getEnv('unknown', 'foo', function ($name) {
+ $this->assertSame('foo', $name);
+
+ return 'foo';
+ });
+ }
+}
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Container/NoConstructorContainer.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Container/NoConstructorContainer.php
index 7514cc7c1b..b14b013f1f 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Container/NoConstructorContainer.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Container/NoConstructorContainer.php
@@ -2,6 +2,8 @@
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Container;
-class NoConstructorContainer
+use Symfony\Component\DependencyInjection\Container;
+
+class NoConstructorContainer extends Container
{
}
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php
index 01caae6489..a6b9962b3d 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php
@@ -29,6 +29,7 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes
public function __construct()
{
parent::__construct();
+ $this->parameterBag = null;
$this->services = $this->privates = array();
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php
index 1c20741bf7..84986f1638 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php
@@ -29,6 +29,7 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes
public function __construct()
{
parent::__construct();
+ $this->parameterBag = null;
$this->services = $this->privates = array();
diff --git a/src/Symfony/Component/DomCrawler/Field/FormField.php b/src/Symfony/Component/DomCrawler/Field/FormField.php
index 567164d046..33c0bbeac0 100644
--- a/src/Symfony/Component/DomCrawler/Field/FormField.php
+++ b/src/Symfony/Component/DomCrawler/Field/FormField.php
@@ -75,8 +75,6 @@ abstract class FormField
if ($labels->length > 0) {
return $labels->item(0);
}
-
- return;
}
/**
diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php
index e8ede167b3..c906c6549a 100644
--- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php
+++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4HorizontalLayoutTest.php
@@ -32,14 +32,12 @@ abstract class AbstractBootstrap4HorizontalLayoutTest extends AbstractBootstrap4
[
./label[@for="name"]
[
- ./div[
- ./ul
- [./li
- [./span[.="[trans]Error[/trans]"]]
- [./span[.="[trans]Error![/trans]"]]
- ]
- [count(./li)=1]
- ]
+ ./span[@class="alert alert-danger"]
+ [./span[@class="mb-0 d-block"]
+ [./span[.="[trans]Error[/trans]"]]
+ [./span[.="[trans]Error![/trans]"]]
+ ]
+ [count(./span)=1]
]
/following-sibling::div[./input[@id="name"]]
]
diff --git a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php
index ec97577818..6e448c413a 100644
--- a/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php
+++ b/src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php
@@ -32,14 +32,12 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
[
./label[@for="name"]
[
- ./div[
- ./ul
- [./li
- [./span[.="[trans]Error[/trans]"]]
- [./span[.="[trans]Error![/trans]"]]
- ]
- [count(./li)=1]
- ]
+ ./span[@class="alert alert-danger"]
+ [./span[@class="mb-0 d-block"]
+ [./span[.="[trans]Error[/trans]"]]
+ [./span[.="[trans]Error![/trans]"]]
+ ]
+ [count(./span)=1]
]
/following-sibling::input[@id="name"]
]
@@ -162,26 +160,32 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
$html = $this->renderErrors($view);
$this->assertMatchesXpath($html,
-'/div
+'/span
[@class="alert alert-danger"]
[
- ./ul
- [@class="list-unstyled mb-0"]
- [
- ./li
- [./span[.="[trans]Error[/trans]"]]
- [./span[.="[trans]Error 1[/trans]"]]
-
- /following-sibling::li
- [./span[.="[trans]Error[/trans]"]]
- [./span[.="[trans]Error 2[/trans]"]]
- ]
- [count(./li)=2]
+ ./span[@class="mb-0 d-block"]
+ [./span[.="[trans]Error[/trans]"]]
+ [./span[.="[trans]Error 1[/trans]"]]
+
+ /following-sibling::span[@class="mb-0 d-block"]
+ [./span[.="[trans]Error[/trans]"]]
+ [./span[.="[trans]Error 2[/trans]"]]
]
+ [count(./span)=2]
'
);
}
+ public function testErrorWithNoLabel()
+ {
+ $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('label'=>false));
+ $form->addError(new FormError('[trans]Error 1[/trans]'));
+ $view = $form->createView();
+ $html = $this->renderLabel($view);
+
+ $this->assertMatchesXpath($html, '//span[.="[trans]Error[/trans]"]');
+ }
+
public function testCheckedCheckbox()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', true);
diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php
index 9f4ef7028e..dd37eae14e 100644
--- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php
+++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MemcachedSessionHandler.php
@@ -80,7 +80,9 @@ class MemcachedSessionHandler extends AbstractSessionHandler
*/
public function updateTimestamp($sessionId, $data)
{
- return $this->memcached->touch($this->prefix.$sessionId, time() + $this->ttl);
+ $this->memcached->touch($this->prefix.$sessionId, time() + $this->ttl);
+
+ return true;
}
/**
diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/Component/HttpKernel/KernelInterface.php
index e58fbd2ed5..925e37b071 100644
--- a/src/Symfony/Component/HttpKernel/KernelInterface.php
+++ b/src/Symfony/Component/HttpKernel/KernelInterface.php
@@ -18,7 +18,7 @@ use Symfony\Component\Config\Loader\LoaderInterface;
/**
* The Kernel is the heart of the Symfony system.
*
- * It manages an environment made of bundles.
+ * It manages an environment made of application kernel and bundles.
*
* @author Fabien Potencier - You're seeing this message because you have debug mode enabled and you haven't configured any URLs. + You're seeing this page because debug mode is enabled and you haven't configured any homepage URL.