diff --git a/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php b/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php index a2c9dea98a..e506352d16 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/AbstractEntityChoiceListTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListTest.php index 18c2832965..2b8bedf15b 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/AbstractEntityChoiceListTest.php @@ -36,22 +36,6 @@ abstract class AbstractEntityChoiceListTest extends AbstractChoiceListTest protected function setUp() { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - $this->em = DoctrineTestHelper::createTestEntityManager(); $schemaTool = new SchemaTool($this->em); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php index e54968ed0d..ebb7ed0e98 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php @@ -36,22 +36,6 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - $this->em = DoctrineTestHelper::createTestEntityManager(); $schemaTool = new SchemaTool($this->em); 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 1146314363..1269812bbf 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; @@ -50,7 +50,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase protected function setUp() { - $this->em = DoctrineOrmTestCase::createTestEntityManager(); + $this->em = DoctrineTestHelper::createTestEntityManager(); parent::setUp(); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php index 5853fc64f3..32b1985cc4 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php @@ -43,22 +43,6 @@ class EntityTypeTest extends TypeTestCase protected function setUp() { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - $this->em = DoctrineTestHelper::createTestEntityManager(); $this->emRegistry = $this->createRegistryMock('default', $this->em); diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/CompatModelChoiceListTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/CompatModelChoiceListTest.php index 0442c585ae..bb61786592 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/CompatModelChoiceListTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/CompatModelChoiceListTest.php @@ -21,23 +21,6 @@ class CompatModelChoiceListTest extends AbstractChoiceListTest protected $item3; protected $item4; - public static function setUpBeforeClass() - { - if (!class_exists('\Propel')) { - self::markTestSkipped('Propel is not available.'); - } - - if (!class_exists('Symfony\Component\Form\Form')) { - self::markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) { - self::markTestSkipped('The "PropertyAccessor" component is not available'); - } - - parent::setUpBeforeClass(); - } - public function testGetChoicesForValues() { $this->query diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php index 5939630082..3b2ea0a8d2 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php @@ -22,19 +22,6 @@ class ModelChoiceListTest extends Propel1TestCase { const ITEM_CLASS = '\Symfony\Bridge\Propel1\Tests\Fixtures\Item'; - public static function setUpBeforeClass() - { - parent::setUpBeforeClass(); - - if (!class_exists('Symfony\Component\Form\Form')) { - self::markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccessor')) { - self::markTestSkipped('The "PropertyAccessor" component is not available'); - } - } - protected function setUp() { ItemQuery::$result = array(); diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json index d4bad46029..75f1128ca0 100644 --- a/src/Symfony/Bridge/Twig/composer.json +++ b/src/Symfony/Bridge/Twig/composer.json @@ -24,7 +24,7 @@ "symfony/finder": "~2.3", "symfony/form": "~2.5.2", "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 2fbff686fc..e3aa53bd8d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php @@ -64,7 +64,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 c95442bed6..6568b81fad 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php @@ -65,7 +65,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 e6a3b644a8..90e1fae25a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -37,7 +37,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.4", "symfony/form": "2.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 0cdd44ba4d..80c5fe1560 100644 --- a/src/Symfony/Bundle/TwigBundle/composer.json +++ b/src/Symfony/Bundle/TwigBundle/composer.json @@ -19,7 +19,7 @@ "php": ">=5.3.3", "symfony/twig-bridge": "~2.5", "symfony/http-foundation": "~2.5", - "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 e2d7d5faae..31975101ee 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -105,7 +105,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 1d85d7be25..401f19aaae 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -480,8 +480,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); @@ -489,8 +491,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 d5b58468c9..a58f855cdb 100644 --- a/src/Symfony/Component/Debug/Exception/FatalErrorException.php +++ b/src/Symfony/Component/Debug/Exception/FatalErrorException.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Debug\Exception; +use Symfony\Component\HttpKernel\Exception\FatalErrorException as LegacyFatalErrorException; + /** * Fatal Error Exception. * @@ -18,6 +20,19 @@ namespace Symfony\Component\Debug\Exception; * @author Konstanton Myakshin * @author Nicolas Grekas */ +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 { public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true) diff --git a/src/Symfony/Component/Debug/Exception/FlattenException.php b/src/Symfony/Component/Debug/Exception/FlattenException.php index 100b2a2670..75bd2b1df7 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; @@ -249,3 +250,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 9c95429b5c..50deec4913 100644 --- a/src/Symfony/Component/Debug/composer.json +++ b/src/Symfony/Component/Debug/composer.json @@ -20,7 +20,7 @@ }, "require-dev": { "symfony/class-loader": "~2.2", - "symfony/http-kernel": "~2.2", + "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2", "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 e8eeec6e75..fe31e8b4c5 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 92% 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 89b599e038..183d3a7a3a 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); @@ -98,7 +99,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', @@ -121,7 +122,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', @@ -146,7 +147,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()); @@ -168,7 +169,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()); @@ -187,7 +188,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', @@ -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', @@ -229,7 +230,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()); } @@ -247,7 +248,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/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php index fdaab2f2f8..61b2a917ec 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php @@ -50,10 +50,6 @@ class ValidatorTypeGuesserTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\Validator\Constraint')) { - $this->markTestSkipped('The "Validator" component is not available'); - } - $this->metadata = new ClassMetadata(self::TEST_CLASS); $this->metadataFactory = $this->getMock('Symfony\Component\Validator\MetadataFactoryInterface'); $this->metadataFactory->expects($this->any()) diff --git a/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php b/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php index cb2fd090ba..ebb83a8333 100644 --- a/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php +++ b/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php @@ -57,10 +57,6 @@ class ResolvedFormTypeTest extends \PHPUnit_Framework_TestCase public function testGetOptionsResolver() { - if (version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<')) { - $this->markTestSkipped('This test requires PHPUnit 3.7.'); - } - $test = $this; $i = 0; diff --git a/src/Symfony/Component/HttpKernel/CHANGELOG.md b/src/Symfony/Component/HttpKernel/CHANGELOG.md index 2b2e827d97..54d019974a 100644 --- a/src/Symfony/Component/HttpKernel/CHANGELOG.md +++ b/src/Symfony/Component/HttpKernel/CHANGELOG.md @@ -17,7 +17,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/EventListener/ExceptionListener.php b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php index 7f06bb288c..5b0ec0ec50 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php @@ -12,12 +12,12 @@ namespace Symfony\Component\HttpKernel\EventListener; use Psr\Log\LoggerInterface; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpFoundation\Request; 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 401f1438ea..0d672a1f0c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php @@ -69,10 +69,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 517e326685..6c71f4c9eb 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 cdb06af9ff..1279fb83cd 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; class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase { diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php index d128753ffa..ecc4eb0276 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php @@ -67,10 +67,6 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase public function testRouterResetWithParentRequestOnKernelFinishRequest() { - if (!class_exists('Symfony\Component\Routing\Router')) { - $this->markTestSkipped('The "Routing" component is not available'); - } - // the request context is updated $context = $this->getMock('Symfony\Component\Routing\RequestContext'); $context->expects($this->once())->method('setParameter')->with('_locale', 'es'); diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index 4a8bdf238e..67f91e48bd 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -194,11 +194,6 @@ class KernelTest extends \PHPUnit_Framework_TestCase public function testStripComments() { - if (!function_exists('token_get_all')) { - $this->markTestSkipped('The function token_get_all() is not available.'); - - return; - } $source = <<<'EOF' markTestSkipped('The "HttpFoundation" component is not available'); - } - if (!class_exists('SQLite3') && (!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/composer.json b/src/Symfony/Component/HttpKernel/composer.json index 679d5d2ce4..6efeed3971 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.5.9|~2.6,>=2.6.2", "symfony/http-foundation": "~2.5", - "symfony/debug": "~2.5", + "symfony/debug": "~2.5.9|~2.6,>=2.6.2", "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 a8a375a133..149c4c7a95 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/PropertyAccessorInterface.php b/src/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php index dbd3053b0f..be41ee175d 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'); @@ -57,7 +57,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 bd0167089e..cc082dd626 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'), @@ -47,4 +46,12 @@ class RouteTest extends \PHPUnit_Framework_TestCase array('condition', array('context.getMethod() == "GET"'), 'getCondition'), ); } + + 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 7fa699e569..1e10367e0c 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php @@ -363,7 +363,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 4c12ed56df..ad2d0e0f2f 100644 --- a/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php +++ b/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php @@ -146,7 +146,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'); @@ -155,7 +155,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 f667c0bad8..02ca4f4590 100644 --- a/src/Symfony/Component/Routing/Tests/RouteTest.php +++ b/src/Symfony/Component/Routing/Tests/RouteTest.php @@ -218,8 +218,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/Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php index 1fb7350c6c..7b24e611bf 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php @@ -55,10 +55,6 @@ class AnonymousAuthenticationListenerTest extends \PHPUnit_Framework_TestCase public function testHandledEventIsLogged() { - if (!interface_exists('Psr\Log\LoggerInterface')) { - $this->markTestSkipped('The "LoggerInterface" is not available'); - } - $context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); $logger = $this->getMock('Psr\Log\LoggerInterface'); $logger->expects($this->once()) diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index 42eedd53a4..bd323fac08 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -28,7 +28,7 @@ "symfony/security-http": "self.version" }, "require-dev": { - "symfony/locale": "~2.0,>=2.0.5", + "symfony/intl": "~2.3", "symfony/routing": "~2.2", "symfony/translation": "~2.0,>=2.0.5", "symfony/validator": "~2.5,>=2.5.5", diff --git a/src/Symfony/Component/Translation/Tests/TranslatorTest.php b/src/Symfony/Component/Translation/Tests/TranslatorTest.php index 9bceaf31d7..8f5a6d3319 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'); $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')); diff --git a/src/Symfony/Component/Validator/Tests/bootstrap.php b/src/Symfony/Component/Validator/Tests/bootstrap.php new file mode 100644 index 0000000000..8977ca9e86 --- /dev/null +++ b/src/Symfony/Component/Validator/Tests/bootstrap.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +$loader = require __DIR__.'/../vendor/autoload.php'; + +Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(function ($class) {return class_exists($class);}); diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index f732c02d4e..43b2e7f7bf 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -20,6 +20,7 @@ "symfony/translation": "~2.0,>=2.0.5" }, "require-dev": { + "doctrine/common": "~2.3", "symfony/http-foundation": "~2.1", "symfony/intl": "~2.3", "symfony/yaml": "~2.0,>=2.0.5", diff --git a/src/Symfony/Component/Validator/phpunit.xml.dist b/src/Symfony/Component/Validator/phpunit.xml.dist index c02d118721..d9851a797b 100644 --- a/src/Symfony/Component/Validator/phpunit.xml.dist +++ b/src/Symfony/Component/Validator/phpunit.xml.dist @@ -4,7 +4,7 @@ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" backupGlobals="false" colors="true" - bootstrap="vendor/autoload.php" + bootstrap="Tests/bootstrap.php" >