From 1d68ad326548b7f8fd991cdbb126961cd26310be Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 2 Jan 2015 17:09:32 +0100 Subject: [PATCH] [2.3] Cleanup deprecations --- .../Doctrine/Tests/DoctrineOrmTestCase.php | 2 +- .../ChoiceList/ORMQueryBuilderLoaderTest.php | 4 +-- .../Form/Type/EntityTypePerformanceTest.php | 4 +-- .../Extension/FormExtensionDivLayoutTest.php | 16 --------- .../FormExtensionTableLayoutTest.php | 16 --------- src/Symfony/Bridge/Twig/composer.json | 2 +- .../Tests/Functional/app/AppKernel.php | 4 --- .../Helper/FormHelperDivLayoutTest.php | 6 +++- .../Helper/FormHelperTableLayoutTest.php | 6 +++- .../Bundle/FrameworkBundle/composer.json | 2 +- .../Tests/Functional/app/AppKernel.php | 4 --- .../Controller/ExceptionControllerTest.php | 2 +- src/Symfony/Bundle/TwigBundle/composer.json | 2 +- .../views/Collector/logger.html.twig | 2 +- .../Console/Tests/ApplicationTest.php | 8 +++-- .../Console/Tests/Command/CommandTest.php | 8 +++-- .../Tests/Input/InputDefinitionTest.php | 10 ++++-- .../Debug/Exception/FatalErrorException.php | 15 ++++++++ .../Debug/Exception/FlattenException.php | 35 ++++++++++++++++++- src/Symfony/Component/Debug/composer.json | 2 +- src/Symfony/Component/Form/ButtonBuilder.php | 6 ++++ .../Form/Test/DeprecationErrorHandler.php | 3 ++ .../Form/Tests/AbstractLayoutTest.php | 13 +++++-- ....php => LegacyBindRequestListenerTest.php} | 21 +++++------ src/Symfony/Component/HttpKernel/CHANGELOG.md | 2 +- .../DataCollector/ExceptionDataCollector.php | 2 +- .../DataCollector/LoggerDataCollector.php | 2 +- .../EventListener/ErrorsLoggerListener.php | 2 +- .../EventListener/ExceptionListener.php | 2 +- .../Exception/FatalErrorException.php | 6 +--- .../HttpKernel/Exception/FlattenException.php | 6 +--- .../DataCollector/ConfigDataCollectorTest.php | 4 --- .../ExceptionDataCollectorTest.php | 2 +- .../DataCollector/LoggerDataCollectorTest.php | 2 +- .../Tests/Fixtures/KernelForTest.php | 4 --- .../Component/HttpKernel/composer.json | 2 +- src/Symfony/Component/Locale/CHANGELOG.md | 6 ++++ .../Component/Locale/Tests/LocaleTest.php | 2 ++ .../Locale/Tests/Stub/StubLocaleTest.php | 5 +-- .../PropertyAccess/PropertyAccess.php | 2 +- .../PropertyAccess/PropertyAccessor.php | 2 +- .../PropertyAccessorInterface.php | 4 +-- .../Routing/Tests/Annotation/RouteTest.php | 9 ++++- .../Routing/Tests/Matcher/UrlMatcherTest.php | 2 +- .../Routing/Tests/RouteCollectionTest.php | 4 +-- .../Component/Routing/Tests/RouteTest.php | 4 ++- src/Symfony/Component/Security/composer.json | 2 +- .../Translation/Tests/TranslatorTest.php | 2 +- 48 files changed, 160 insertions(+), 113 deletions(-) rename src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/{BindRequestListenerTest.php => LegacyBindRequestListenerTest.php} (93%) diff --git a/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php b/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php index a13dd9a0b6..abdade7a05 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php @@ -16,7 +16,7 @@ use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper; /** * Class DoctrineOrmTestCase. * - * @deprecated Deprecated as of Symfony 2.4, to be removed in Symfony 3.0. + * @deprecated Deprecated as of Symfony 2.3, to be removed in Symfony 3.0. * Use {@link DoctrineTestHelper} instead. */ abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php index 13678d6943..bbad668250 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php @@ -12,10 +12,10 @@ namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList; use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader; -use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; +use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper; use Doctrine\DBAL\Connection; -class ORMQueryBuilderLoaderTest extends DoctrineOrmTestCase +class ORMQueryBuilderLoaderTest extends DoctrineTestHelper { /** * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php index 0aff87f3a1..8ec8671ea1 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php @@ -14,7 +14,7 @@ namespace Symfony\Bridge\Doctrine\Tests\Form\Type; use Symfony\Component\Form\Test\FormPerformanceTestCase; use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity; use Doctrine\ORM\Tools\SchemaTool; -use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; +use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper; use Symfony\Component\Form\Extension\Core\CoreExtension; use Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension; @@ -66,7 +66,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase $this->markTestSkipped('Doctrine ORM is not available.'); } - $this->em = DoctrineOrmTestCase::createTestEntityManager(); + $this->em = DoctrineTestHelper::createTestEntityManager(); parent::setUp(); diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php index f0e2cb3f88..4b347fe2ef 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php @@ -30,22 +30,6 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest protected function setUp() { - if (!class_exists('Symfony\Component\Locale\Locale')) { - $this->markTestSkipped('The "Locale" component is not available'); - } - - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - parent::setUp(); $rendererEngine = new TwigRendererEngine(array( diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php index 99a782178a..b5a08e47a5 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php @@ -29,22 +29,6 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest protected function setUp() { - if (!class_exists('Symfony\Component\Locale\Locale')) { - $this->markTestSkipped('The "Locale" component is not available'); - } - - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - parent::setUp(); $rendererEngine = new TwigRendererEngine(array( diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index 558d41cee2..15ba7e416c 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -23,7 +23,7 @@ "symfony/finder": "~2.3", "symfony/form": "~2.3.5", "symfony/http-kernel": "~2.3", - "symfony/locale": "~2.0,>=2.0.5", + "symfony/intl": "~2.3", "symfony/routing": "~2.2", "symfony/templating": "~2.1", "symfony/translation": "~2.2", diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php index 30bfc56a11..b07d44fe22 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php @@ -74,10 +74,6 @@ class AppKernel extends Kernel return include $filename; } - public function init() - { - } - public function getRootDir() { return __DIR__; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php index edf4a5d0eb..17dfbfed1c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php @@ -77,7 +77,11 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest protected function renderEnctype(FormView $view) { - return (string) $this->engine->get('form')->enctype($view); + if (!method_exists($form = $this->engine->get('form'), 'enctype')) { + $this->markTestSkipped(sprintf("Deprecated method %s->enctype() is not implemented.", get_class($form))); + } + + return (string) $form->enctype($view); } protected function renderLabel(FormView $view, $label = null, array $vars = array()) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php index db0809df22..19ca812094 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php @@ -78,7 +78,11 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest protected function renderEnctype(FormView $view) { - return (string) $this->engine->get('form')->enctype($view); + if (!method_exists($form = $this->engine->get('form'), 'enctype')) { + $this->markTestSkipped(sprintf("Deprecated method %s->enctype() is not implemented.", get_class($form))); + } + + return (string) $form->enctype($view); } protected function renderLabel(FormView $view, $label = null, array $vars = array()) diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 17318f23d7..51d3d343e7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -35,7 +35,7 @@ "symfony/css-selector": "~2.0,>=2.0.5", "symfony/dom-crawler": "~2.0,>=2.0.5", "symfony/finder": "~2.0,>=2.0.5", - "symfony/locale": "~2.0,>=2.0.5", + "symfony/intl": "~2.3", "symfony/security": "~2.3", "symfony/form": "~2.3.0,>=2.3.5", "symfony/class-loader": "~2.1", diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php index dfce6e4a6c..977be9162c 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php @@ -74,10 +74,6 @@ class AppKernel extends Kernel return include $filename; } - public function init() - { - } - public function getRootDir() { return __DIR__; diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php index 18523eaa76..20646f74aa 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php @@ -19,7 +19,7 @@ class ExceptionControllerTest extends TestCase { public function testOnlyClearOwnOutputBuffers() { - $flatten = $this->getMock('Symfony\Component\HttpKernel\Exception\FlattenException'); + $flatten = $this->getMock('Symfony\Component\Debug\Exception\FlattenException'); $flatten ->expects($this->once()) ->method('getStatusCode') diff --git a/src/Symfony/Bundle/TwigBundle/composer.json b/src/Symfony/Bundle/TwigBundle/composer.json index 25a1c72a8e..a10f0ba5f9 100644 --- a/src/Symfony/Bundle/TwigBundle/composer.json +++ b/src/Symfony/Bundle/TwigBundle/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=5.3.3", "symfony/twig-bridge": "~2.3,>=2.3.10", - "symfony/http-kernel": "~2.1" + "symfony/http-kernel": "~2.3,>=2.3.24" }, "require-dev": { "symfony/stopwatch": "~2.2", diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig index 74dda4418b..7bed56df66 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -90,7 +90,7 @@ {% macro display_message(log_index, log) %} - {% if constant('Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler::TYPE_DEPRECATION') == log.context.type|default(0) %} + {% if constant('Symfony\\Component\\Debug\\ErrorHandler::TYPE_DEPRECATION') == log.context.type|default(0) %} DEPRECATION - {{ log.message }} {% set id = 'sf-call-stack-' ~ log_index %} diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 179b5c9e4b..d75cdec14f 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -414,8 +414,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase } } - public function testAsText() + public function testLegacyAsText() { + $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $application = new Application(); $application->add(new \FooCommand()); $this->ensureStaticCommandHelp($application); @@ -423,8 +425,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application'); } - public function testAsXml() + public function testLegacyAsXml() { + $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $application = new Application(); $application->add(new \FooCommand()); $this->ensureStaticCommandHelp($application); diff --git a/src/Symfony/Component/Console/Tests/Command/CommandTest.php b/src/Symfony/Component/Console/Tests/Command/CommandTest.php index e23070b3e9..a9455ca71d 100644 --- a/src/Symfony/Component/Console/Tests/Command/CommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/CommandTest.php @@ -318,8 +318,10 @@ class CommandTest extends \PHPUnit_Framework_TestCase $output->writeln('from the code...'); } - public function testAsText() + public function testLegacyAsText() { + $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $command = new \TestCommand(); $command->setApplication(new Application()); $tester = new CommandTester($command); @@ -327,8 +329,10 @@ class CommandTest extends \PHPUnit_Framework_TestCase $this->assertStringEqualsFile(self::$fixturesPath.'/command_astext.txt', $command->asText(), '->asText() returns a text representation of the command'); } - public function testAsXml() + public function testLegacyAsXml() { + $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $command = new \TestCommand(); $command->setApplication(new Application()); $tester = new CommandTester($command); diff --git a/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php b/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php index 5cf5011774..be63311176 100644 --- a/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php +++ b/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php @@ -373,8 +373,10 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase $this->assertEquals('foo1 ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); } - public function testAsText() + public function testLegacyAsText() { + $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $definition = new InputDefinition(array( new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), @@ -388,8 +390,10 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition'); } - public function testAsXml() + public function testLegacyAsXml() { + $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $definition = new InputDefinition(array( new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), @@ -398,7 +402,7 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), )); - $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asText() returns a textual representation of the InputDefinition'); + $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asXml() returns an XML representation of the InputDefinition'); } protected function initializeArguments() diff --git a/src/Symfony/Component/Debug/Exception/FatalErrorException.php b/src/Symfony/Component/Debug/Exception/FatalErrorException.php index bf37ef8098..26c8b9c0a1 100644 --- a/src/Symfony/Component/Debug/Exception/FatalErrorException.php +++ b/src/Symfony/Component/Debug/Exception/FatalErrorException.php @@ -11,11 +11,26 @@ namespace Symfony\Component\Debug\Exception; +use Symfony\Component\HttpKernel\Exception\FatalErrorException as LegacyFatalErrorException; + /** * Fatal Error Exception. * * @author Konstanton Myakshin */ +class FatalErrorException extends LegacyFatalErrorException +{ +} + +namespace Symfony\Component\HttpKernel\Exception; + +/** + * Fatal Error Exception. + * + * @author Konstanton Myakshin + * + * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. + */ class FatalErrorException extends \ErrorException { } diff --git a/src/Symfony/Component/Debug/Exception/FlattenException.php b/src/Symfony/Component/Debug/Exception/FlattenException.php index e12404a61c..5777ec1321 100644 --- a/src/Symfony/Component/Debug/Exception/FlattenException.php +++ b/src/Symfony/Component/Debug/Exception/FlattenException.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Debug\Exception; +use Symfony\Component\HttpKernel\Exception\FlattenException as LegacyFlattenException; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; /** @@ -20,7 +21,7 @@ use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; * * @author Fabien Potencier */ -class FlattenException +class FlattenException extends LegacyFlattenException { private $message; private $code; @@ -278,3 +279,35 @@ class FlattenException return $array['__PHP_Incomplete_Class_Name']; } } + +namespace Symfony\Component\HttpKernel\Exception; + +use Symfony\Component\Debug\Exception\FlattenException as DebugFlattenException; + +/** + * FlattenException wraps a PHP Exception to be able to serialize it. + * + * Basically, this class removes all objects from the trace. + * + * @author Fabien Potencier + * + * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. + */ +class FlattenException +{ + private $handler; + + public static function __callStatic($method, $args) + { + return forward_static_call_array(array('Symfony\Component\Debug\Exception\FlattenException', $method), $args); + } + + public function __call($method, $args) + { + if (!isset($this->handler)) { + $this->handler = new DebugFlattenException(); + } + + return call_user_func_array(array($this->handler, $method), $args); + } +} diff --git a/src/Symfony/Component/Debug/composer.json b/src/Symfony/Component/Debug/composer.json index ae8837acfe..4556180af4 100644 --- a/src/Symfony/Component/Debug/composer.json +++ b/src/Symfony/Component/Debug/composer.json @@ -19,7 +19,7 @@ "php": ">=5.3.3" }, "require-dev": { - "symfony/http-kernel": "~2.2", + "symfony/http-kernel": "~2.3,>=2.3.24", "symfony/http-foundation": "~2.1" }, "suggest": { diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index d881acc3fe..24bc2f8916 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -386,6 +386,9 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface * @param bool $virtual * * @throws BadMethodCallException + * + * @deprecated since version 2.3, to be removed in 3.0. Use + * {@link setInheritData()} instead. */ public function setVirtual($virtual) { @@ -588,6 +591,9 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface * Unsupported method. * * @return bool Always returns false. + * + * @deprecated since version 2.3, to be removed in 3.0. Use + * {@link getInheritData()} instead. */ public function getVirtual() { diff --git a/src/Symfony/Component/Form/Test/DeprecationErrorHandler.php b/src/Symfony/Component/Form/Test/DeprecationErrorHandler.php index 36417f740f..9ee0523177 100644 --- a/src/Symfony/Component/Form/Test/DeprecationErrorHandler.php +++ b/src/Symfony/Component/Form/Test/DeprecationErrorHandler.php @@ -13,6 +13,9 @@ namespace Symfony\Component\Form\Test; use Symfony\Component\Form\FormEvent; +/** + * @deprecated since version 2.3, to be removed in 3.0. + */ class DeprecationErrorHandler { public static function handle($errorNumber, $message, $file, $line, $context) diff --git a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php index 45e18a1841..e05176cf43 100644 --- a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php @@ -101,7 +101,10 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg abstract protected function renderForm(FormView $view, array $vars = array()); - abstract protected function renderEnctype(FormView $view); + protected function renderEnctype(FormView $view) + { + $this->markTestSkipped(sprintf('Legacy %s::renderEnctype() is not implemented.', get_class($this))); + } abstract protected function renderLabel(FormView $view, $label = null, array $vars = array()); @@ -119,8 +122,10 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg abstract protected function setTheme(FormView $view, array $themes); - public function testEnctype() + public function testLegacyEnctype() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $form = $this->factory->createNamedBuilder('name', 'form') ->add('file', 'file') ->getForm(); @@ -128,8 +133,10 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg $this->assertEquals('enctype="multipart/form-data"', $this->renderEnctype($form->createView())); } - public function testNoEnctype() + public function testLegacyNoEnctype() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $form = $this->factory->createNamedBuilder('name', 'form') ->add('text', 'text') ->getForm(); diff --git a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/LegacyBindRequestListenerTest.php similarity index 93% rename from src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php rename to src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/LegacyBindRequestListenerTest.php index 00a93aa264..4f1027f0b1 100644 --- a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/LegacyBindRequestListenerTest.php @@ -15,14 +15,13 @@ use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestLis use Symfony\Component\Form\Form; use Symfony\Component\Form\FormConfigBuilder; use Symfony\Component\Form\FormEvent; -use Symfony\Component\Form\Test\DeprecationErrorHandler; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\File\UploadedFile; /** * @author Bernhard Schussek */ -class BindRequestListenerTest extends \PHPUnit_Framework_TestCase +class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase { private $values; @@ -37,6 +36,8 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $path = tempnam(sys_get_temp_dir(), 'sf2'); touch($path); @@ -102,7 +103,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase $event = new FormEvent($form, $request); $listener = new BindRequestListener(); - DeprecationErrorHandler::preBind($listener, $event); + $listener->preBind($event); $this->assertEquals(array( 'name' => 'Bernhard', @@ -129,7 +130,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase $event = new FormEvent($form, $request); $listener = new BindRequestListener(); - DeprecationErrorHandler::preBind($listener, $event); + $listener->preBind($event); $this->assertEquals(array( 'name' => 'Bernhard', @@ -158,7 +159,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase $event = new FormEvent($form, $request); $listener = new BindRequestListener(); - DeprecationErrorHandler::preBind($listener, $event); + $listener->preBind($event); // Default to empty array $this->assertEquals(array(), $event->getData()); @@ -184,7 +185,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase $event = new FormEvent($form, $request); $listener = new BindRequestListener(); - DeprecationErrorHandler::preBind($listener, $event); + $listener->preBind($event); // Default to null $this->assertNull($event->getData()); @@ -207,7 +208,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase $event = new FormEvent($form, $request); $listener = new BindRequestListener(); - DeprecationErrorHandler::preBind($listener, $event); + $listener->preBind($event); $this->assertEquals(array( 'name' => 'Bernhard', @@ -231,7 +232,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase $event = new FormEvent($form, $request); $listener = new BindRequestListener(); - DeprecationErrorHandler::preBind($listener, $event); + $listener->preBind($event); $this->assertEquals(array( 'name' => 'Bernhard', @@ -257,7 +258,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase $event = new FormEvent($form, $request); $listener = new BindRequestListener(); - DeprecationErrorHandler::preBind($listener, $event); + $listener->preBind($event); $this->assertEquals(array(), $event->getData()); } @@ -279,7 +280,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase $event = new FormEvent($form, $request); $listener = new BindRequestListener(); - DeprecationErrorHandler::preBind($listener, $event); + $listener->preBind($event); $this->assertNull($event->getData()); } diff --git a/src/Symfony/Component/HttpKernel/CHANGELOG.md b/src/Symfony/Component/HttpKernel/CHANGELOG.md index c06dd3fa57..789638d4c3 100644 --- a/src/Symfony/Component/HttpKernel/CHANGELOG.md +++ b/src/Symfony/Component/HttpKernel/CHANGELOG.md @@ -6,7 +6,7 @@ CHANGELOG * [BC BREAK] renamed `Symfony\Component\HttpKernel\EventListener\DeprecationLoggerListener` to `Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener` and changed its constructor * deprecated `Symfony\Component\HttpKernel\Debug\ErrorHandler`, `Symfony\Component\HttpKernel\Debug\ExceptionHandler`, - `Symfony\Component\HttpKernel\Exception\FatalErrorException`, and `Symfony\Component\HttpKernel\Exception\FlattenException` + `Symfony\Component\HttpKernel\Exception\FatalErrorException` and `Symfony\Component\HttpKernel\Exception\FlattenException` * deprecated `Symfony\Component\HttpKernel\Kernel::init()`` * added the possibility to specify an id an extra attributes to hinclude tags * added the collect of data if a controller is a Closure in the Request collector diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php index c9cf964a46..9fe826446b 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php @@ -11,9 +11,9 @@ namespace Symfony\Component\HttpKernel\DataCollector; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\FlattenException; /** * ExceptionDataCollector. diff --git a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php index 64c328cda2..2c0e907ec0 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php @@ -11,8 +11,8 @@ namespace Symfony\Component\HttpKernel\DataCollector; +use Symfony\Component\Debug\ErrorHandler; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpKernel\Debug\ErrorHandler; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; diff --git a/src/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php b/src/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php index 13940ab7ac..ec6b7f9328 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php @@ -12,7 +12,7 @@ namespace Symfony\Component\HttpKernel\EventListener; use Psr\Log\LoggerInterface; -use Symfony\Component\HttpKernel\Debug\ErrorHandler; +use Symfony\Component\Debug\ErrorHandler; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\KernelEvents; diff --git a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php index b621bb2f57..74544a9fd1 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php @@ -12,11 +12,11 @@ namespace Symfony\Component\HttpKernel\EventListener; use Psr\Log\LoggerInterface; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php b/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php index 1f1ef1a276..0e7beda8e2 100644 --- a/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php +++ b/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php @@ -11,8 +11,6 @@ namespace Symfony\Component\HttpKernel\Exception; -use Symfony\Component\Debug\Exception\FatalErrorException as DebugFatalErrorException; - /** * Fatal Error Exception. * @@ -20,6 +18,4 @@ use Symfony\Component\Debug\Exception\FatalErrorException as DebugFatalErrorExce * * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. */ -class FatalErrorException extends DebugFatalErrorException -{ -} +class_exists('Symfony\Component\Debug\Exception\FatalErrorException'); diff --git a/src/Symfony/Component/HttpKernel/Exception/FlattenException.php b/src/Symfony/Component/HttpKernel/Exception/FlattenException.php index 0168afca16..c84b6fa7ae 100644 --- a/src/Symfony/Component/HttpKernel/Exception/FlattenException.php +++ b/src/Symfony/Component/HttpKernel/Exception/FlattenException.php @@ -11,8 +11,6 @@ namespace Symfony\Component\HttpKernel\Exception; -use Symfony\Component\Debug\Exception\FlattenException as DebugFlattenException; - /** * FlattenException wraps a PHP Exception to be able to serialize it. * @@ -22,6 +20,4 @@ use Symfony\Component\Debug\Exception\FlattenException as DebugFlattenException; * * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. */ -class FlattenException extends DebugFlattenException -{ -} +class_exists('Symfony\Component\Debug\Exception\FlattenException'); diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php index 1556155279..45c45a1a29 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php @@ -76,10 +76,6 @@ class KernelForTest extends Kernel { } - public function init() - { - } - public function getBundles() { return array(); diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php index a86a7d69eb..cd1ecac885 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php @@ -11,8 +11,8 @@ namespace Symfony\Component\HttpKernel\Tests\DataCollector; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector; -use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php index 1155326114..ffcbd73ea0 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php @@ -11,8 +11,8 @@ namespace Symfony\Component\HttpKernel\Tests\DataCollector; +use Symfony\Component\Debug\ErrorHandler; use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector; -use Symfony\Component\HttpKernel\Debug\ErrorHandler; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php index 21583ad40a..99203c1f4b 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php @@ -25,10 +25,6 @@ class KernelForTest extends Kernel { } - public function init() - { - } - public function registerBundleDirs() { } diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json index 4959b0beb5..e4024efbed 100644 --- a/src/Symfony/Component/HttpKernel/composer.json +++ b/src/Symfony/Component/HttpKernel/composer.json @@ -19,7 +19,7 @@ "php": ">=5.3.3", "symfony/event-dispatcher": "~2.1", "symfony/http-foundation": "~2.3,>=2.3.4", - "symfony/debug": "~2.3", + "symfony/debug": "~2.3,>=2.3.24", "psr/log": "~1.0" }, "require-dev": { diff --git a/src/Symfony/Component/Locale/CHANGELOG.md b/src/Symfony/Component/Locale/CHANGELOG.md index da55a26728..59b6b35bfa 100644 --- a/src/Symfony/Component/Locale/CHANGELOG.md +++ b/src/Symfony/Component/Locale/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +2.3.0 +----- + +The Locale component is deprecated since version 2.3 and will be removed in +Symfony 3.0. You should use the more capable Intl component instead. + 2.1.0 ----- diff --git a/src/Symfony/Component/Locale/Tests/LocaleTest.php b/src/Symfony/Component/Locale/Tests/LocaleTest.php index 2a64b4a042..9eb3534384 100644 --- a/src/Symfony/Component/Locale/Tests/LocaleTest.php +++ b/src/Symfony/Component/Locale/Tests/LocaleTest.php @@ -23,6 +23,8 @@ class LocaleTest extends \PHPUnit_Framework_TestCase { protected function setUp() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + // Locale extends \Locale, so intl must be present IntlTestHelper::requireIntl($this); } diff --git a/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php b/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php index 9c07cdcfbd..44b5ab7961 100644 --- a/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php +++ b/src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php @@ -21,9 +21,10 @@ class StubLocaleTest extends \PHPUnit_Framework_TestCase { protected function setUp() { - IntlTestHelper::requireIntl($this); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - parent::setUp(); + // Locale extends \Locale, so intl must be present + IntlTestHelper::requireIntl($this); } public function testGetCurrenciesData() diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccess.php b/src/Symfony/Component/PropertyAccess/PropertyAccess.php index 3b234df9d2..582acd1be0 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccess.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccess.php @@ -39,7 +39,7 @@ final class PropertyAccess } /** - * Alias of {@link getPropertyAccessor}. + * Alias of {@link createPropertyAccessor}. * * @return PropertyAccessor The new property accessor * diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php index 2ab676f912..252ad6896d 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php @@ -28,7 +28,7 @@ class PropertyAccessor implements PropertyAccessorInterface /** * Should not be used by application code. Use - * {@link PropertyAccess::getPropertyAccessor()} instead. + * {@link PropertyAccess::createPropertyAccessor()} instead. */ public function __construct($magicCall = false) { diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php b/src/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php index d9dcc65e90..ecedabc134 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php @@ -25,7 +25,7 @@ interface PropertyAccessorInterface * * use Symfony\Component\PropertyAccess\PropertyAccess; * - * $propertyAccessor = PropertyAccess::getPropertyAccessor(); + * $propertyAccessor = PropertyAccess::createPropertyAccessor(); * * echo $propertyAccessor->setValue($object, 'child.name', 'Fabien'); * // equals echo $object->getChild()->setName('Fabien'); @@ -56,7 +56,7 @@ interface PropertyAccessorInterface * * use Symfony\Component\PropertyAccess\PropertyAccess; * - * $propertyAccessor = PropertyAccess::getPropertyAccessor(); + * $propertyAccessor = PropertyAccess::createPropertyAccessor(); * * echo $propertyAccessor->getValue($object, 'child.name); * // equals echo $object->getChild()->getName(); diff --git a/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php b/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php index 50b85e3dd6..5cdf11f491 100644 --- a/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php +++ b/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php @@ -35,7 +35,6 @@ class RouteTest extends \PHPUnit_Framework_TestCase public function getValidParameters() { return array( - array('value', '/Blog', 'getPattern'), array('value', '/Blog', 'getPath'), array('requirements', array('_method' => 'GET'), 'getRequirements'), array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'), @@ -46,4 +45,12 @@ class RouteTest extends \PHPUnit_Framework_TestCase array('host', array('{locale}.example.com'), 'getHost'), ); } + + public function testLegacyGetPattern() + { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + + $route = new Route(array('value' => '/Blog')); + $this->assertEquals($route->getPattern(), '/Blog'); + } } diff --git a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php index 00d452aff7..58a97c5796 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php @@ -340,7 +340,7 @@ class UrlMatcherTest extends \PHPUnit_Framework_TestCase $subColl->add('bar', new Route('/bar')); $subColl->addPrefix('/prefix'); // overwrite the pattern, so the prefix is not valid anymore for this route in the collection - $subColl->get('bar')->setPattern('/new'); + $subColl->get('bar')->setPath('/new'); $coll->addCollection($subColl); diff --git a/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php b/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php index 321ed64b92..badd8752f8 100644 --- a/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php +++ b/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php @@ -150,7 +150,7 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase $collection2->add('bar', $bar = new Route('/bar')); $collection->addCollection($collection2); $collection->addPrefix(' / '); - $this->assertSame('/foo', $collection->get('foo')->getPattern(), '->addPrefix() trims the prefix and a single slash has no effect'); + $this->assertSame('/foo', $collection->get('foo')->getPath(), '->addPrefix() trims the prefix and a single slash has no effect'); $collection->addPrefix('/{admin}', array('admin' => 'admin'), array('admin' => '\d+')); $this->assertEquals('/{admin}/foo', $collection->get('foo')->getPath(), '->addPrefix() adds a prefix to all routes'); $this->assertEquals('/{admin}/bar', $collection->get('bar')->getPath(), '->addPrefix() adds a prefix to all routes'); @@ -159,7 +159,7 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array('admin' => '\d+'), $collection->get('foo')->getRequirements(), '->addPrefix() adds requirements to all routes'); $this->assertEquals(array('admin' => '\d+'), $collection->get('bar')->getRequirements(), '->addPrefix() adds requirements to all routes'); $collection->addPrefix('0'); - $this->assertEquals('/0/{admin}/foo', $collection->get('foo')->getPattern(), '->addPrefix() ensures a prefix must start with a slash and must not end with a slash'); + $this->assertEquals('/0/{admin}/foo', $collection->get('foo')->getPath(), '->addPrefix() ensures a prefix must start with a slash and must not end with a slash'); $collection->addPrefix('/ /'); $this->assertSame('/ /0/{admin}/foo', $collection->get('foo')->getPath(), '->addPrefix() can handle spaces if desired'); $this->assertSame('/ /0/{admin}/bar', $collection->get('bar')->getPath(), 'the route pattern of an added collection is in synch with the added prefix'); diff --git a/src/Symfony/Component/Routing/Tests/RouteTest.php b/src/Symfony/Component/Routing/Tests/RouteTest.php index eef51d17a6..510a3e3f51 100644 --- a/src/Symfony/Component/Routing/Tests/RouteTest.php +++ b/src/Symfony/Component/Routing/Tests/RouteTest.php @@ -201,8 +201,10 @@ class RouteTest extends \PHPUnit_Framework_TestCase $this->assertNotSame($compiled, $route->compile(), '->compile() recompiles if the route was modified'); } - public function testPattern() + public function testLegacyPattern() { + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + $route = new Route('/{foo}'); $this->assertEquals('/{foo}', $route->getPattern()); diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index f253da52c7..15919a4de7 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -23,7 +23,7 @@ }, "require-dev": { "symfony/form": "~2.0,>=2.0.5", - "symfony/locale": "~2.0,>=2.0.5", + "symfony/intl": "~2.3", "symfony/routing": "~2.2", "symfony/validator": "~2.2", "doctrine/common": "~2.2", diff --git a/src/Symfony/Component/Translation/Tests/TranslatorTest.php b/src/Symfony/Component/Translation/Tests/TranslatorTest.php index 5538f4e81e..e1f54979bc 100644 --- a/src/Symfony/Component/Translation/Tests/TranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/TranslatorTest.php @@ -159,7 +159,7 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase $translator = new Translator('fr', new MessageSelector()); $translator->addLoader('array', new ArrayLoader()); - $translator->setFallbackLocale(array('en')); + $translator->setFallbackLocales(array('en')); $translator->addResource('array', array('foo' => 'foofoo'), 'en'); $this->assertEquals('foofoo', $translator->trans('foo'));