Skip to content

Commit 37a3a30

Browse files
committed
Merge branch '2.8' into 3.0
* 2.8: improved comment [FileSystem] Add support for Google App Engine. [2.8] fix mocks [Form] Fix BC break introduced in symfony#14403
2 parents 8529f19 + 56fa798 commit 37a3a30

File tree

9 files changed

+34
-12
lines changed

9 files changed

+34
-12
lines changed

phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
// Please update when phpunit needs to be reinstalled with fresh deps:
14-
// Cache-Id-Version: 2016-03-23 14:50 UTC
14+
// Cache-Id-Version: 2016-03-25 09:45 UTC
1515

1616
use Symfony\Component\Process\ProcessUtils;
1717

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@
315315

316316
{%- block widget_attributes -%}
317317
id="{{ id }}" name="{{ full_name }}"
318+
{%- if read_only %} readonly="readonly"{% endif -%}
318319
{%- if disabled %} disabled="disabled"{% endif -%}
319320
{%- if required %} required="required"{% endif -%}
320-
{%- for attrname, attrvalue in attr -%}
321+
{%- for attrname, attrvalue in attr if 'readonly' != attrname -%}
321322
{{- " " -}}
322323
{%- if attrname in ['placeholder', 'title'] -%}
323324
{{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
1+
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($read_only): ?> readonly="readonly"<?php endif ?>
2+
<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
23
<?php if ($required): ?> required="required"<?php endif ?>
34
<?php foreach ($attr as $k => $v): ?>
5+
<?php if ('readonly' === $k) { continue; } ?>
46
<?php if (in_array($k, array('placeholder', 'title'), true)): ?>
57
<?php printf(' %s="%s"', $view->escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
68
<?php elseif ($v === true): ?>

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,13 +486,13 @@ public function tempnam($dir, $prefix)
486486
{
487487
list($scheme, $hierarchy) = $this->getSchemeAndHierarchy($dir);
488488

489-
// If no scheme or scheme is "file" create temp file in local filesystem
490-
if (null === $scheme || 'file' === $scheme) {
489+
// If no scheme or scheme is "file" or "gs" (Google Cloud) create temp file in local filesystem
490+
if (null === $scheme || 'file' === $scheme || 'gs' === $scheme) {
491491
$tmpFile = tempnam($hierarchy, $prefix);
492492

493493
// If tempnam failed or no scheme return the filename otherwise prepend the scheme
494494
if (false !== $tmpFile) {
495-
if (null !== $scheme) {
495+
if (null !== $scheme && 'gs' !== $scheme) {
496496
return $scheme.'://'.$tmpFile;
497497
}
498498

src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,7 @@ public function testWidgetAttributes()
23692369
$html = $this->renderWidget($form->createView());
23702370

23712371
// compare plain HTML to check the whitespace
2372-
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar form-control" data-foo="bar" value="value" />', $html);
2372+
$this->assertSame('<input type="text" id="text" name="text" readonly="readonly" disabled="disabled" required="required" maxlength="10" pattern="\d+" class="foobar form-control" data-foo="bar" value="value" />', $html);
23732373
}
23742374

23752375
public function testWidgetAttributeNameRepeatedIfTrue()

src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2290,7 +2290,7 @@ public function testWidgetAttributes()
22902290
$html = $this->renderWidget($form->createView());
22912291

22922292
// compare plain HTML to check the whitespace
2293-
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value" />', $html);
2293+
$this->assertSame('<input type="text" id="text" name="text" readonly="readonly" disabled="disabled" required="required" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value" />', $html);
22942294
}
22952295

22962296
public function testWidgetAttributeNameRepeatedIfTrue()

src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Symfony\Component\Validator\Constraints\NotNull;
2222
use Symfony\Component\Validator\Constraints\NotBlank;
2323
use Symfony\Component\Validator\Constraints\Valid;
24+
use Symfony\Component\Validator\ExecutionContextInterface;
2425
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
2526

2627
/**

src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Form\Tests\Extension\Validator;
1313

1414
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
15+
use Symfony\Component\Validator\ValidatorInterface;
1516

1617
class ValidatorExtensionTest extends \PHPUnit_Framework_TestCase
1718
{

src/Symfony/Component/Templating/Tests/DelegatingEngineTest.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ public function testStreamDelegatesToSupportedEngine()
6666
*/
6767
public function testStreamRequiresStreamingEngine()
6868
{
69-
$engine = $this->getEngineMock('template.php', true);
70-
$engine->expects($this->never())->method('stream');
71-
72-
$delegatingEngine = new DelegatingEngine(array($engine));
69+
$delegatingEngine = new DelegatingEngine(array(new TestEngine()));
7370
$delegatingEngine->stream('template.php', array('foo' => 'bar'));
7471
}
7572

@@ -155,3 +152,23 @@ private function getStreamingEngineMock($template, $supports)
155152
interface MyStreamingEngine extends StreamingEngineInterface, EngineInterface
156153
{
157154
}
155+
156+
class TestEngine implements EngineInterface
157+
{
158+
public function render($name, array $parameters = array())
159+
{
160+
}
161+
162+
public function exists($name)
163+
{
164+
}
165+
166+
public function supports($name)
167+
{
168+
return true;
169+
}
170+
171+
public function stream()
172+
{
173+
}
174+
}

0 commit comments

Comments
 (0)