Skip to content

Commit 422554e

Browse files
Merge branch '3.3' into 3.4
* 3.3: Ensure DeprecationErrorHandler::collectDeprecations() is triggered [FrameworkBundle] Allow to disable assets via framework:assets xml configuration fixed $_ENV/$_SERVER precedence in test framework [HttpFoundation] Fix FileBag issue with associative arrays [DI] Throw when a service name or an alias contains dynamic values (prevent an infinite loop) fix the phpdoc that is not really inherited from response Minor docblock cleanup Remove redundant sprintf arguments.
2 parents 0f4323d + e4c859a commit 422554e

File tree

7 files changed

+38
-8
lines changed

7 files changed

+38
-8
lines changed

Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
<xsd:element name="package" type="package" minOccurs="0" maxOccurs="unbounded" />
140140
</xsd:sequence>
141141

142+
<xsd:attribute name="enabled" type="xsd:boolean" />
142143
<xsd:attribute name="base-path" type="xsd:string" />
143144
<xsd:attribute name="version-strategy" type="xsd:string" />
144145
<xsd:attribute name="version" type="xsd:string" />

Templating/Helper/CodeHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public function abbrMethod($method)
6161
list($class, $method) = explode('::', $method, 2);
6262
$result = sprintf('%s::%s()', $this->abbrClass($class), $method);
6363
} elseif ('Closure' === $method) {
64-
$result = sprintf('<abbr title="%s">%s</abbr>', $method, $method);
64+
$result = sprintf('<abbr title="%s">%1$s</abbr>', $method);
6565
} else {
66-
$result = sprintf('<abbr title="%s">%s</abbr>()', $method, $method);
66+
$result = sprintf('<abbr title="%s">%1$s</abbr>()', $method);
6767
}
6868

6969
return $result;

Test/KernelTestCase.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private static function getPhpUnitCliConfigArgument()
115115
protected static function getKernelClass()
116116
{
117117
if (isset($_SERVER['KERNEL_CLASS']) || isset($_ENV['KERNEL_CLASS'])) {
118-
$class = isset($_SERVER['KERNEL_CLASS']) ? $_SERVER['KERNEL_CLASS'] : $_ENV['KERNEL_CLASS'];
118+
$class = isset($_ENV['KERNEL_CLASS']) ? $_ENV['KERNEL_CLASS'] : $_SERVER['KERNEL_CLASS'];
119119
if (!class_exists($class)) {
120120
throw new \RuntimeException(sprintf('Class "%s" doesn\'t exist or cannot be autoloaded. Check that the KERNEL_CLASS value in phpunit.xml matches the fully-qualified class name of your Kernel or override the %s::createKernel() method.', $class, static::class));
121121
}
@@ -126,7 +126,7 @@ protected static function getKernelClass()
126126
}
127127

128128
if (isset($_SERVER['KERNEL_DIR']) || isset($_ENV['KERNEL_DIR'])) {
129-
$dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : $_ENV['KERNEL_DIR'];
129+
$dir = isset($_ENV['KERNEL_DIR']) ? $_ENV['KERNEL_DIR'] : $_SERVER['KERNEL_DIR'];
130130

131131
if (!is_dir($dir)) {
132132
$phpUnitDir = static::getPhpUnitXmlDir();
@@ -186,20 +186,20 @@ protected static function createKernel(array $options = array())
186186

187187
if (isset($options['environment'])) {
188188
$env = $options['environment'];
189-
} elseif (isset($_SERVER['APP_ENV'])) {
190-
$env = $_SERVER['APP_ENV'];
191189
} elseif (isset($_ENV['APP_ENV'])) {
192190
$env = $_ENV['APP_ENV'];
191+
} elseif (isset($_SERVER['APP_ENV'])) {
192+
$env = $_SERVER['APP_ENV'];
193193
} else {
194194
$env = 'test';
195195
}
196196

197197
if (isset($options['debug'])) {
198198
$debug = $options['debug'];
199-
} elseif (isset($_SERVER['APP_DEBUG'])) {
200-
$debug = $_SERVER['APP_DEBUG'];
201199
} elseif (isset($_ENV['APP_DEBUG'])) {
202200
$debug = $_ENV['APP_DEBUG'];
201+
} elseif (isset($_SERVER['APP_DEBUG'])) {
202+
$debug = $_SERVER['APP_DEBUG'];
203203
} else {
204204
$debug = true;
205205
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', array(
4+
'assets' => array(
5+
'enabled' => false,
6+
),
7+
));
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" ?>
2+
3+
<container xmlns="http://symfony.com/schema/dic/services"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns:framework="http://symfony.com/schema/dic/symfony"
6+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
7+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
8+
9+
<framework:config>
10+
<framework:assets enabled="false" />
11+
</framework:config>
12+
</container>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
assets:
3+
enabled: false

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,13 @@ public function testAssetsDefaultVersionStrategyAsService()
459459
$this->assertEquals('assets.custom_version_strategy', (string) $defaultPackage->getArgument(1));
460460
}
461461

462+
public function testAssetsCanBeDisabled()
463+
{
464+
$container = $this->createContainerFromFile('assets_disabled');
465+
466+
$this->assertFalse($container->has('templating.helper.assets'), 'The templating.helper.assets helper service is removed when assets are disabled.');
467+
}
468+
462469
public function testWebLink()
463470
{
464471
$container = $this->createContainerFromFile('web_link');

0 commit comments

Comments
 (0)