Merge branch '2.8' into 3.4
* 2.8: Fix CS Allow reuse of Session between requests Provide debug_backtrace with proper args forward false label option to nested types forward the invalid_message option in date types
This commit is contained in:
commit
0218507b06
@ -112,7 +112,7 @@ class DeprecationErrorHandler
|
||||
return $ErrorHandler::handleError($type, $msg, $file, $line, $context);
|
||||
}
|
||||
|
||||
$trace = debug_backtrace(true);
|
||||
$trace = debug_backtrace();
|
||||
$group = 'other';
|
||||
$isVendor = DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $inVendors($file);
|
||||
|
||||
|
@ -952,8 +952,8 @@ class FormTest extends TestCase
|
||||
<form>
|
||||
<textarea name="example"></textarea>
|
||||
</form>
|
||||
</html>
|
||||
');
|
||||
</html>'
|
||||
);
|
||||
|
||||
$nodes = $dom->getElementsByTagName('form');
|
||||
$form = new Form($nodes->item(0), 'http://example.com');
|
||||
|
@ -119,6 +119,11 @@ class DateTimeType extends AbstractType
|
||||
'invalid_message_parameters',
|
||||
)));
|
||||
|
||||
if (false === $options['label']) {
|
||||
$dateOptions['label'] = false;
|
||||
$timeOptions['label'] = false;
|
||||
}
|
||||
|
||||
if (null !== $options['date_widget']) {
|
||||
$dateOptions['widget'] = $options['date_widget'];
|
||||
}
|
||||
|
@ -77,6 +77,18 @@ class DateType extends AbstractType
|
||||
'error_bubbling' => true,
|
||||
);
|
||||
|
||||
if (isset($options['invalid_message'])) {
|
||||
$dayOptions['invalid_message'] = $options['invalid_message'];
|
||||
$monthOptions['invalid_message'] = $options['invalid_message'];
|
||||
$yearOptions['invalid_message'] = $options['invalid_message'];
|
||||
}
|
||||
|
||||
if (isset($options['invalid_message_parameters'])) {
|
||||
$dayOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
|
||||
$monthOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
|
||||
$yearOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
|
||||
}
|
||||
|
||||
$formatter = new \IntlDateFormatter(
|
||||
\Locale::getDefault(),
|
||||
$dateFormat,
|
||||
|
@ -72,6 +72,18 @@ class TimeType extends AbstractType
|
||||
'error_bubbling' => true,
|
||||
);
|
||||
|
||||
if (isset($options['invalid_message'])) {
|
||||
$hourOptions['invalid_message'] = $options['invalid_message'];
|
||||
$minuteOptions['invalid_message'] = $options['invalid_message'];
|
||||
$secondOptions['invalid_message'] = $options['invalid_message'];
|
||||
}
|
||||
|
||||
if (isset($options['invalid_message_parameters'])) {
|
||||
$hourOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
|
||||
$minuteOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
|
||||
$secondOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
|
||||
}
|
||||
|
||||
if ('choice' === $options['widget']) {
|
||||
$hours = $minutes = array();
|
||||
|
||||
|
@ -209,8 +209,10 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
if ($this->storage->getId() !== $id) {
|
||||
$this->storage->setId($id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -70,6 +70,27 @@ class SessionTest extends TestCase
|
||||
$this->assertEquals('0123456789abcdef', $this->session->getId());
|
||||
}
|
||||
|
||||
public function testSetIdAfterStart()
|
||||
{
|
||||
$this->session->start();
|
||||
$id = $this->session->getId();
|
||||
|
||||
$e = null;
|
||||
try {
|
||||
$this->session->setId($id);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
$this->assertNull($e);
|
||||
|
||||
try {
|
||||
$this->session->setId('different');
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
$this->assertInstanceOf('\LogicException', $e);
|
||||
}
|
||||
|
||||
public function testSetName()
|
||||
{
|
||||
$this->assertEquals('MOCKSESSID', $this->session->getName());
|
||||
|
@ -75,8 +75,7 @@ class PropertyNormalizerTest extends TestCase
|
||||
$group->setKevin('Kevin');
|
||||
$group->setCoopTilleuls('coop');
|
||||
$this->assertEquals(
|
||||
array('foo' => 'foo', 'bar' => 'bar', 'kevin' => 'Kevin',
|
||||
'coopTilleuls' => 'coop', 'fooBar' => null, 'symfony' => null, 'baz' => 'baz', ),
|
||||
array('foo' => 'foo', 'bar' => 'bar', 'kevin' => 'Kevin', 'coopTilleuls' => 'coop', 'fooBar' => null, 'symfony' => null, 'baz' => 'baz'),
|
||||
$this->normalizer->normalize($group, 'any')
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user