diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
index 146ea2979d..489b446512 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
@@ -15,6 +15,7 @@ use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
@@ -340,6 +341,23 @@ class XmlDescriptor extends Descriptor
$serviceXML->setAttribute('factory-method', $definition->getFactoryMethod());
}
+ if ($factory = $definition->getFactory()) {
+ $serviceXML->appendChild($factoryXML = $dom->createElement('factory'));
+
+ if (is_array($factory)) {
+ if ($factory[0] instanceof Reference) {
+ $factoryXML->setAttribute('service', (string) $factory[0]);
+ } elseif ($factory[0] instanceof Definition) {
+ throw new \InvalidArgumentException('Factory is not describable.');
+ } else {
+ $factoryXML->setAttribute('class', $factory[0]);
+ }
+ $factoryXML->setAttribute('method', $factory[1]);
+ } else {
+ $factoryXML->setAttribute('function', $factory);
+ }
+ }
+
$serviceXML->setAttribute('scope', $definition->getScope());
$serviceXML->setAttribute('public', $definition->isPublic() ? 'true' : 'false');
$serviceXML->setAttribute('synthetic', $definition->isSynthetic() ? 'true' : 'false');
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
index e342544f0d..9bc81ca58b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
@@ -15,6 +15,7 @@ use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
@@ -98,8 +99,7 @@ class ObjectsProvider
->setLazy(true)
->setSynchronized(true)
->setAbstract(true)
- ->setFactoryClass('Full\\Qualified\\FactoryClass')
- ->setFactoryMethod('get'),
+ ->setFactory(array('Full\\Qualified\\FactoryClass', 'get')),
'definition_2' => $definition2
->setPublic(false)
->setSynthetic(true)
@@ -110,8 +110,7 @@ class ObjectsProvider
->addTag('tag1', array('attr1' => 'val1', 'attr2' => 'val2'))
->addTag('tag1', array('attr3' => 'val3'))
->addTag('tag2')
- ->setFactoryService('factory.service')
- ->setFactoryMethod('get'),
+ ->setFactory(array(new Reference('factory.service'), 'get')),
);
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
index 16df428799..235035c871 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
@@ -2,6 +2,8 @@
-
+
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
index 4636803bfb..31b457e370 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
@@ -2,8 +2,11 @@
-
-
+
+
+
+
+
val1
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
index c755e70ce7..d6ac0b750b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
@@ -1,6 +1,7 @@
-
+
+
val1
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
index b0f6244487..be9d2f015b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
@@ -1,9 +1,13 @@
-
+
+
+
-
+
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml
index 75d0820244..3aa8ca35e7 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_1.xml
@@ -1,2 +1,4 @@
-
+
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml
index dd3e2e06d7..f128e522e5 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.xml
@@ -1,5 +1,6 @@
-
+
+
val1
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php
index 1aec1cc521..3d1aa90414 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php
@@ -26,8 +26,10 @@ class GlobalVariablesTest extends TestCase
$this->globals = new GlobalVariables($this->container);
}
- public function testGetSecurity()
+ public function testLegacyGetSecurity()
{
+ $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED);
+
$securityContext = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
$this->assertNull($this->globals->getSecurity());
diff --git a/src/Symfony/Component/Debug/README.md b/src/Symfony/Component/Debug/README.md
index 18d6d8f9ee..70c460370b 100644
--- a/src/Symfony/Component/Debug/README.md
+++ b/src/Symfony/Component/Debug/README.md
@@ -24,7 +24,7 @@ if ('cli' !== php_sapi_name()) {
} elseif (!ini_get('log_errors') || ini_get('error_log')) {
ini_set('display_errors', 1);
}
-ErrorHandler::register($errorReportingLevel);
+ErrorHandler::register();
```
Note that the `Debug::enable()` call also registers the debug class loader
diff --git a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
index c77a8760d3..5e47dfc757 100644
--- a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
+++ b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
@@ -21,24 +21,38 @@ class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider provideClassNotFoundData
*/
- public function testHandleClassNotFound($error, $translatedMessage, $autoloader = null)
+ public function testHandleClassNotFound($error, $translatedMessage)
{
- if ($autoloader) {
- // Unregister all autoloaders to ensure the custom provided
- // autoloader is the only one to be used during the test run.
- $autoloaders = spl_autoload_functions();
- array_map('spl_autoload_unregister', $autoloaders);
- spl_autoload_register($autoloader);
- }
+ $handler = new ClassNotFoundFatalErrorHandler();
+
+ $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
+
+ $this->assertInstanceof('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception);
+ $this->assertSame($translatedMessage, $exception->getMessage());
+ $this->assertSame($error['type'], $exception->getSeverity());
+ $this->assertSame($error['file'], $exception->getFile());
+ $this->assertSame($error['line'], $exception->getLine());
+ }
+
+ /**
+ * @dataProvider provideLegacyClassNotFoundData
+ */
+ public function testLegacyHandleClassNotFound($error, $translatedMessage, $autoloader)
+ {
+ $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED);
+
+ // Unregister all autoloaders to ensure the custom provided
+ // autoloader is the only one to be used during the test run.
+ $autoloaders = spl_autoload_functions();
+ array_map('spl_autoload_unregister', $autoloaders);
+ spl_autoload_register($autoloader);
$handler = new ClassNotFoundFatalErrorHandler();
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
- if ($autoloader) {
- spl_autoload_unregister($autoloader);
- array_map('spl_autoload_register', $autoloaders);
- }
+ spl_autoload_unregister($autoloader);
+ array_map('spl_autoload_register', $autoloaders);
$this->assertInstanceof('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception);
$this->assertSame($translatedMessage, $exception->getMessage());
@@ -49,14 +63,6 @@ class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase
public function provideClassNotFoundData()
{
- $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception'));
-
- $symfonyAutoloader = new SymfonyClassLoader();
- $symfonyAutoloader->addPrefixes($prefixes);
-
- $symfonyUniversalClassLoader = new SymfonyUniversalClassLoader();
- $symfonyUniversalClassLoader->registerPrefixes($prefixes);
-
return array(
array(
array(
@@ -103,6 +109,20 @@ class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase
),
"Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?",
),
+ );
+ }
+
+ public function provideLegacyClassNotFoundData()
+ {
+ $prefixes = array('Symfony\Component\Debug\Exception\\' => realpath(__DIR__.'/../../Exception'));
+
+ $symfonyAutoloader = new SymfonyClassLoader();
+ $symfonyAutoloader->addPrefixes($prefixes);
+
+ $symfonyUniversalClassLoader = new SymfonyUniversalClassLoader();
+ $symfonyUniversalClassLoader->registerPrefixes($prefixes);
+
+ return array(
array(
array(
'type' => 1,
diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php
index 40c6b23cad..c5ecb2d504 100644
--- a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php
+++ b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php
@@ -74,6 +74,9 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
if ($definition->getFactoryService()) {
$this->processArguments(array(new Reference($definition->getFactoryService())));
}
+ if (is_array($definition->getFactory())) {
+ $this->processArguments($definition->getFactory());
+ }
if (!$this->onlyConstructorArguments) {
$this->processArguments($definition->getMethodCalls());
@@ -81,9 +84,6 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
if ($definition->getConfigurator()) {
$this->processArguments(array($definition->getConfigurator()));
}
- if ($definition->getFactory()) {
- $this->processArguments(array($definition->getFactory()));
- }
}
}
@@ -115,6 +115,9 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
$this->processArguments($argument->getMethodCalls());
$this->processArguments($argument->getProperties());
+ if (is_array($argument->getFactory())) {
+ $this->processArguments($argument->getFactory());
+ }
if ($argument->getFactoryService()) {
$this->processArguments(array(new Reference($argument->getFactoryService())));
}
diff --git a/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
index 102e9331cd..9d3a781420 100644
--- a/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
+++ b/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
@@ -144,6 +144,10 @@ class InlineServiceDefinitionsPass implements RepeatablePassInterface
return false;
}
+ if (count($ids) > 1 && is_array($factory = $definition->getFactory()) && ($factory[0] instanceof Reference || $factory[0] instanceof Definition)) {
+ return false;
+ }
+
if (count($ids) > 1 && $definition->getFactoryService()) {
return false;
}
diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php
index 032d27aaee..c1db3e04d6 100644
--- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php
+++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php
@@ -81,11 +81,9 @@ class ResolveDefinitionTemplatesPass implements CompilerPassInterface
$def->setArguments($parentDef->getArguments());
$def->setMethodCalls($parentDef->getMethodCalls());
$def->setProperties($parentDef->getProperties());
- if (null !== $parentDef->getFactoryMethod()) {
- $def->setFactoryClass($parentDef->getFactoryClass());
- $def->setFactoryMethod($parentDef->getFactoryMethod());
- $def->setFactoryService($parentDef->getFactoryService());
- }
+ $def->setFactoryClass($parentDef->getFactoryClass());
+ $def->setFactoryMethod($parentDef->getFactoryMethod());
+ $def->setFactoryService($parentDef->getFactoryService());
$def->setFactory($parentDef->getFactory());
$def->setConfigurator($parentDef->getConfigurator());
$def->setFile($parentDef->getFile());
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php
index 36130abceb..04fe7c2cf1 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php
@@ -87,7 +87,7 @@ class AnalyzeServiceReferencesPassTest extends \PHPUnit_Framework_TestCase
;
$factory = new Definition();
- $factory->setFactoryService('a');
+ $factory->setFactory(array(new Reference('a'), 'a'));
$container
->register('b')
@@ -124,13 +124,11 @@ class AnalyzeServiceReferencesPassTest extends \PHPUnit_Framework_TestCase
$container
->register('foo', 'stdClass')
- ->setFactoryClass('stdClass')
- ->setFactoryMethod('getInstance');
+ ->setFactory(array('stdClass', 'getInstance'));
$container
->register('bar', 'stdClass')
- ->setFactoryService('foo')
- ->setFactoryMethod('getInstance');
+ ->setFactory(array(new Reference('foo'), 'getInstance'));
$graph = $this->process($container);
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php
index 98a600b9c0..55351e551c 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php
@@ -53,13 +53,11 @@ class CheckCircularReferencesPassTest extends \PHPUnit_Framework_TestCase
$container
->register('a', 'stdClass')
- ->setFactoryService('b')
- ->setFactoryMethod('getInstance');
+ ->setFactory(array(new Reference('b'), 'getInstance'));
$container
->register('b', 'stdClass')
- ->setFactoryService('a')
- ->setFactoryMethod('getInstance');
+ ->setFactory(array(new Reference('a'), 'getInstance'));
$this->process($container);
}
@@ -88,8 +86,7 @@ class CheckCircularReferencesPassTest extends \PHPUnit_Framework_TestCase
$container
->register('b', 'stdClass')
- ->setFactoryService('c')
- ->setFactoryMethod('getInstance');
+ ->setFactory(array(new Reference('c'), 'getInstance'));
$container->register('c')->addArgument(new Reference('a'));
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php
index fc404467a6..590ca4cfae 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php
@@ -118,7 +118,7 @@ class InlineServiceDefinitionsPassTest extends \PHPUnit_Framework_TestCase
$b = $container
->register('b')
->setPublic(false)
- ->setFactoryService('a')
+ ->setFactory(array(new Reference('a'), 'a'))
;
$container
@@ -142,7 +142,7 @@ class InlineServiceDefinitionsPassTest extends \PHPUnit_Framework_TestCase
$container
->register('b')
->setPublic(false)
- ->setFactoryService('a')
+ ->setFactory(array(new Reference('a'), 'a'))
;
$container
@@ -168,12 +168,12 @@ class InlineServiceDefinitionsPassTest extends \PHPUnit_Framework_TestCase
$container
->register('b')
->setPublic(false)
- ->setFactoryService('a')
+ ->setFactory(array(new Reference('a'), 'a'))
;
$inlineFactory = new Definition();
$inlineFactory->setPublic(false);
- $inlineFactory->setFactoryService('b');
+ $inlineFactory->setFactory(array(new Reference('b'), 'b'));
$container
->register('foo')
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php
index 490f38aeef..82149ebdb3 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php
@@ -86,14 +86,12 @@ class RemoveUnusedDefinitionsPassTest extends \PHPUnit_Framework_TestCase
$container
->register('foo', 'stdClass')
- ->setFactoryClass('stdClass')
- ->setFactoryMethod('getInstance')
+ ->setFactory(array('stdClass', 'getInstance'))
->setPublic(false);
$container
->register('bar', 'stdClass')
- ->setFactoryService('foo')
- ->setFactoryMethod('getInstance')
+ ->setFactory(array(new Reference('foo'), 'getInstance'))
->setPublic(false);
$container
diff --git a/src/Symfony/Component/DependencyInjection/Tests/LegacyContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/LegacyContainerBuilderTest.php
index 496b621b6b..2f7b827d43 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/LegacyContainerBuilderTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/LegacyContainerBuilderTest.php
@@ -16,6 +16,11 @@ use Symfony\Component\DependencyInjection\Reference;
class LegacyContainerBuilderTest extends \PHPUnit_Framework_TestCase
{
+ public function setUp()
+ {
+ $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED);
+ }
+
/**
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
*/
diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
index d8b29d2a4a..252d370080 100644
--- a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
+++ b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php
@@ -242,7 +242,7 @@ class DateTimeType extends AbstractType
// Don't add some defaults in order to preserve the defaults
// set in DateType and TimeType
- $resolver->setOptional(array(
+ $resolver->setDefined(array(
'empty_value', // deprecated
'placeholder',
'years',
diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php
index e22d90cfa8..627d1557b7 100644
--- a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php
+++ b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php
@@ -165,7 +165,7 @@ class FormType extends BaseType
// If data is given, the form is locked to that data
// (independent of its value)
- $resolver->setOptional(array(
+ $resolver->setDefined(array(
'data',
));
diff --git a/src/Symfony/Component/Form/composer.json b/src/Symfony/Component/Form/composer.json
index 18f3abaecf..75f8d43c48 100644
--- a/src/Symfony/Component/Form/composer.json
+++ b/src/Symfony/Component/Form/composer.json
@@ -19,7 +19,7 @@
"php": ">=5.3.3",
"symfony/event-dispatcher": "~2.1",
"symfony/intl": "~2.3",
- "symfony/options-resolver": "~2.1",
+ "symfony/options-resolver": "~2.6",
"symfony/property-access": "~2.3"
},
"require-dev": {
diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php
index 5fa6255414..cb072deff6 100644
--- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php
+++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php
@@ -19,6 +19,8 @@ class LegacyPdoSessionHandlerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
+ $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED);
+
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
$this->markTestSkipped('This test requires SQLite support in your environment');
}
diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
index 32f9eebed0..86d8812530 100644
--- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\HttpKernel\Tests\DataCollector;
-use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector;
class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase
diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/SurrogateListenerTest.php
similarity index 97%
rename from src/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php
rename to src/Symfony/Component/HttpKernel/Tests/EventListener/SurrogateListenerTest.php
index 9b0517d03e..1a0acf92fa 100644
--- a/src/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/SurrogateListenerTest.php
@@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\EventDispatcher\EventDispatcher;
-class EsiListenerTest extends \PHPUnit_Framework_TestCase
+class SurrogateListenerTest extends \PHPUnit_Framework_TestCase
{
public function testFilterDoesNothingForSubRequests()
{
diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php
index 67f91e48bd..c8a79bd7e5 100644
--- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php
+++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php
@@ -274,21 +274,21 @@ EOF;
$this->assertEquals($expected, $output);
}
- public function testIsClassInActiveBundleFalse()
+ public function testLegacyIsClassInActiveBundleFalse()
{
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
$this->assertFalse($kernel->isClassInActiveBundle('Not\In\Active\Bundle'));
}
- public function testIsClassInActiveBundleFalseNoNamespace()
+ public function testLegacyIsClassInActiveBundleFalseNoNamespace()
{
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
$this->assertFalse($kernel->isClassInActiveBundle('NotNamespacedClass'));
}
- public function testIsClassInActiveBundleTrue()
+ public function testLegacyIsClassInActiveBundleTrue()
{
$kernel = $this->getKernelMockForIsClassInActiveBundleTest();
@@ -297,6 +297,8 @@ EOF;
protected function getKernelMockForIsClassInActiveBundleTest()
{
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
$bundle = new FooBarBundle();
$kernel = $this->getKernel(array('getBundles'));
diff --git a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php b/src/Symfony/Component/OptionsResolver/Tests/LegacyOptionsResolverTest.php
similarity index 97%
rename from src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php
rename to src/Symfony/Component/OptionsResolver/Tests/LegacyOptionsResolverTest.php
index 064487ff68..840343aa4a 100644
--- a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php
+++ b/src/Symfony/Component/OptionsResolver/Tests/LegacyOptionsResolverTest.php
@@ -14,10 +14,7 @@ namespace Symfony\Component\OptionsResolver\Tests;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\Options;
-/**
- * @deprecated Deprecated since Symfony 2.6, to be removed in Symfony 3.0.
- */
-class OptionsResolverTest extends \PHPUnit_Framework_TestCase
+class LegacyOptionsResolverTest extends \PHPUnit_Framework_TestCase
{
/**
* @var OptionsResolver
@@ -26,6 +23,8 @@ class OptionsResolverTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
$this->resolver = new OptionsResolver();
}
@@ -702,4 +701,16 @@ class OptionsResolverTest extends \PHPUnit_Framework_TestCase
'three' => '3',
), $clone->resolve());
}
+
+ public function testOverloadReturnsThis()
+ {
+ $this->assertSame($this->resolver, $this->resolver->overload('foo', 'bar'));
+ }
+
+ public function testOverloadCallsSet()
+ {
+ $this->resolver->overload('foo', 'bar');
+
+ $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve());
+ }
}
diff --git a/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php b/src/Symfony/Component/OptionsResolver/Tests/LegacyOptionsTest.php
similarity index 98%
rename from src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php
rename to src/Symfony/Component/OptionsResolver/Tests/LegacyOptionsTest.php
index 5d569ebe02..4353c0f49f 100644
--- a/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php
+++ b/src/Symfony/Component/OptionsResolver/Tests/LegacyOptionsTest.php
@@ -14,10 +14,7 @@ namespace Symfony\Component\OptionsResolver\Tests;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
-/**
- * @deprecated Deprecated since Symfony 2.6, to be removed in Symfony 3.0.
- */
-class OptionsTest extends \PHPUnit_Framework_TestCase
+class LegacyOptionsTest extends \PHPUnit_Framework_TestCase
{
/**
* @var OptionsResolver
@@ -26,6 +23,8 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
+ $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED);
+
$this->options = new OptionsResolver();
}
diff --git a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolver2Dot6Test.php b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolver2Dot6Test.php
index 61fc1d9703..5d715c57a4 100644
--- a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolver2Dot6Test.php
+++ b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolver2Dot6Test.php
@@ -113,22 +113,6 @@ class OptionsResolver2Dot6Test extends \PHPUnit_Framework_TestCase
$this->assertTrue($this->resolver->hasDefault('foo'));
}
- ////////////////////////////////////////////////////////////////////////////
- // overload()
- ////////////////////////////////////////////////////////////////////////////
-
- public function testOverloadReturnsThis()
- {
- $this->assertSame($this->resolver, $this->resolver->overload('foo', 'bar'));
- }
-
- public function testOverloadCallsSet()
- {
- $this->resolver->overload('foo', 'bar');
-
- $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve());
- }
-
////////////////////////////////////////////////////////////////////////////
// lazy setDefault()
////////////////////////////////////////////////////////////////////////////
diff --git a/src/Symfony/Component/Security/Core/SecurityContext.php b/src/Symfony/Component/Security/Core/SecurityContext.php
index 545d4cbd85..165c22ada6 100644
--- a/src/Symfony/Component/Security/Core/SecurityContext.php
+++ b/src/Symfony/Component/Security/Core/SecurityContext.php
@@ -70,8 +70,6 @@ class SecurityContext implements SecurityContextInterface
}
/**
- * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use TokenStorageInterface::getToken() instead.
- *
* {@inheritdoc}
*/
public function getToken()
@@ -80,8 +78,6 @@ class SecurityContext implements SecurityContextInterface
}
/**
- * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use TokenStorageInterface::setToken() instead.
- *
* {@inheritdoc}
*/
public function setToken(TokenInterface $token = null)
@@ -90,8 +86,6 @@ class SecurityContext implements SecurityContextInterface
}
/**
- * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use AuthorizationCheckerInterface::isGranted() instead.
- *
* {@inheritdoc}
*/
public function isGranted($attributes, $object = null)
diff --git a/src/Symfony/Component/Security/Tests/Core/SecurityContextInterfaceTest.php b/src/Symfony/Component/Security/Tests/Core/LegacySecurityContextInterfaceTest.php
similarity index 84%
rename from src/Symfony/Component/Security/Tests/Core/SecurityContextInterfaceTest.php
rename to src/Symfony/Component/Security/Tests/Core/LegacySecurityContextInterfaceTest.php
index f65d202888..764a43d37a 100644
--- a/src/Symfony/Component/Security/Tests/Core/SecurityContextInterfaceTest.php
+++ b/src/Symfony/Component/Security/Tests/Core/LegacySecurityContextInterfaceTest.php
@@ -14,15 +14,15 @@ namespace Symfony\Component\Security\Tests\Core;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Security;
-class SecurityContextInterfaceTest extends \PHPUnit_Framework_TestCase
+class LegacySecurityContextInterfaceTest extends \PHPUnit_Framework_TestCase
{
/**
* Test if the BC Layer is working as intended
- *
- * @deprecated Deprecated since version 2.6, to be removed in 3.0.
*/
public function testConstantSync()
{
+ $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED);
+
$this->assertSame(Security::ACCESS_DENIED_ERROR, SecurityContextInterface::ACCESS_DENIED_ERROR);
$this->assertSame(Security::AUTHENTICATION_ERROR, SecurityContextInterface::AUTHENTICATION_ERROR);
$this->assertSame(Security::LAST_USERNAME, SecurityContextInterface::LAST_USERNAME);
diff --git a/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php b/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php
index 24b71e0150..8634ac5ed6 100644
--- a/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php
+++ b/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataTest.php
@@ -270,14 +270,6 @@ class ClassMetadataTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($metadata->isGroupSequenceProvider());
}
- /**
- * https://github.com/symfony/symfony/issues/11604.
- */
- public function testGetMemberMetadatasReturnsEmptyArrayWithoutConfiguredMetadata()
- {
- $this->assertCount(0, $this->metadata->getMemberMetadatas('foo'), '->getMemberMetadatas() returns an empty collection if no metadata is configured for the given property');
- }
-
/**
* https://github.com/symfony/symfony/issues/11604.
*/