From 1d68ad326548b7f8fd991cdbb126961cd26310be Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 2 Jan 2015 17:09:32 +0100 Subject: [PATCH 01/13] [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')); From 29b217cf219a7f8f4dec569071a699fa8a44b6c2 Mon Sep 17 00:00:00 2001 From: nyro Date: Tue, 25 Nov 2014 17:19:30 +0100 Subject: [PATCH 02/13] [HttpKernel] Fix UriSigner::check when _hash is not at the end of the uri --- .../HttpKernel/Tests/UriSignerTest.php | 2 + .../Component/HttpKernel/UriSigner.php | 41 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Tests/UriSignerTest.php b/src/Symfony/Component/HttpKernel/Tests/UriSignerTest.php index 8ffc2bfbbd..b66014d849 100644 --- a/src/Symfony/Component/HttpKernel/Tests/UriSignerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/UriSignerTest.php @@ -33,5 +33,7 @@ class UriSignerTest extends \PHPUnit_Framework_TestCase $this->assertTrue($signer->check($signer->sign('http://example.com/foo'))); $this->assertTrue($signer->check($signer->sign('http://example.com/foo?foo=bar'))); + + $this->assertTrue($signer->sign('http://example.com/foo?foo=bar&bar=foo') === $signer->sign('http://example.com/foo?bar=foo&foo=bar')); } } diff --git a/src/Symfony/Component/HttpKernel/UriSigner.php b/src/Symfony/Component/HttpKernel/UriSigner.php index 199116b4c6..0f49487f05 100644 --- a/src/Symfony/Component/HttpKernel/UriSigner.php +++ b/src/Symfony/Component/HttpKernel/UriSigner.php @@ -42,6 +42,15 @@ class UriSigner */ public function sign($uri) { + $url = parse_url($uri); + if (isset($url['query'])) { + parse_str($url['query'], $params); + } else { + $params = array(); + } + + $uri = $this->buildUrl($url, $params); + return $uri.(false === (strpos($uri, '?')) ? '?' : '&').'_hash='.$this->computeHash($uri); } @@ -58,15 +67,43 @@ class UriSigner */ public function check($uri) { - if (!preg_match('/^(.*)(?:\?|&)_hash=(.+?)$/', $uri, $matches)) { + $url = parse_url($uri); + if (isset($url['query'])) { + parse_str($url['query'], $params); + } else { + $params = array(); + } + + if (empty($params['_hash'])) { return false; } - return $this->computeHash($matches[1]) === $matches[2]; + $hash = urlencode($params['_hash']); + unset($params['_hash']); + + return $this->computeHash($this->buildUrl($url, $params)) === $hash; } private function computeHash($uri) { return urlencode(base64_encode(hash_hmac('sha1', $uri, $this->secret, true))); } + + private function buildUrl(array $url, array $params = array()) + { + ksort($params); + $url['query'] = http_build_query($params); + + $scheme = isset($url['scheme']) ? $url['scheme'].'://' : ''; + $host = isset($url['host']) ? $url['host'] : ''; + $port = isset($url['port']) ? ':'.$url['port'] : ''; + $user = isset($url['user']) ? $url['user'] : ''; + $pass = isset($url['pass']) ? ':'.$url['pass'] : ''; + $pass = ($user || $pass) ? "$pass@" : ''; + $path = isset($url['path']) ? $url['path'] : ''; + $query = isset($url['query']) && $url['query'] ? '?'.$url['query'] : ''; + $fragment = isset($url['fragment']) ? '#'.$url['fragment'] : ''; + + return $scheme.$user.$pass.$host.$port.$path.$query.$fragment; + } } From 064062dff3a17fde810ff2fb1dc1c1739cbc1265 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 3 Jan 2015 10:49:59 +0100 Subject: [PATCH 03/13] [Security] fixed wrong phpdoc --- .../Security/Core/Authentication/Token/TokenInterface.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php b/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php index fb9fd1406f..be90802a9b 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php @@ -47,8 +47,10 @@ interface TokenInterface extends \Serializable /** * Returns a user representation. * - * @return mixed either returns an object which implements __toString(), or - * a primitive string is returned. + * @return mixed Can be a UserInterface instance, an object implementing a __toString method, + * or the username as a regular string + * + * @see AbstractToken::setUser() */ public function getUser(); From 119b0917dc49a63b2f4efe726d2c5330cf043424 Mon Sep 17 00:00:00 2001 From: blanchonvincent Date: Sun, 16 Nov 2014 14:48:58 +0100 Subject: [PATCH 04/13] [Security] Don't send remember cookie for sub request --- .../Http/RememberMe/ResponseListener.php | 4 ++++ .../Http/RememberMe/ResponseListenerTest.php | 22 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php b/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php index 2253c5d163..4149fb6d85 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php +++ b/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php @@ -27,6 +27,10 @@ class ResponseListener implements EventSubscriberInterface */ public function onKernelResponse(FilterResponseEvent $event) { + if (!$event->isMasterRequest()) { + return; + } + $request = $event->getRequest(); $response = $event->getResponse(); diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php index 59e5fe267f..074172c2ed 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Security\Tests\Http\RememberMe; +use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\Security\Http\RememberMe\ResponseListener; use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface; use Symfony\Component\HttpFoundation\Request; @@ -41,7 +42,22 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase $listener->onKernelResponse($this->getEvent($request, $response)); } - public function testRemmeberMeCookieIsNotSendWithResponse() + public function testRememberMeCookieIsNotSendWithResponseForSubRequests() + { + $cookie = new Cookie('rememberme'); + + $request = $this->getRequest(array( + RememberMeServicesInterface::COOKIE_ATTR_NAME => $cookie, + )); + + $response = $this->getResponse(); + $response->headers->expects($this->never())->method('setCookie'); + + $listener = new ResponseListener(); + $listener->onKernelResponse($this->getEvent($request, $response, HttpKernelInterface::SUB_REQUEST)); + } + + public function testRememberMeCookieIsNotSendWithResponse() { $request = $this->getRequest(); @@ -78,13 +94,15 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase return $response; } - private function getEvent($request, $response) + private function getEvent($request, $response, $type = HttpKernelInterface::MASTER_REQUEST) { $event = $this->getMockBuilder('Symfony\Component\HttpKernel\Event\FilterResponseEvent') ->disableOriginalConstructor() ->getMock(); $event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); + $event->expects($this->any())->method('getRequestType')->will($this->returnValue($type)); + $event->expects($this->any())->method('isMasterRequest')->will($this->returnValue($type === HttpKernelInterface::MASTER_REQUEST)); $event->expects($this->any())->method('getResponse')->will($this->returnValue($response)); return $event; From ec38936fbfb418c3c230316538b9bc3329476eff Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 3 Jan 2015 11:25:34 +0100 Subject: [PATCH 05/13] adapted previous commit for 2.3 --- .../Component/Security/Http/RememberMe/ResponseListener.php | 3 ++- .../Security/Tests/Http/RememberMe/ResponseListenerTest.php | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php b/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php index 4149fb6d85..ec5f00616f 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php +++ b/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Http\RememberMe; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -27,7 +28,7 @@ class ResponseListener implements EventSubscriberInterface */ public function onKernelResponse(FilterResponseEvent $event) { - if (!$event->isMasterRequest()) { + if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { return; } diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php index 074172c2ed..011f38a346 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php @@ -102,7 +102,6 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase $event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); $event->expects($this->any())->method('getRequestType')->will($this->returnValue($type)); - $event->expects($this->any())->method('isMasterRequest')->will($this->returnValue($type === HttpKernelInterface::MASTER_REQUEST)); $event->expects($this->any())->method('getResponse')->will($this->returnValue($response)); return $event; From 27176d9b3d1afd71e222ff844517aa12e95ffe03 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 3 Jan 2015 11:28:05 +0100 Subject: [PATCH 06/13] adapted merge to 2.5 --- .../Component/Security/Http/RememberMe/ResponseListener.php | 3 +-- .../Security/Http/Tests/RememberMe/ResponseListenerTest.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php b/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php index ec5f00616f..4149fb6d85 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php +++ b/src/Symfony/Component/Security/Http/RememberMe/ResponseListener.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Security\Http\RememberMe; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -28,7 +27,7 @@ class ResponseListener implements EventSubscriberInterface */ public function onKernelResponse(FilterResponseEvent $event) { - if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { + if (!$event->isMasterRequest()) { return; } diff --git a/src/Symfony/Component/Security/Http/Tests/RememberMe/ResponseListenerTest.php b/src/Symfony/Component/Security/Http/Tests/RememberMe/ResponseListenerTest.php index 3dcca702f3..78de8e4d54 100644 --- a/src/Symfony/Component/Security/Http/Tests/RememberMe/ResponseListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/RememberMe/ResponseListenerTest.php @@ -94,7 +94,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase ->getMock(); $event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); - $event->expects($this->any())->method('getRequestType')->will($this->returnValue($type)); + $event->expects($this->any())->method('isMasterRequest')->will($this->returnValue($type === HttpKernelInterface::MASTER_REQUEST)); $event->expects($this->any())->method('getResponse')->will($this->returnValue($response)); return $event; From ad0d93baf40d6abe2cb9e5aa6a95b48fd55c7ccf Mon Sep 17 00:00:00 2001 From: Artiom Date: Sat, 3 Jan 2015 00:54:17 +0200 Subject: [PATCH 07/13] simplify hasScheme method ... and correct the mistake in docblock --- src/Symfony/Component/Routing/Route.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index d224d79108..c362f17e46 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -251,11 +251,23 @@ class Route implements \Serializable return $this; } + /** + * Checks if a scheme requirement has been set. + * + * @param string $scheme + * + * @return bool true if the scheme requirement exists, otherwise false + */ + public function hasScheme($scheme) + { + return in_array(strtolower($scheme), $this->schemes, true); + } + /** * Returns the uppercased HTTP methods this route is restricted to. * So an empty array means that any method is allowed. * - * @return array The schemes + * @return array The methods */ public function getMethods() { From 24a287f492d88cd3d12e5cf9667aedbbb0c5cbb6 Mon Sep 17 00:00:00 2001 From: Joshua Thijssen Date: Fri, 2 Jan 2015 11:04:57 +0100 Subject: [PATCH 08/13] Don't add Accept-Range header on unsafe HTTP requests --- .../HttpFoundation/BinaryFileResponse.php | 6 +++++- .../Tests/BinaryFileResponseTest.php | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php b/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php index 164414a323..bcb4d7077b 100644 --- a/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php +++ b/src/Symfony/Component/HttpFoundation/BinaryFileResponse.php @@ -169,7 +169,11 @@ class BinaryFileResponse extends Response public function prepare(Request $request) { $this->headers->set('Content-Length', $this->file->getSize()); - $this->headers->set('Accept-Ranges', 'bytes'); + + if (!$this->headers->has('Accept-Ranges')) { + // Only accept ranges on safe HTTP methods + $this->headers->set('Accept-Ranges', $request->isMethodSafe() ? 'bytes' : 'none'); + } if (!$this->headers->has('Content-Type')) { $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream'); diff --git a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php index 1afd98759a..631f25ff1d 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php @@ -200,6 +200,25 @@ class BinaryFileResponseTest extends ResponseTestCase $this->assertEquals(realpath($response->getFile()->getPathname()), realpath($filePath)); } + public function testAcceptRangeOnUnsafeMethods() + { + $request = Request::create('/', 'POST'); + $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif'); + $response->prepare($request); + + $this->assertEquals('none', $response->headers->get('Accept-Ranges')); + } + + public function testAcceptRangeNotOverriden() + { + $request = Request::create('/', 'POST'); + $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif'); + $response->headers->set('Accept-Ranges', 'foo'); + $response->prepare($request); + + $this->assertEquals('foo', $response->headers->get('Accept-Ranges')); + } + public function getSampleXAccelMappings() { return array( From bab98f00f94c110687aad5105a8379ca090d0eb9 Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Sat, 3 Jan 2015 11:27:34 +0100 Subject: [PATCH 09/13] [Yaml] Update README.md The ability to pass file names to Yaml::parse() was deprecated in 2.2 and will be removed in 3.0. So show an up-to-date example. --- src/Symfony/Component/Yaml/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Yaml/README.md b/src/Symfony/Component/Yaml/README.md index 50f9e09488..96abbbfd16 100644 --- a/src/Symfony/Component/Yaml/README.md +++ b/src/Symfony/Component/Yaml/README.md @@ -6,7 +6,7 @@ YAML implements most of the YAML 1.2 specification. ```php use Symfony\Component\Yaml\Yaml; -$array = Yaml::parse($file); +$array = Yaml::parse(file_get_contents(filename)); print Yaml::dump($array); ``` From 75df4a6c50ca146bedbf06420b196f5ce2f4127c Mon Sep 17 00:00:00 2001 From: wusuopu Date: Tue, 4 Nov 2014 09:41:22 +0800 Subject: [PATCH 10/13] [HttpFoundation] Fix an issue caused by php's Bug #66606. --- src/Symfony/Component/HttpFoundation/Request.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 4544c090e5..f532e28a47 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -260,7 +260,20 @@ class Request */ public static function createFromGlobals() { - $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); + // With the php's bug #66606, the php's built-in web server + // stores the Content-Type and Content-Length header values in + // HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH fields. + $server = $_SERVER; + if ('cli-server' === php_sapi_name()) { + if (array_key_exists('HTTP_CONTENT_LENGTH', $_SERVER)) { + $server['CONTENT_LENGTH'] = $_SERVER['HTTP_CONTENT_LENGTH']; + } + if (array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) { + $server['CONTENT_TYPE'] = $_SERVER['HTTP_CONTENT_TYPE']; + } + } + + $request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $server); if (0 === strpos($request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded') && in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH')) From 00d3a5a782d0a5789bd3530452b667ec7a4ebf82 Mon Sep 17 00:00:00 2001 From: Hugo Hamon Date: Fri, 2 Jan 2015 19:20:40 +0100 Subject: [PATCH 11/13] [ClassLoader] added missing deprecation notice. --- src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php | 2 ++ src/Symfony/Component/ClassLoader/CHANGELOG.md | 3 +++ .../Component/ClassLoader/DebugUniversalClassLoader.php | 2 ++ src/Symfony/Component/ClassLoader/UniversalClassLoader.php | 2 ++ 4 files changed, 9 insertions(+) diff --git a/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php b/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php index 4fdf39b222..65b7b10b23 100644 --- a/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php +++ b/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php @@ -59,6 +59,8 @@ namespace Symfony\Component\ClassLoader; * @author Kris Wallsmith * * @api + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the ApcClassLoader class instead. */ class ApcUniversalClassLoader extends UniversalClassLoader { diff --git a/src/Symfony/Component/ClassLoader/CHANGELOG.md b/src/Symfony/Component/ClassLoader/CHANGELOG.md index b770166735..64660a8768 100644 --- a/src/Symfony/Component/ClassLoader/CHANGELOG.md +++ b/src/Symfony/Component/ClassLoader/CHANGELOG.md @@ -4,6 +4,9 @@ CHANGELOG 2.4.0 ----- + * deprecated the UniversalClassLoader in favor of the ClassLoader class instead + * deprecated the ApcUniversalClassLoader in favor of the ApcClassLoader class instead + * deprecated the DebugUniversalClassLoader in favor of the DebugClassLoader class from the Debug component * deprecated the DebugClassLoader as it has been moved to the Debug component instead 2.3.0 diff --git a/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php b/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php index 678f4e8b2a..40d847c178 100644 --- a/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php +++ b/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php @@ -15,6 +15,8 @@ namespace Symfony\Component\ClassLoader; * Checks that the class is actually declared in the included file. * * @author Fabien Potencier + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the DebugClassLoader provided by the Debug component instead. */ class DebugUniversalClassLoader extends UniversalClassLoader { diff --git a/src/Symfony/Component/ClassLoader/UniversalClassLoader.php b/src/Symfony/Component/ClassLoader/UniversalClassLoader.php index e5165dcf14..b664cab7cb 100644 --- a/src/Symfony/Component/ClassLoader/UniversalClassLoader.php +++ b/src/Symfony/Component/ClassLoader/UniversalClassLoader.php @@ -57,6 +57,8 @@ namespace Symfony\Component\ClassLoader; * @author Fabien Potencier * * @api + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the ClassLoader class instead. */ class UniversalClassLoader { From 57bd8981980b69be00c96558d9fb6fbd244e297e Mon Sep 17 00:00:00 2001 From: Hugo Hamon Date: Fri, 2 Jan 2015 18:59:49 +0100 Subject: [PATCH 12/13] [ClassLoader] removes deprecated classes from documentation. --- .../Component/ClassLoader/ApcClassLoader.php | 12 +++++- src/Symfony/Component/ClassLoader/README.md | 40 ++++++++++--------- .../ClassLoader/WinCacheClassLoader.php | 12 +++++- .../ClassLoader/XcacheClassLoader.php | 12 +++++- 4 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src/Symfony/Component/ClassLoader/ApcClassLoader.php b/src/Symfony/Component/ClassLoader/ApcClassLoader.php index 366cb67f14..48de72f1b1 100644 --- a/src/Symfony/Component/ClassLoader/ApcClassLoader.php +++ b/src/Symfony/Component/ClassLoader/ApcClassLoader.php @@ -17,11 +17,19 @@ namespace Symfony\Component\ClassLoader; * It expects an object implementing a findFile method to find the file. This * allows using it as a wrapper around the other loaders of the component (the * ClassLoader and the UniversalClassLoader for instance) but also around any - * other autoloader following this convention (the Composer one for instance) + * other autoloaders following this convention (the Composer one for instance). + * + * // with a Symfony autoloader + * use Symfony\Component\ClassLoader\ClassLoader; * * $loader = new ClassLoader(); + * $loader->addPrefix('Symfony\Component', __DIR__.'/component'); + * $loader->addPrefix('Symfony', __DIR__.'/framework'); * - * // register classes with namespaces + * // or with a Composer autoloader + * use Composer\Autoload\ClassLoader; + * + * $loader = new ClassLoader(); * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * diff --git a/src/Symfony/Component/ClassLoader/README.md b/src/Symfony/Component/ClassLoader/README.md index d673688551..37df048699 100644 --- a/src/Symfony/Component/ClassLoader/README.md +++ b/src/Symfony/Component/ClassLoader/README.md @@ -4,34 +4,34 @@ ClassLoader Component ClassLoader loads your project classes automatically if they follow some standard PHP conventions. -The Universal ClassLoader is able to autoload classes that implement the PSR-0 +The ClassLoader object is able to autoload classes that implement the PSR-0 standard or the PEAR naming convention. First, register the autoloader: ```php -require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; +require_once __DIR__.'/src/Symfony/Component/ClassLoader/ClassLoader.php'; -use Symfony\Component\ClassLoader\UniversalClassLoader; +use Symfony\Component\ClassLoader\ClassLoader; -$loader = new UniversalClassLoader(); +$loader = new ClassLoader(); $loader->register(); ``` -Then, register some namespaces with the `registerNamespace()` method: +Then, register some namespaces with the `addPrefix()` method: ```php -$loader->registerNamespace('Symfony', __DIR__.'/src'); -$loader->registerNamespace('Monolog', __DIR__.'/vendor/monolog/src'); +$loader->addPrefix('Symfony', __DIR__.'/src'); +$loader->addPrefix('Monolog', __DIR__.'/vendor/monolog/src'); ``` -The `registerNamespace()` method takes a namespace prefix and a path where to +The `addPrefix()` method takes a namespace prefix and a path where to look for the classes as arguments. You can also register a sub-namespaces: ```php -$loader->registerNamespace('Doctrine\\Common', __DIR__.'/vendor/doctrine-common/lib'); +$loader->addPrefix('Doctrine\\Common', __DIR__.'/vendor/doctrine-common/lib'); ``` The order of registration is significant and the first registered namespace @@ -40,14 +40,14 @@ takes precedence over later registered one. You can also register more than one path for a given namespace: ```php -$loader->registerNamespace('Symfony', array(__DIR__.'/src', __DIR__.'/symfony/src')); +$loader->addPrefix('Symfony', array(__DIR__.'/src', __DIR__.'/symfony/src')); ``` -Alternatively, you can use the `registerNamespaces()` method to register more +Alternatively, you can use the `addPrefixes()` method to register more than one namespace at once: ```php -$loader->registerNamespaces(array( +$loader->addPrefixes(array( 'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'), 'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib', 'Doctrine' => __DIR__.'/vendor/doctrine/lib', @@ -55,16 +55,20 @@ $loader->registerNamespaces(array( )); ``` -For better performance, you can use the APC based version of the universal -class loader: +For better performance, you can use the APC class loader: ```php -require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; -require_once __DIR__.'/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php'; +require_once __DIR__.'/src/Symfony/Component/ClassLoader/ClassLoader.php'; +require_once __DIR__.'/src/Symfony/Component/ClassLoader/ApcClassLoader.php'; -use Symfony\Component\ClassLoader\ApcUniversalClassLoader; +use Symfony\Component\ClassLoader\ClassLoader; +use Symfony\Component\ClassLoader\ApcClassLoader; -$loader = new ApcUniversalClassLoader('apc.prefix.'); +$loader = new ClassLoader(); +$loader->addPrefix('Symfony', __DIR__.'/src'); + +$loader = new ApcClassLoader('apc.prefix.', $loader); +$loader->register(); ``` Furthermore, the component provides tools to aggregate classes into a single diff --git a/src/Symfony/Component/ClassLoader/WinCacheClassLoader.php b/src/Symfony/Component/ClassLoader/WinCacheClassLoader.php index 74a5512151..0fc11d019f 100644 --- a/src/Symfony/Component/ClassLoader/WinCacheClassLoader.php +++ b/src/Symfony/Component/ClassLoader/WinCacheClassLoader.php @@ -17,11 +17,19 @@ namespace Symfony\Component\ClassLoader; * It expects an object implementing a findFile method to find the file. This * allow using it as a wrapper around the other loaders of the component (the * ClassLoader and the UniversalClassLoader for instance) but also around any - * other autoloader following this convention (the Composer one for instance) + * other autoloaders following this convention (the Composer one for instance). + * + * // with a Symfony autoloader + * use Symfony\Component\ClassLoader\ClassLoader; * * $loader = new ClassLoader(); + * $loader->addPrefix('Symfony\Component', __DIR__.'/component'); + * $loader->addPrefix('Symfony', __DIR__.'/framework'); * - * // register classes with namespaces + * // or with a Composer autoloader + * use Composer\Autoload\ClassLoader; + * + * $loader = new ClassLoader(); * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * diff --git a/src/Symfony/Component/ClassLoader/XcacheClassLoader.php b/src/Symfony/Component/ClassLoader/XcacheClassLoader.php index 61ec4b773a..19c130349a 100644 --- a/src/Symfony/Component/ClassLoader/XcacheClassLoader.php +++ b/src/Symfony/Component/ClassLoader/XcacheClassLoader.php @@ -17,11 +17,19 @@ namespace Symfony\Component\ClassLoader; * It expects an object implementing a findFile method to find the file. This * allows using it as a wrapper around the other loaders of the component (the * ClassLoader and the UniversalClassLoader for instance) but also around any - * other autoloader following this convention (the Composer one for instance) + * other autoloaders following this convention (the Composer one for instance). + * + * // with a Symfony autoloader + * use Symfony\Component\ClassLoader\ClassLoader; * * $loader = new ClassLoader(); + * $loader->addPrefix('Symfony\Component', __DIR__.'/component'); + * $loader->addPrefix('Symfony', __DIR__.'/framework'); * - * // register classes with namespaces + * // or with a Composer autoloader + * use Composer\Autoload\ClassLoader; + * + * $loader = new ClassLoader(); * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * From d649befa672e1a38dd7bcfdaebf3d2b60a6bf2e4 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 3 Jan 2015 10:53:32 +0100 Subject: [PATCH 13/13] [2.3] Remove useless tests skips --- .../Tests/ContainerAwareEventManagerTest.php | 4 --- .../DoctrineDataCollectorTest.php | 11 ------ .../DataFixtures/ContainerAwareLoaderTest.php | 11 ------ ...erEventListenersAndSubscribersPassTest.php | 7 ---- .../Doctrine/Tests/DoctrineOrmTestCase.php | 15 -------- .../AbstractEntityChoiceListTest.php | 16 --------- .../GenericEntityChoiceListTest.php | 16 --------- .../Form/Type/EntityTypePerformanceTest.php | 16 --------- .../Tests/Form/Type/EntityTypeTest.php | 16 --------- .../HttpFoundation/DbalSessionHandlerTest.php | 7 ---- .../Security/User/EntityUserProviderTest.php | 9 ----- .../Tests/Processor/WebProcessorTest.php | 7 ---- .../DataCollector/PropelDataCollectorTest.php | 7 ---- .../ChoiceList/CompatModelChoiceListTest.php | 17 --------- .../Form/ChoiceList/ModelChoiceListTest.php | 13 ------- .../CollectionToArrayTransformerTest.php | 6 ---- .../Bridge/Propel1/Tests/Propel1TestCase.php | 6 ---- .../Extension/HttpKernelExtensionTest.php | 13 ------- .../Tests/Extension/RoutingExtensionTest.php | 9 ----- .../Extension/TranslationExtensionTest.php | 13 ------- src/Symfony/Bridge/Twig/Tests/TestCase.php | 6 ---- .../Tests/Translation/TwigExtractorTest.php | 7 ---- .../FrameworkExtensionTest.php | 4 --- .../Tests/Functional/WebTestCase.php | 9 ----- .../Helper/FormHelperDivLayoutTest.php | 13 ------- .../Helper/FormHelperTableLayoutTest.php | 13 ------- .../Tests/Functional/WebTestCase.php | 9 ----- .../Bundle/TwigBundle/Tests/TestCase.php | 6 ---- .../WebProfilerBundle/Tests/TestCase.php | 6 ---- .../Component/BrowserKit/Tests/ClientTest.php | 36 ------------------- .../Tests/ClassMapGeneratorTest.php | 4 --- .../Console/Tests/ApplicationTest.php | 12 ------- .../Debug/Tests/ExceptionHandlerTest.php | 7 ---- .../Tests/ContainerBuilderTest.php | 24 ------------- .../Tests/CrossCheckTest.php | 7 ---- .../Tests/Dumper/YamlDumperTest.php | 7 ---- .../Tests/Loader/ClosureLoaderTest.php | 7 ---- .../Tests/Loader/IniFileLoaderTest.php | 4 --- .../Tests/Loader/PhpFileLoaderTest.php | 7 ---- .../Tests/Loader/XmlFileLoaderTest.php | 11 ------ .../Tests/Loader/YamlFileLoaderTest.php | 11 ------ .../DomCrawler/Tests/CrawlerTest.php | 4 --- .../ContainerAwareEventDispatcherTest.php | 7 ---- .../Form/Test/FormIntegrationTestCase.php | 4 --- .../Component/Form/Tests/AbstractFormTest.php | 4 --- .../Component/Form/Tests/CompoundFormTest.php | 24 ------------- .../DataMapper/PropertyPathMapperTest.php | 8 ----- .../FixRadioInputListenerTest.php | 4 --- .../FixUrlProtocolListenerTest.php | 7 ---- .../MergeCollectionListenerTest.php | 4 --- .../EventListener/ResizeFormListenerTest.php | 4 --- .../Core/EventListener/TrimListenerTest.php | 7 ---- .../CsrfProvider/SessionCsrfProviderTest.php | 4 --- .../CsrfValidationListenerTest.php | 4 --- .../LegacyBindRequestListenerTest.php | 32 ----------------- .../EventListener/ValidationListenerTest.php | 4 --- .../Extension/Validator/Type/TypeTestCase.php | 4 --- .../Validator/ValidatorTypeGuesserTest.php | 4 --- .../ViolationMapper/ViolationMapperTest.php | 4 --- .../Component/Form/Tests/FormBuilderTest.php | 4 --- .../Component/Form/Tests/FormFactoryTest.php | 4 --- .../Form/Tests/ResolvedFormTypeTest.php | 12 ------- .../HttpKernel/Tests/Bundle/BundleTest.php | 12 ------- .../Component/HttpKernel/Tests/ClientTest.php | 15 -------- .../Controller/ControllerResolverTest.php | 7 ---- .../DataCollector/ConfigDataCollectorTest.php | 7 ---- .../ExceptionDataCollectorTest.php | 7 ---- .../DataCollector/LoggerDataCollectorTest.php | 7 ---- .../DataCollector/MemoryDataCollectorTest.php | 7 ---- .../RequestDataCollectorTest.php | 7 ---- .../DataCollector/TimeDataCollectorTest.php | 7 ---- .../Debug/TraceableEventDispatcherTest.php | 11 ------ .../ContainerAwareHttpKernelTest.php | 15 -------- .../MergeExtensionConfigurationPassTest.php | 11 ------ .../Tests/EventListener/EsiListenerTest.php | 7 ---- .../EventListener/ExceptionListenerTest.php | 11 ------ .../EventListener/FragmentListenerTest.php | 7 ---- .../EventListener/LocaleListenerTest.php | 11 ------ .../EventListener/ResponseListenerTest.php | 4 --- .../EventListener/RouterListenerTest.php | 11 ------ .../Fragment/EsiFragmentRendererTest.php | 7 ---- .../Fragment/HIncludeFragmentRendererTest.php | 7 ---- .../Fragment/InlineFragmentRendererTest.php | 11 ------ .../HttpKernel/Tests/HttpCache/EsiTest.php | 7 ---- .../Tests/HttpCache/HttpCacheTest.php | 11 ------ .../Tests/HttpCache/HttpCacheTestCase.php | 4 --- .../HttpKernel/Tests/HttpCache/StoreTest.php | 4 --- .../HttpKernel/Tests/HttpKernelTest.php | 11 ------ .../Component/HttpKernel/Tests/KernelTest.php | 12 ------- .../Tests/Profiler/ProfilerTest.php | 4 --- .../Tests/Generator/UrlGeneratorTest.php | 4 --- .../Loader/AbstractAnnotationLoaderTest.php | 7 ---- .../Tests/Loader/ClosureLoaderTest.php | 7 ---- .../Tests/Loader/PhpFileLoaderTest.php | 7 ---- .../Tests/Loader/XmlFileLoaderTest.php | 7 ---- .../Tests/Loader/YamlFileLoaderTest.php | 11 ------ .../Routing/Tests/RouteCollectionTest.php | 8 ----- .../Acl/Dbal/AclProviderBenchmarkTest.php | 4 --- .../Tests/Acl/Dbal/AclProviderTest.php | 3 -- .../Tests/Acl/Dbal/MutableAclProviderTest.php | 3 -- .../Security/Tests/Acl/Domain/AclTest.php | 7 ---- .../Tests/Acl/Domain/DoctrineAclCacheTest.php | 7 ---- .../Tests/Acl/Domain/ObjectIdentityTest.php | 7 ---- .../Domain/PermissionGrantingStrategyTest.php | 7 ---- .../Constraints/UserPasswordValidatorTest.php | 4 --- .../Security/Tests/Http/AccessMapTest.php | 7 ---- ...efaultAuthenticationFailureHandlerTest.php | 12 ------- ...efaultAuthenticationSuccessHandlerTest.php | 4 --- .../BasicAuthenticationEntryPointTest.php | 7 ---- .../DigestAuthenticationEntryPointTest.php | 7 ---- .../FormAuthenticationEntryPointTest.php | 11 ------ .../RetryAuthenticationEntryPointTest.php | 7 ---- .../AbstractPreAuthenticatedListenerTest.php | 15 -------- .../Http/Firewall/AccessListenerTest.php | 15 -------- .../AnonymousAuthenticationListenerTest.php | 11 ------ .../BasicAuthenticationListenerTest.php | 15 -------- .../Http/Firewall/ChannelListenerTest.php | 15 -------- .../Http/Firewall/ContextListenerTest.php | 12 ------- .../Http/Firewall/LogoutListenerTest.php | 19 ---------- .../Http/Firewall/RememberMeListenerTest.php | 15 -------- .../Http/Firewall/SwitchUserListenerTest.php | 8 ----- .../X509AuthenticationListenerTest.php | 7 ---- .../Security/Tests/Http/FirewallMapTest.php | 11 ------ .../Security/Tests/Http/FirewallTest.php | 15 -------- .../Security/Tests/Http/HttpUtilsTest.php | 11 ------ .../CookieClearingLogoutHandlerTest.php | 7 ---- .../DefaultLogoutSuccessHandlerTest.php | 7 ---- .../Http/Logout/SessionLogoutHandlerTest.php | 7 ---- .../AbstractRememberMeServicesTest.php | 7 ---- ...istentTokenBasedRememberMeServicesTest.php | 7 ---- .../Http/RememberMe/ResponseListenerTest.php | 7 ---- .../TokenBasedRememberMeServicesTest.php | 7 ---- .../SessionAuthenticationStrategyTest.php | 7 ---- .../Tests/Dumper/YamlFileDumperTest.php | 7 ---- .../Tests/Loader/CsvFileLoaderTest.php | 7 ---- .../Tests/Loader/IcuDatFileLoaderTest.php | 4 --- .../Tests/Loader/IcuResFileLoaderTest.php | 4 --- .../Tests/Loader/IniFileLoaderTest.php | 7 ---- .../Tests/Loader/MoFileLoaderTest.php | 7 ---- .../Tests/Loader/PhpFileLoaderTest.php | 7 ---- .../Tests/Loader/PoFileLoaderTest.php | 7 ---- .../Tests/Loader/QtFileLoaderTest.php | 7 ---- .../Tests/Loader/XliffFileLoaderTest.php | 7 ---- .../Tests/Loader/YamlFileLoaderTest.php | 11 ------ .../Tests/MessageCatalogueTest.php | 12 ------- .../Mapping/Loader/AnnotationLoaderTest.php | 7 ---- .../Mapping/Loader/YamlFileLoaderTest.php | 7 ---- .../Validator/Tests/ValidatorBuilderTest.php | 4 --- .../Component/Validator/Tests/bootstrap.php | 14 ++++++++ src/Symfony/Component/Validator/composer.json | 1 + .../Component/Validator/phpunit.xml.dist | 2 +- 151 files changed, 16 insertions(+), 1303 deletions(-) create mode 100644 src/Symfony/Component/Validator/Tests/bootstrap.php diff --git a/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php b/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php index b5985caed4..5185a75998 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php @@ -18,10 +18,6 @@ class ContainerAwareEventManagerTest extends \PHPUnit_Framework_TestCase { protected function setUp() { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - $this->container = new Container(); $this->evm = new ContainerAwareEventManager($this->container); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php index 175cc560b7..bad478c568 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php @@ -18,17 +18,6 @@ use Symfony\Component\HttpFoundation\Response; class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testCollectConnections() { $c = $this->createCollector(array()); diff --git a/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php b/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php index 914c8938db..53ad5a0e3a 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php @@ -16,17 +16,6 @@ use Symfony\Bridge\Doctrine\Tests\Fixtures\ContainerAwareFixture; class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - - if (!class_exists('Doctrine\Common\DataFixtures\Loader')) { - $this->markTestSkipped('Doctrine Data Fixtures is not available.'); - } - } - public function testShouldSetContainerOnContainerAwareFixture() { $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php index 746e2cc837..13573978b5 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php @@ -17,13 +17,6 @@ use Symfony\Component\DependencyInjection\Definition; class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - } - /** * @expectedException \InvalidArgumentException */ diff --git a/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php b/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php index abdade7a05..e506352d16 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php @@ -21,21 +21,6 @@ use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper; */ abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - } - /** * @return \Doctrine\ORM\EntityManager */ 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/Type/EntityTypePerformanceTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php index 8ec8671ea1..1269812bbf 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php @@ -50,22 +50,6 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase 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(); 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/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php b/src/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php index 8329476f1f..4f82bc37bb 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php @@ -20,13 +20,6 @@ use Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionHandler; */ class DbalSessionHandlerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testConstruct() { $connection = $this->getMockBuilder('Doctrine\DBAL\Connection')->disableOriginalConstructor()->getMock(); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php index f791f97f01..8c179cd31f 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php @@ -18,15 +18,6 @@ use Doctrine\ORM\Tools\SchemaTool; class EntityUserProviderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Security\Core\SecurityContext')) { - $this->markTestSkipped('The "Security" component is not available'); - } - - parent::setUp(); - } - public function testRefreshUserGetsUserByPrimaryKey() { $em = DoctrineTestHelper::createTestEntityManager(); diff --git a/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php b/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php index dbc45cd4df..751e6095e2 100644 --- a/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php +++ b/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php @@ -18,13 +18,6 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; class WebProcessorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Monolog\\Logger')) { - $this->markTestSkipped('Monolog is not available.'); - } - } - public function testUsesRequestServerData() { $server = array( diff --git a/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php b/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php index 0f454e55ff..c709f235cd 100644 --- a/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php @@ -18,13 +18,6 @@ use Symfony\Bridge\Propel1\Tests\Propel1TestCase; class PropelDataCollectorTest extends Propel1TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testCollectWithoutData() { $c = $this->createCollector(array()); 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 d0194f8c54..3231b87c4f 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/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php index 544e56902e..f8424dda9c 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php @@ -20,12 +20,6 @@ class CollectionToArrayTransformerTest extends Propel1TestCase protected function setUp() { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - parent::setUp(); - $this->transformer = new CollectionToArrayTransformer(); } diff --git a/src/Symfony/Bridge/Propel1/Tests/Propel1TestCase.php b/src/Symfony/Bridge/Propel1/Tests/Propel1TestCase.php index 3a03391aae..8a55069665 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Propel1TestCase.php +++ b/src/Symfony/Bridge/Propel1/Tests/Propel1TestCase.php @@ -13,10 +13,4 @@ namespace Symfony\Bridge\Propel1\Tests; abstract class Propel1TestCase extends \PHPUnit_Framework_TestCase { - public static function setUpBeforeClass() - { - if (!class_exists('\Propel')) { - self::markTestSkipped('Propel is not available.'); - } - } } diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php index 077927cd6d..ce22481921 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php @@ -18,19 +18,6 @@ use Symfony\Component\HttpKernel\Fragment\FragmentHandler; class HttpKernelExtensionTest extends TestCase { - protected function setUp() - { - parent::setUp(); - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } - /** * @expectedException \Twig_Error_Runtime */ diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php index 3c5d762ca0..58538c7c83 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php @@ -16,15 +16,6 @@ use Symfony\Bridge\Twig\Tests\TestCase; class RoutingExtensionTest extends TestCase { - protected function setUp() - { - parent::setUp(); - - if (!class_exists('Symfony\Component\Routing\Route')) { - $this->markTestSkipped('The "Routing" component is not available'); - } - } - /** * @dataProvider getEscapingTemplates */ diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php index 4e03e8a004..8bd2838899 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php @@ -19,19 +19,6 @@ use Symfony\Bridge\Twig\Tests\TestCase; class TranslationExtensionTest extends TestCase { - protected function setUp() - { - parent::setUp(); - - if (!class_exists('Symfony\Component\Translation\Translator')) { - $this->markTestSkipped('The "Translation" component is not available'); - } - - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } - public function testEscaping() { $output = $this->getTemplate('{% trans %}Percent: %value%%% (%msg%){% endtrans %}')->render(array('value' => 12, 'msg' => 'approx.')); diff --git a/src/Symfony/Bridge/Twig/Tests/TestCase.php b/src/Symfony/Bridge/Twig/Tests/TestCase.php index ecfb7dafb1..ddaa73efcd 100644 --- a/src/Symfony/Bridge/Twig/Tests/TestCase.php +++ b/src/Symfony/Bridge/Twig/Tests/TestCase.php @@ -13,10 +13,4 @@ namespace Symfony\Bridge\Twig\Tests; abstract class TestCase extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } } diff --git a/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php b/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php index d5614e7ec7..92c6015b5b 100644 --- a/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php @@ -18,13 +18,6 @@ use Symfony\Bridge\Twig\Tests\TestCase; class TwigExtractorTest extends TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Translation\Translator')) { - $this->markTestSkipped('The "Translation" component is not available'); - } - } - /** * @dataProvider getExtractData */ diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index e217c56918..acf9e374ad 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -235,10 +235,6 @@ abstract class FrameworkExtensionTest extends TestCase public function testAnnotations() { - if (!class_exists('Doctrine\\Common\\Version')) { - $this->markTestSkipped('Doctrine is not available.'); - } - $container = $this->createContainerFromFile('full'); $this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.file_cache_reader')->getArgument(1)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php index 6b8fe0ace6..50d4cfa4db 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php @@ -23,15 +23,6 @@ class WebTestCase extends BaseWebTestCase self::assertEquals('http://localhost'.$location, $response->headers->get('Location')); } - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - - parent::setUp(); - } - protected function deleteTmpDir($testCase) { if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php index 17dfbfed1c..df08b4e95d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php @@ -27,19 +27,6 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest */ protected $engine; - protected function setUp() - { - if (!class_exists('Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper')) { - $this->markTestSkipped('The "FrameworkBundle" is not available'); - } - - if (!class_exists('Symfony\Component\Templating\PhpEngine')) { - $this->markTestSkipped('The "Templating" component is not available'); - } - - parent::setUp(); - } - protected function getExtensions() { // should be moved to the Form component once absolute file paths are supported diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php index 19ca812094..6ebd379ecc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php @@ -27,19 +27,6 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest */ protected $engine; - protected function setUp() - { - if (!class_exists('Symfony\Bundle\FrameworkBundle\Templating\Helper\TranslatorHelper')) { - $this->markTestSkipped('The "FrameworkBundle" is not available'); - } - - if (!class_exists('Symfony\Component\Templating\PhpEngine')) { - $this->markTestSkipped('The "Templating" component is not available'); - } - - parent::setUp(); - } - protected function getExtensions() { // should be moved to the Form component once absolute file paths are supported diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php index e1c96d32e4..731c32073c 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php @@ -23,15 +23,6 @@ class WebTestCase extends BaseWebTestCase self::assertEquals('http://localhost'.$location, $response->headers->get('Location')); } - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - - parent::setUp(); - } - protected function deleteTmpDir($testCase) { if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) { diff --git a/src/Symfony/Bundle/TwigBundle/Tests/TestCase.php b/src/Symfony/Bundle/TwigBundle/Tests/TestCase.php index a3848ef472..0c7af8ae4b 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/TestCase.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/TestCase.php @@ -13,10 +13,4 @@ namespace Symfony\Bundle\TwigBundle\Tests; class TestCase extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/TestCase.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/TestCase.php index 586da133a3..0c0efeb0e0 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/TestCase.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/TestCase.php @@ -13,10 +13,4 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests; class TestCase extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Twig_Environment')) { - $this->markTestSkipped('Twig is not available.'); - } - } } diff --git a/src/Symfony/Component/BrowserKit/Tests/ClientTest.php b/src/Symfony/Component/BrowserKit/Tests/ClientTest.php index 1e68614faa..a6e5ba9e9a 100644 --- a/src/Symfony/Component/BrowserKit/Tests/ClientTest.php +++ b/src/Symfony/Component/BrowserKit/Tests/ClientTest.php @@ -268,14 +268,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase public function testClick() { - if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - $this->markTestSkipped('The "DomCrawler" component is not available'); - } - - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - $client = new TestClient(); $client->setNextResponse(new Response('foo')); $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); @@ -287,14 +279,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase public function testClickForm() { - if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - $this->markTestSkipped('The "DomCrawler" component is not available'); - } - - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - $client = new TestClient(); $client->setNextResponse(new Response('
')); $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); @@ -306,14 +290,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase public function testSubmit() { - if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - $this->markTestSkipped('The "DomCrawler" component is not available'); - } - - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - $client = new TestClient(); $client->setNextResponse(new Response('
')); $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); @@ -325,14 +301,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase public function testSubmitPreserveAuth() { - if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - $this->markTestSkipped('The "DomCrawler" component is not available'); - } - - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - $client = new TestClient(array('PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => 'bar')); $client->setNextResponse(new Response('
')); $crawler = $client->request('GET', 'http://www.example.com/foo/foobar'); @@ -581,10 +549,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase public function testInsulatedRequests() { - if (!class_exists('Symfony\Component\Process\Process')) { - $this->markTestSkipped('The "Process" component is not available'); - } - $client = new TestClient(); $client->insulate(); $client->setNextScript("new Symfony\Component\BrowserKit\Response('foobar')"); diff --git a/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php b/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php index 6438bf4bf2..88099258ec 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php @@ -120,10 +120,6 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase public function testCreateMapFinderSupport() { - if (!class_exists('Symfony\\Component\\Finder\\Finder')) { - $this->markTestSkipped('Finder component is not available'); - } - $finder = new \Symfony\Component\Finder\Finder(); $finder->files()->in(__DIR__.'/Fixtures/beta/NamespaceCollision'); diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index d75cdec14f..8f63a33b26 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -769,10 +769,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase public function testRunWithDispatcher() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $application = new Application(); $application->setAutoExit(false); $application->setDispatcher($this->getDispatcher()); @@ -792,10 +788,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase */ public function testRunWithExceptionAndDispatcher() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $application = new Application(); $application->setDispatcher($this->getDispatcher()); $application->setAutoExit(false); @@ -811,10 +803,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase public function testRunDispatchesAllEventsWithException() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $application = new Application(); $application->setDispatcher($this->getDispatcher()); $application->setAutoExit(false); diff --git a/src/Symfony/Component/Debug/Tests/ExceptionHandlerTest.php b/src/Symfony/Component/Debug/Tests/ExceptionHandlerTest.php index f5dbf94cdd..b202b8f1de 100644 --- a/src/Symfony/Component/Debug/Tests/ExceptionHandlerTest.php +++ b/src/Symfony/Component/Debug/Tests/ExceptionHandlerTest.php @@ -17,13 +17,6 @@ use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException; class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testDebug() { $handler = new ExceptionHandler(false); diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index fa0b40336f..ac67bab9fe 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -498,10 +498,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase */ public function testAddObjectResource() { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $container = new ContainerBuilder(); $container->setResourceTracking(false); @@ -528,10 +524,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase */ public function testAddClassResource() { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $container = new ContainerBuilder(); $container->setResourceTracking(false); @@ -558,10 +550,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase */ public function testCompilesClassDefinitionsOfLazyServices() { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $container = new ContainerBuilder(); $this->assertEmpty($container->getResources(), 'No resources get registered without resource tracking'); @@ -588,10 +576,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase */ public function testResources() { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $container = new ContainerBuilder(); $container->addResource($a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml')); $container->addResource($b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml')); @@ -682,10 +666,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase */ public function testThrowsExceptionWhenAddServiceOnAFrozenContainer() { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $container = new ContainerBuilder(); $container->compile(); $container->set('a', new \stdClass()); @@ -693,10 +673,6 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase public function testNoExceptionWhenSetSyntheticServiceOnAFrozenContainer() { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $container = new ContainerBuilder(); $def = new Definition('stdClass'); $def->setSynthetic(true); diff --git a/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php b/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php index 3464a6af3c..692d73dbcd 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/CrossCheckTest.php @@ -18,13 +18,6 @@ class CrossCheckTest extends \PHPUnit_Framework_TestCase { protected static $fixturesPath; - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public static function setUpBeforeClass() { self::$fixturesPath = __DIR__.'/Fixtures/'; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php index ca7aec054e..f9747a7c2f 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php @@ -18,13 +18,6 @@ class YamlDumperTest extends \PHPUnit_Framework_TestCase { protected static $fixturesPath; - protected function setUp() - { - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - $this->markTestSkipped('The "Yaml" component is not available'); - } - } - public static function setUpBeforeClass() { self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php index 33594d640c..483e30b78b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\DependencyInjection\Loader\ClosureLoader; class ClosureLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - /** * @covers Symfony\Component\DependencyInjection\Loader\ClosureLoader::supports */ diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php index 6f5b63d4ac..9188018b2b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php @@ -29,10 +29,6 @@ class IniFileLoaderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $this->container = new ContainerBuilder(); $this->loader = new IniFileLoader($this->container, new FileLocator(self::$fixturesPath.'/ini')); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php index 3a97dc27da..505f710cbe 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php @@ -18,13 +18,6 @@ use Symfony\Component\Config\FileLocator; class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - /** * @covers Symfony\Component\DependencyInjection\Loader\PhpFileLoader::supports */ diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php index c68a0f2ef3..549d52d3a4 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php @@ -25,13 +25,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase { protected static $fixturesPath; - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public static function setUpBeforeClass() { self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); @@ -104,10 +97,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase public function testLoadImports() { - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - $this->markTestSkipped('The "Yaml" component is not available'); - } - $container = new ContainerBuilder(); $resolver = new LoaderResolver(array( new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')), diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php index e7887fa922..f10ecb04d0 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php @@ -25,17 +25,6 @@ class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase { protected static $fixturesPath; - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - $this->markTestSkipped('The "Yaml" component is not available'); - } - } - public static function setUpBeforeClass() { self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); diff --git a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php index ce3bcae11c..5743eebebe 100644 --- a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php @@ -515,10 +515,6 @@ EOF */ public function testFilter() { - if (!class_exists('Symfony\Component\CssSelector\CssSelector')) { - $this->markTestSkipped('The "CssSelector" component is not available'); - } - $crawler = $this->createTestCrawler(); $this->assertNotSame($crawler, $crawler->filter('li'), '->filter() returns a new instance of a crawler'); $this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filter() returns a new instance of a crawler'); diff --git a/src/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php index a355a1ab85..fb3b4caa26 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php @@ -19,13 +19,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; class ContainerAwareEventDispatcherTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - } - public function testAddAListenerService() { $event = new Event(); diff --git a/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php b/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php index a5cf86c412..caab26970c 100644 --- a/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php +++ b/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php @@ -26,10 +26,6 @@ abstract class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->factory = Forms::createFormFactoryBuilder() ->addExtensions($this->getExtensions()) ->getFormFactory(); diff --git a/src/Symfony/Component/Form/Tests/AbstractFormTest.php b/src/Symfony/Component/Form/Tests/AbstractFormTest.php index 76167b2dad..a2d171c234 100644 --- a/src/Symfony/Component/Form/Tests/AbstractFormTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractFormTest.php @@ -34,10 +34,6 @@ abstract class AbstractFormTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - // We need an actual dispatcher to use the deprecated // bindRequest() method $this->dispatcher = new EventDispatcher(); diff --git a/src/Symfony/Component/Form/Tests/CompoundFormTest.php b/src/Symfony/Component/Form/Tests/CompoundFormTest.php index 17c4f3b0bf..b5440ccbee 100644 --- a/src/Symfony/Component/Form/Tests/CompoundFormTest.php +++ b/src/Symfony/Component/Form/Tests/CompoundFormTest.php @@ -583,10 +583,6 @@ class CompoundFormTest extends AbstractFormTest */ public function testSubmitPostOrPutRequest($method) { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $path = tempnam(sys_get_temp_dir(), 'sf2'); touch($path); @@ -635,10 +631,6 @@ class CompoundFormTest extends AbstractFormTest */ public function testSubmitPostOrPutRequestWithEmptyRootFormName($method) { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $path = tempnam(sys_get_temp_dir(), 'sf2'); touch($path); @@ -686,10 +678,6 @@ class CompoundFormTest extends AbstractFormTest */ public function testSubmitPostOrPutRequestWithSingleChildForm($method) { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $path = tempnam(sys_get_temp_dir(), 'sf2'); touch($path); @@ -726,10 +714,6 @@ class CompoundFormTest extends AbstractFormTest */ public function testSubmitPostOrPutRequestWithSingleChildFormUploadedFile($method) { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $path = tempnam(sys_get_temp_dir(), 'sf2'); touch($path); @@ -755,10 +739,6 @@ class CompoundFormTest extends AbstractFormTest public function testSubmitGetRequest() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $values = array( 'author' => array( 'firstName' => 'Bernhard', @@ -787,10 +767,6 @@ class CompoundFormTest extends AbstractFormTest public function testSubmitGetRequestWithEmptyRootFormName() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $values = array( 'firstName' => 'Bernhard', 'lastName' => 'Schussek', diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php index e8e875cc8e..05497fceaa 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php @@ -34,14 +34,6 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\Event')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\PropertyAccess\PropertyAccess')) { - $this->markTestSkipped('The "PropertyAccess" component is not available'); - } - $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->propertyAccessor = $this->getMock('Symfony\Component\PropertyAccess\PropertyAccessorInterface'); $this->mapper = new PropertyPathMapper($this->propertyAccessor); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixRadioInputListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixRadioInputListenerTest.php index a5d5c78a81..426293395c 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixRadioInputListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixRadioInputListenerTest.php @@ -21,10 +21,6 @@ class FixRadioInputListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - parent::setUp(); $this->choiceList = new SimpleChoiceList(array('' => 'Empty', 0 => 'A', 1 => 'B')); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php index 2b84e4fd82..475681a053 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Form\Extension\Core\EventListener\FixUrlProtocolListener; class FixUrlProtocolListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - } - public function testFixHttpUrl() { $data = "www.symfony.com"; diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php index dbd28c6b55..2d7ecfec75 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php @@ -22,10 +22,6 @@ abstract class MergeCollectionListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); $this->form = $this->getForm('axes'); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php index 07620dc635..7bcc7f2d12 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/ResizeFormListenerTest.php @@ -24,10 +24,6 @@ class ResizeFormListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); $this->form = $this->getBuilder() diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php index c753798432..38b39ac11c 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Form\Extension\Core\EventListener\TrimListener; class TrimListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - } - public function testTrim() { $data = " Foo! "; diff --git a/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/SessionCsrfProviderTest.php b/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/SessionCsrfProviderTest.php index 1dcc6b4c63..99e87158b5 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/SessionCsrfProviderTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/SessionCsrfProviderTest.php @@ -20,10 +20,6 @@ class SessionCsrfProviderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\HttpFoundation\Session\Session')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $this->session = $this->getMock( 'Symfony\Component\HttpFoundation\Session\Session', array(), diff --git a/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php index 0bcfe74e99..7f2220af72 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php @@ -23,10 +23,6 @@ class CsrfValidationListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); $this->csrfProvider = $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface'); diff --git a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/LegacyBindRequestListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/LegacyBindRequestListenerTest.php index 4f1027f0b1..183d3a7a3a 100644 --- a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/LegacyBindRequestListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/LegacyBindRequestListenerTest.php @@ -87,10 +87,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase */ public function testSubmitRequest($method) { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $values = array('author' => $this->values); $files = array('author' => $this->filesNested); $request = new Request(array(), $values, array(), array(), $files, array( @@ -116,10 +112,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase */ public function testSubmitRequestWithEmptyName($method) { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $request = new Request(array(), $this->values, array(), array(), $this->filesPlain, array( 'REQUEST_METHOD' => $method, )); @@ -143,10 +135,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase */ public function testSubmitEmptyRequestToCompoundForm($method) { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $request = new Request(array(), array(), array(), array(), array(), array( 'REQUEST_METHOD' => $method, )); @@ -170,10 +158,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase */ public function testSubmitEmptyRequestToSimpleForm($method) { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $request = new Request(array(), array(), array(), array(), array(), array( 'REQUEST_METHOD' => $method, )); @@ -193,10 +177,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase public function testSubmitGetRequest() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $values = array('author' => $this->values); $request = new Request($values, array(), array(), array(), array(), array( 'REQUEST_METHOD' => 'GET', @@ -218,10 +198,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase public function testSubmitGetRequestWithEmptyName() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $request = new Request($this->values, array(), array(), array(), array(), array( 'REQUEST_METHOD' => 'GET', )); @@ -242,10 +218,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase public function testSubmitEmptyGetRequestToCompoundForm() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $request = new Request(array(), array(), array(), array(), array(), array( 'REQUEST_METHOD' => 'GET', )); @@ -265,10 +237,6 @@ class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase public function testSubmitEmptyGetRequestToSimpleForm() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $request = new Request(array(), array(), array(), array(), array(), array( 'REQUEST_METHOD' => 'GET', )); diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php index 528f94633b..13cbcd2f65 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/EventListener/ValidationListenerTest.php @@ -53,10 +53,6 @@ class ValidationListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\Event')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); $this->validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface'); diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php index d94d896a1c..f197b19857 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php @@ -20,10 +20,6 @@ abstract class TypeTestCase extends BaseTypeTestCase protected function setUp() { - if (!class_exists('Symfony\Component\Validator\Constraint')) { - $this->markTestSkipped('The "Validator" component is not available'); - } - $this->validator = $this->getMock('Symfony\Component\Validator\ValidatorInterface'); $metadataFactory = $this->getMock('Symfony\Component\Validator\MetadataFactoryInterface'); $this->validator->expects($this->once())->method('getMetadataFactory')->will($this->returnValue($metadataFactory)); 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/Extension/Validator/ViolationMapper/ViolationMapperTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php index 75a8074105..e4e0f9cc48 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php @@ -60,10 +60,6 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\Event')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->mapper = new ViolationMapper(); $this->message = 'Message'; diff --git a/src/Symfony/Component/Form/Tests/FormBuilderTest.php b/src/Symfony/Component/Form/Tests/FormBuilderTest.php index c49d393b44..da691838c3 100644 --- a/src/Symfony/Component/Form/Tests/FormBuilderTest.php +++ b/src/Symfony/Component/Form/Tests/FormBuilderTest.php @@ -21,10 +21,6 @@ class FormBuilderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); $this->builder = new FormBuilder('name', null, $this->dispatcher, $this->factory); diff --git a/src/Symfony/Component/Form/Tests/FormFactoryTest.php b/src/Symfony/Component/Form/Tests/FormFactoryTest.php index 224ef54007..546f6bd6c0 100644 --- a/src/Symfony/Component/Form/Tests/FormFactoryTest.php +++ b/src/Symfony/Component/Form/Tests/FormFactoryTest.php @@ -52,10 +52,6 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->resolvedTypeFactory = $this->getMock('Symfony\Component\Form\ResolvedFormTypeFactoryInterface'); $this->guesser1 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface'); $this->guesser2 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface'); diff --git a/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php b/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php index 21f151d083..fe61c8b41a 100644 --- a/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php +++ b/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php @@ -38,14 +38,6 @@ class ResolvedFormTypeTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\OptionsResolver\OptionsResolver')) { - $this->markTestSkipped('The "OptionsResolver" component is not available'); - } - - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->factory = $this->getMock('Symfony\Component\Form\FormFactoryInterface'); $this->dataMapper = $this->getMock('Symfony\Component\Form\DataMapperInterface'); @@ -53,10 +45,6 @@ class ResolvedFormTypeTest extends \PHPUnit_Framework_TestCase public function testCreateBuilder() { - if (version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<')) { - $this->markTestSkipped('This test requires PHPUnit 3.7.'); - } - $parentType = $this->getMockFormType(); $type = $this->getMockFormType(); $extension1 = $this->getMockFormTypeExtension(); diff --git a/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php b/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php index bbe7d42c7b..1a1b30097c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php @@ -19,18 +19,6 @@ class BundleTest extends \PHPUnit_Framework_TestCase { public function testRegisterCommands() { - if (!class_exists('Symfony\Component\Console\Application')) { - $this->markTestSkipped('The "Console" component is not available'); - } - - if (!interface_exists('Symfony\Component\DependencyInjection\ContainerAwareInterface')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - - if (!class_exists('Symfony\Component\Finder\Finder')) { - $this->markTestSkipped('The "Finder" component is not available'); - } - $cmd = new FooCommand(); $app = $this->getMock('Symfony\Component\Console\Application'); $app->expects($this->once())->method('add')->with($this->equalTo($cmd)); diff --git a/src/Symfony/Component/HttpKernel/Tests/ClientTest.php b/src/Symfony/Component/HttpKernel/Tests/ClientTest.php index 0417a0ab5b..b5d2c9cedd 100644 --- a/src/Symfony/Component/HttpKernel/Tests/ClientTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/ClientTest.php @@ -20,13 +20,6 @@ use Symfony\Component\HttpKernel\Tests\Fixtures\TestClient; class ClientTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\BrowserKit\Client')) { - $this->markTestSkipped('The "BrowserKit" component is not available'); - } - } - public function testDoRequest() { $client = new Client(new TestHttpKernel()); @@ -48,14 +41,6 @@ class ClientTest extends \PHPUnit_Framework_TestCase public function testGetScript() { - if (!class_exists('Symfony\Component\Process\Process')) { - $this->markTestSkipped('The "Process" component is not available'); - } - - if (!class_exists('Symfony\Component\ClassLoader\ClassLoader')) { - $this->markTestSkipped('The "ClassLoader" component is not available'); - } - $client = new TestClient(new TestHttpKernel()); $client->insulate(); $client->request('GET', '/'); diff --git a/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php b/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php index 0cdee1a490..07bdd0ec70 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php @@ -16,13 +16,6 @@ use Symfony\Component\HttpFoundation\Request; class ControllerResolverTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testGetControllerWithoutControllerParameter() { $logger = $this->getMock('Psr\Log\LoggerInterface'); diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php index 45c45a1a29..0d672a1f0c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php @@ -19,13 +19,6 @@ use Symfony\Component\HttpFoundation\Response; class ConfigDataCollectorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testCollect() { $kernel = new KernelForTest('test', true); diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php index cd1ecac885..6c71f4c9eb 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php @@ -18,13 +18,6 @@ use Symfony\Component\HttpFoundation\Response; class ExceptionDataCollectorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testCollect() { $e = new \Exception('foo', 500); diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php index ffcbd73ea0..59401662d3 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php @@ -18,13 +18,6 @@ use Symfony\Component\HttpFoundation\Response; class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - /** * @dataProvider getCollectTestData */ diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php index 9b7de4b904..340b428816 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/MemoryDataCollectorTest.php @@ -17,13 +17,6 @@ use Symfony\Component\HttpFoundation\Response; class MemoryDataCollectorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testCollect() { $collector = new MemoryDataCollector(); diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php index 3f6dd03a72..dd4f94aeba 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php @@ -22,13 +22,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher; class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - /** * @dataProvider provider */ diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php index f757b32e3d..b5d64bffe3 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/TimeDataCollectorTest.php @@ -17,13 +17,6 @@ use Symfony\Component\HttpFoundation\Response; class TimeDataCollectorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testCollect() { $c = new TimeDataCollector(); diff --git a/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php index 576f6a7180..c7a3edb890 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php @@ -22,17 +22,6 @@ use Symfony\Component\Stopwatch\Stopwatch; class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testAddRemoveListener() { $dispatcher = new EventDispatcher(); diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php index 5f24cf8c85..28901dafdd 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php @@ -19,21 +19,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher; class ContainerAwareHttpKernelTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - /** * @dataProvider getProviderTypes */ diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php index 7cfcfe4c2d..3426f6f9a2 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/MergeExtensionConfigurationPassTest.php @@ -15,17 +15,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfiguration class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - - if (!class_exists('Symfony\Component\Config\FileLocator')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testAutoloadMainExtension() { $container = $this->getMock( diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php index 2eddc572a4..56f68535f1 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/EsiListenerTest.php @@ -22,13 +22,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher; class EsiListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - } - public function testFilterDoesNothingForSubRequests() { $dispatcher = new EventDispatcher(); diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php index d691e0aaaf..cefd767318 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php @@ -26,17 +26,6 @@ use Symfony\Component\HttpKernel\Tests\Logger; */ class ExceptionListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testConstruct() { $logger = new TestLogger(); diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/FragmentListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/FragmentListenerTest.php index 75562f7098..7ddb2fbbf2 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/FragmentListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/FragmentListenerTest.php @@ -19,13 +19,6 @@ use Symfony\Component\HttpKernel\UriSigner; class FragmentListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - } - public function testOnlyTriggeredOnFragmentRoute() { $request = Request::create('http://example.com/foo?_path=foo%3Dbar%26_controller%3Dfoo'); diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php index e5e4e3a286..36859baa16 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php @@ -18,13 +18,6 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent; class LocaleListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - } - public function testDefaultLocaleWithoutSession() { $listener = new LocaleListener('fr'); @@ -50,10 +43,6 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase public function testLocaleSetForRoutingContext() { - 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/EventListener/ResponseListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php index 13f65109d9..821688eff4 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php @@ -27,10 +27,6 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - $this->dispatcher = new EventDispatcher(); $listener = new ResponseListener('UTF-8'); $this->dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse')); diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php index 3ba56a8da7..66fe6bd55d 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php @@ -19,17 +19,6 @@ use Symfony\Component\Routing\RequestContext; class RouterListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\Routing\Router')) { - $this->markTestSkipped('The "Routing" component is not available'); - } - } - /** * @dataProvider getPortData */ diff --git a/src/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php b/src/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php index 0c3ed8a2fb..2b9016d082 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fragment/EsiFragmentRendererTest.php @@ -19,13 +19,6 @@ use Symfony\Component\HttpKernel\UriSigner; class EsiFragmentRendererTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testRenderFallbackToInlineStrategyIfNoRequest() { $strategy = new EsiFragmentRenderer(new Esi(), $this->getInlineStrategy(true)); diff --git a/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php b/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php index cc1fe4557b..b747fca177 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php @@ -18,13 +18,6 @@ use Symfony\Component\HttpFoundation\Request; class HIncludeFragmentRendererTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - /** * @expectedException \LogicException */ diff --git a/src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php b/src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php index c73d1a5889..961b64bb8c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php @@ -21,17 +21,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher; class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testRender() { $strategy = new InlineFragmentRenderer($this->getKernel($this->returnValue(new Response('foo')))); diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php index 23e256e85b..ad400c69ae 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php @@ -17,13 +17,6 @@ use Symfony\Component\HttpFoundation\Response; class EsiTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testHasSurrogateEsiCapability() { $esi = new Esi(); diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php index a58be2d063..a8d4f806af 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php @@ -17,19 +17,8 @@ use Symfony\Component\HttpFoundation\Response; class HttpCacheTest extends HttpCacheTestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testTerminateDelegatesTerminationOnlyForTerminableInterface() { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - $storeMock = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpCache\\StoreInterface') ->disableOriginalConstructor() ->getMock(); diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php index 586b8a7027..766e2b1d49 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php @@ -31,10 +31,6 @@ class HttpCacheTestCase extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $this->kernel = null; $this->cache = null; diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php index b24b13d6ae..f1efcda3fe 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/StoreTest.php @@ -23,10 +23,6 @@ class StoreTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $this->request = Request::create('/'); $this->response = new Response('hello world', 200, array()); diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php index f4d689f3a7..441b665a5f 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php @@ -23,17 +23,6 @@ use Symfony\Component\EventDispatcher\EventDispatcher; class HttpKernelTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - /** * @expectedException \RuntimeException */ diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index d28c2f9c89..5606efc774 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -21,13 +21,6 @@ use Symfony\Component\HttpKernel\Tests\Fixtures\FooBarBundle; class KernelTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - } - public function testConstructor() { $env = 'test_env'; @@ -263,11 +256,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/Routing/Tests/Generator/UrlGeneratorTest.php b/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php index 3b8c6cb748..22dbbf598d 100644 --- a/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php +++ b/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php @@ -207,10 +207,6 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLogger() { - if (!interface_exists('Psr\Log\LoggerInterface')) { - $this->markTestSkipped('The "psr/log" package is not available'); - } - $routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+'))); $logger = $this->getMock('Psr\Log\LoggerInterface'); $logger->expects($this->once()) diff --git a/src/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php index c927ae4a85..288bf64ffa 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/AbstractAnnotationLoaderTest.php @@ -13,13 +13,6 @@ namespace Symfony\Component\Routing\Tests\Loader; abstract class AbstractAnnotationLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Doctrine\\Common\\Version')) { - $this->markTestSkipped('Doctrine is not available.'); - } - } - public function getReader() { return $this->getMockBuilder('Doctrine\Common\Annotations\Reader') diff --git a/src/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php index 64d1b086ef..d34fa87ec5 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/ClosureLoaderTest.php @@ -17,13 +17,6 @@ use Symfony\Component\Routing\RouteCollection; class ClosureLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\FileLocator')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testSupports() { $loader = new ClosureLoader(); diff --git a/src/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php index 18b166fc55..bf76d3465b 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/PhpFileLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Routing\Loader\PhpFileLoader; class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\FileLocator')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testSupports() { $loader = new PhpFileLoader($this->getMock('Symfony\Component\Config\FileLocator')); diff --git a/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php index f29ead41d9..2776cc7605 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php @@ -17,13 +17,6 @@ use Symfony\Component\Routing\Tests\Fixtures\CustomXmlFileLoader; class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\FileLocator')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testSupports() { $loader = new XmlFileLoader($this->getMock('Symfony\Component\Config\FileLocator')); diff --git a/src/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php index a3e934cef0..1463326094 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/YamlFileLoaderTest.php @@ -17,17 +17,6 @@ use Symfony\Component\Config\Resource\FileResource; class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\FileLocator')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - $this->markTestSkipped('The "Yaml" component is not available'); - } - } - public function testSupports() { $loader = new YamlFileLoader($this->getMock('Symfony\Component\Config\FileLocator')); diff --git a/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php b/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php index badd8752f8..551f72b2e5 100644 --- a/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php +++ b/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php @@ -103,10 +103,6 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase public function testAddCollectionWithResources() { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $collection = new RouteCollection(); $collection->addResource($foo = new FileResource(__DIR__.'/Fixtures/foo.xml')); $collection1 = new RouteCollection(); @@ -178,10 +174,6 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase public function testResource() { - if (!class_exists('Symfony\Component\Config\Resource\FileResource')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $collection = new RouteCollection(); $collection->addResource($foo = new FileResource(__DIR__.'/Fixtures/foo.xml')); $collection->addResource($bar = new FileResource(__DIR__.'/Fixtures/bar.xml')); diff --git a/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php b/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php index 46f4356a28..c25a697fb4 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php @@ -32,10 +32,6 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Doctrine\DBAL\DriverManager')) { - $this->markTestSkipped('The "Doctrine DBAL" library is not available'); - } - try { $this->con = DriverManager::getConnection(array( 'driver' => 'pdo_mysql', diff --git a/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderTest.php b/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderTest.php index ad58d72ab2..d701e226ce 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderTest.php @@ -141,9 +141,6 @@ class AclProviderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Doctrine\DBAL\DriverManager')) { - $this->markTestSkipped('The Doctrine2 DBAL is required for this test'); - } if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) { self::markTestSkipped('This test requires SQLite support in your environment'); } diff --git a/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php b/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php index 21ea6701ca..faa92611bb 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php @@ -483,9 +483,6 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Doctrine\DBAL\DriverManager')) { - $this->markTestSkipped('The Doctrine2 DBAL is required for this test'); - } if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) { self::markTestSkipped('This test requires SQLite support in your environment'); } diff --git a/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php b/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php index 0e88ab8b60..9be4a944d7 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php @@ -510,11 +510,4 @@ class AclTest extends \PHPUnit_Framework_TestCase { return new Acl(1, new ObjectIdentity(1, 'foo'), new PermissionGrantingStrategy(), array(), true); } - - protected function setUp() - { - if (!class_exists('Doctrine\DBAL\DriverManager')) { - $this->markTestSkipped('The Doctrine2 DBAL is required for this test'); - } - } } diff --git a/src/Symfony/Component/Security/Tests/Acl/Domain/DoctrineAclCacheTest.php b/src/Symfony/Component/Security/Tests/Acl/Domain/DoctrineAclCacheTest.php index 99eb27e1f7..93c87c1494 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Domain/DoctrineAclCacheTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Domain/DoctrineAclCacheTest.php @@ -98,11 +98,4 @@ class DoctrineAclCacheTest extends \PHPUnit_Framework_TestCase return new DoctrineAclCache($cacheDriver, $this->getPermissionGrantingStrategy(), $prefix); } - - protected function setUp() - { - if (!class_exists('Doctrine\DBAL\DriverManager')) { - $this->markTestSkipped('The Doctrine2 DBAL is required for this test'); - } - } } diff --git a/src/Symfony/Component/Security/Tests/Acl/Domain/ObjectIdentityTest.php b/src/Symfony/Component/Security/Tests/Acl/Domain/ObjectIdentityTest.php index 7aa3cf21bb..9281fd53e4 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Domain/ObjectIdentityTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Domain/ObjectIdentityTest.php @@ -85,13 +85,6 @@ namespace Symfony\Component\Security\Tests\Acl\Domain array(new ObjectIdentity('1', 'bla'), new ObjectIdentity('1', 'blub'), false), ); } - - protected function setUp() - { - if (!class_exists('Doctrine\DBAL\DriverManager')) { - $this->markTestSkipped('The Doctrine2 DBAL is required for this test'); - } - } } class TestDomainObject diff --git a/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php b/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php index 4698a72583..4935bffe49 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php @@ -183,11 +183,4 @@ class PermissionGrantingStrategyTest extends \PHPUnit_Framework_TestCase return new Acl($id++, new ObjectIdentity(1, 'Foo'), $strategy, array(), true); } - - protected function setUp() - { - if (!class_exists('Doctrine\DBAL\DriverManager')) { - $this->markTestSkipped('The Doctrine2 DBAL is required for this test'); - } - } } diff --git a/src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php b/src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php index 600f5182ff..4c420c7e9b 100644 --- a/src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php +++ b/src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php @@ -23,10 +23,6 @@ class UserPasswordValidatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (false === class_exists('Symfony\Component\Validator\Validator')) { - $this->markTestSkipped('The Validator component is required for this test.'); - } - $this->context = $this->getMock('Symfony\Component\Validator\ExecutionContext', array(), array(), '', false); } diff --git a/src/Symfony/Component/Security/Tests/Http/AccessMapTest.php b/src/Symfony/Component/Security/Tests/Http/AccessMapTest.php index 653152a4e0..c2d9b7f87c 100644 --- a/src/Symfony/Component/Security/Tests/Http/AccessMapTest.php +++ b/src/Symfony/Component/Security/Tests/Http/AccessMapTest.php @@ -15,13 +15,6 @@ use Symfony\Component\Security\Http\AccessMap; class AccessMapTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testReturnsFirstMatchedPattern() { $request = $this->getMock('Symfony\Component\HttpFoundation\Request'); diff --git a/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationFailureHandlerTest.php b/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationFailureHandlerTest.php index e610b6b4a7..accc45d82b 100644 --- a/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationFailureHandlerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationFailureHandlerTest.php @@ -31,18 +31,6 @@ class DefaultAuthenticationFailureHandlerTest extends \PHPUnit_Framework_TestCas protected function setUp() { - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!interface_exists('Psr\Log\LoggerInterface')) { - $this->markTestSkipped('The "LoggerInterface" is not available'); - } - $this->httpKernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); $this->httpUtils = $this->getMock('Symfony\Component\Security\Http\HttpUtils'); $this->logger = $this->getMock('Psr\Log\LoggerInterface'); diff --git a/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationSuccessHandlerTest.php b/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationSuccessHandlerTest.php index aa5902bdf3..3d8ebf36f6 100644 --- a/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationSuccessHandlerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationSuccessHandlerTest.php @@ -23,10 +23,6 @@ class DefaultAuthenticationSuccessHandlerTest extends \PHPUnit_Framework_TestCas protected function setUp() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - $this->httpUtils = $this->getMock('Symfony\Component\Security\Http\HttpUtils'); $this->request = $this->getMock('Symfony\Component\HttpFoundation\Request'); $this->request->headers = $this->getMock('Symfony\Component\HttpFoundation\HeaderBag'); diff --git a/src/Symfony/Component/Security/Tests/Http/EntryPoint/BasicAuthenticationEntryPointTest.php b/src/Symfony/Component/Security/Tests/Http/EntryPoint/BasicAuthenticationEntryPointTest.php index b9e289d718..564078956b 100644 --- a/src/Symfony/Component/Security/Tests/Http/EntryPoint/BasicAuthenticationEntryPointTest.php +++ b/src/Symfony/Component/Security/Tests/Http/EntryPoint/BasicAuthenticationEntryPointTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException; class BasicAuthenticationEntryPointTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testStart() { $request = $this->getMock('Symfony\Component\HttpFoundation\Request'); diff --git a/src/Symfony/Component/Security/Tests/Http/EntryPoint/DigestAuthenticationEntryPointTest.php b/src/Symfony/Component/Security/Tests/Http/EntryPoint/DigestAuthenticationEntryPointTest.php index 8dfd6183ee..5c6eccc842 100644 --- a/src/Symfony/Component/Security/Tests/Http/EntryPoint/DigestAuthenticationEntryPointTest.php +++ b/src/Symfony/Component/Security/Tests/Http/EntryPoint/DigestAuthenticationEntryPointTest.php @@ -17,13 +17,6 @@ use Symfony\Component\Security\Core\Exception\NonceExpiredException; class DigestAuthenticationEntryPointTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testStart() { $request = $this->getMock('Symfony\Component\HttpFoundation\Request'); diff --git a/src/Symfony/Component/Security/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php b/src/Symfony/Component/Security/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php index cbec1bdd63..097912dd87 100644 --- a/src/Symfony/Component/Security/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php +++ b/src/Symfony/Component/Security/Tests/Http/EntryPoint/FormAuthenticationEntryPointTest.php @@ -16,17 +16,6 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; class FormAuthenticationEntryPointTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testStart() { $request = $this->getMock('Symfony\Component\HttpFoundation\Request', array(), array(), '', false, false); diff --git a/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php b/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php index 95c73d2404..59ec912cbb 100644 --- a/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php +++ b/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php @@ -16,13 +16,6 @@ use Symfony\Component\HttpFoundation\Request; class RetryAuthenticationEntryPointTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - /** * @dataProvider dataForStart */ diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/AbstractPreAuthenticatedListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/AbstractPreAuthenticatedListenerTest.php index 34263bc6a3..d6373b33ef 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/AbstractPreAuthenticatedListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/AbstractPreAuthenticatedListenerTest.php @@ -18,21 +18,6 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException; class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testHandleWithValidValues() { $userCredentials = array('TheUser', 'TheCredentials'); diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/AccessListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/AccessListenerTest.php index 53ab3507a5..961c792d36 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/AccessListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/AccessListenerTest.php @@ -15,21 +15,6 @@ use Symfony\Component\Security\Http\Firewall\AccessListener; class AccessListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - /** * @expectedException \Symfony\Component\Security\Core\Exception\AccessDeniedException */ diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/AnonymousAuthenticationListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/AnonymousAuthenticationListenerTest.php index 73ee8214de..0666ef34dd 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/AnonymousAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/AnonymousAuthenticationListenerTest.php @@ -15,13 +15,6 @@ use Symfony\Component\Security\Http\Firewall\AnonymousAuthenticationListener; class AnonymousAuthenticationListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - } - public function testHandleWithContextHavingAToken() { $context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); @@ -62,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/Tests/Http/Firewall/BasicAuthenticationListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/BasicAuthenticationListenerTest.php index 2c944635ea..65dc18589c 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/BasicAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/BasicAuthenticationListenerTest.php @@ -20,21 +20,6 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testHandleWithValidUsernameAndPasswordServerParameters() { $request = new Request(array(), array(), array(), array(), array(), array( diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/ChannelListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/ChannelListenerTest.php index e33a8dc0e7..5e583e0b1b 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/ChannelListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/ChannelListenerTest.php @@ -16,21 +16,6 @@ use Symfony\Component\HttpFoundation\Response; class ChannelListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testHandleWithNotSecuredRequestAndHttpChannel() { $request = $this->getMock('Symfony\Component\HttpFoundation\Request', array(), array(), '', false, false); diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php index 1429f26b81..f44c60aa0f 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php @@ -26,18 +26,6 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase { protected function setUp() { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - $this->securityContext = new SecurityContext( $this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'), $this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface') diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/LogoutListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/LogoutListenerTest.php index 58f6adb295..93010867fd 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/LogoutListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/LogoutListenerTest.php @@ -17,25 +17,6 @@ use Symfony\Component\Security\Http\Firewall\LogoutListener; class LogoutListenerTest 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('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testHandleUnmatchedPath() { list($listener, $context, $httpUtils, $options) = $this->getListener(); diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/RememberMeListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/RememberMeListenerTest.php index 301bd6f38a..3624f11781 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/RememberMeListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/RememberMeListenerTest.php @@ -17,21 +17,6 @@ use Symfony\Component\HttpFoundation\Request; class RememberMeListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testOnCoreSecurityDoesNotTryToPopulateNonEmptySecurityContext() { list($listener, $context, $service, ,) = $this->getListener(); diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/SwitchUserListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/SwitchUserListenerTest.php index f8bb9f60aa..e86ee83cdd 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/SwitchUserListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/SwitchUserListenerTest.php @@ -29,14 +29,6 @@ class SwitchUserListenerTest extends \PHPUnit_Framework_TestCase protected function setUp() { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - $this->securityContext = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); $this->userProvider = $this->getMock('Symfony\Component\Security\Core\User\UserProviderInterface'); $this->userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface'); diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/X509AuthenticationListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/X509AuthenticationListenerTest.php index 1ba7311ad5..b28c0acc05 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/X509AuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/X509AuthenticationListenerTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Security\Http\Firewall\X509AuthenticationListener; class X509AuthenticationListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - /** * @dataProvider dataProviderGetPreAuthenticatedData */ diff --git a/src/Symfony/Component/Security/Tests/Http/FirewallMapTest.php b/src/Symfony/Component/Security/Tests/Http/FirewallMapTest.php index c7f13e18f0..5d3a72af1c 100644 --- a/src/Symfony/Component/Security/Tests/Http/FirewallMapTest.php +++ b/src/Symfony/Component/Security/Tests/Http/FirewallMapTest.php @@ -16,17 +16,6 @@ use Symfony\Component\HttpFoundation\Request; class FirewallMapTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testGetListeners() { $map = new FirewallMap(); diff --git a/src/Symfony/Component/Security/Tests/Http/FirewallTest.php b/src/Symfony/Component/Security/Tests/Http/FirewallTest.php index 8932b108a6..7fd2cda3e0 100644 --- a/src/Symfony/Component/Security/Tests/Http/FirewallTest.php +++ b/src/Symfony/Component/Security/Tests/Http/FirewallTest.php @@ -17,21 +17,6 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; class FirewallTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) { - $this->markTestSkipped('The "EventDispatcher" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testOnKernelRequestRegistersExceptionListener() { $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); diff --git a/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php b/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php index 2e281fd48f..019af193da 100644 --- a/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php +++ b/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php @@ -19,17 +19,6 @@ use Symfony\Component\Security\Http\HttpUtils; class HttpUtilsTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - - if (!class_exists('Symfony\Component\Routing\Router')) { - $this->markTestSkipped('The "Routing" component is not available'); - } - } - public function testCreateRedirectResponseWithPath() { $utils = new HttpUtils($this->getUrlGenerator()); diff --git a/src/Symfony/Component/Security/Tests/Http/Logout/CookieClearingLogoutHandlerTest.php b/src/Symfony/Component/Security/Tests/Http/Logout/CookieClearingLogoutHandlerTest.php index b32a81322f..c443d8d0db 100644 --- a/src/Symfony/Component/Security/Tests/Http/Logout/CookieClearingLogoutHandlerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Logout/CookieClearingLogoutHandlerTest.php @@ -18,13 +18,6 @@ use Symfony\Component\Security\Http\Logout\CookieClearingLogoutHandler; class CookieClearingLogoutHandlerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testLogout() { $request = new Request(); diff --git a/src/Symfony/Component/Security/Tests/Http/Logout/DefaultLogoutSuccessHandlerTest.php b/src/Symfony/Component/Security/Tests/Http/Logout/DefaultLogoutSuccessHandlerTest.php index 562d12749a..f18604da9f 100644 --- a/src/Symfony/Component/Security/Tests/Http/Logout/DefaultLogoutSuccessHandlerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Logout/DefaultLogoutSuccessHandlerTest.php @@ -15,13 +15,6 @@ use Symfony\Component\Security\Http\Logout\DefaultLogoutSuccessHandler; class DefaultLogoutSuccessHandlerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testLogout() { $request = $this->getMock('Symfony\Component\HttpFoundation\Request'); diff --git a/src/Symfony/Component/Security/Tests/Http/Logout/SessionLogoutHandlerTest.php b/src/Symfony/Component/Security/Tests/Http/Logout/SessionLogoutHandlerTest.php index 8e2dd28488..f89a423e59 100644 --- a/src/Symfony/Component/Security/Tests/Http/Logout/SessionLogoutHandlerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Logout/SessionLogoutHandlerTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Security\Http\Logout\SessionLogoutHandler; class SessionLogoutHandlerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testLogout() { $handler = new SessionLogoutHandler(); diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php index 67b415deea..0f64730b7b 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php @@ -17,13 +17,6 @@ use Symfony\Component\HttpFoundation\Response; class AbstractRememberMeServicesTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testGetRememberMeParameter() { $service = $this->getService(null, array('remember_me_parameter' => 'foo')); diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php index d9593fcd30..19f6984e6f 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php @@ -24,13 +24,6 @@ use Symfony\Component\Security\Core\Util\SecureRandom; class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testAutoLoginReturnsNullWhenNoCookie() { $service = $this->getService(null, array('name' => 'foo')); diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php index 59e5fe267f..dfbb718c84 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php @@ -19,13 +19,6 @@ use Symfony\Component\HttpKernel\KernelEvents; class ResponseListenerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testRememberMeCookieIsSentWithResponse() { $cookie = new Cookie('rememberme'); diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php index c7dfa12a26..7947753d98 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/TokenBasedRememberMeServicesTest.php @@ -20,13 +20,6 @@ use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices; class TokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testAutoLoginReturnsNullWhenNoCookie() { $service = $this->getService(null, array('name' => 'foo')); diff --git a/src/Symfony/Component/Security/Tests/Http/Session/SessionAuthenticationStrategyTest.php b/src/Symfony/Component/Security/Tests/Http/Session/SessionAuthenticationStrategyTest.php index 431a00252c..d5055eb610 100644 --- a/src/Symfony/Component/Security/Tests/Http/Session/SessionAuthenticationStrategyTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Session/SessionAuthenticationStrategyTest.php @@ -15,13 +15,6 @@ use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy; class SessionAuthenticationStrategyTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testSessionIsNotChanged() { $request = $this->getRequest(); diff --git a/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php b/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php index e4e68e02b3..3c68ade753 100644 --- a/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php +++ b/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Translation\Dumper\YamlFileDumper; class YamlFileDumperTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - $this->markTestSkipped('The "Yaml" component is not available'); - } - } - public function testDump() { $catalogue = new MessageCatalogue('en'); diff --git a/src/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php index 59569a3d70..463d3b5081 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Config\Resource\FileResource; class CsvFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testLoad() { $loader = new CsvFileLoader(); diff --git a/src/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php index a3bd67abaa..ea9643d682 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php @@ -18,10 +18,6 @@ class IcuDatFileLoaderTest extends LocalizedTestCase { protected function setUp() { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - if (!extension_loaded('intl')) { $this->markTestSkipped('This test requires intl extension to work.'); } diff --git a/src/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php index 233e189783..1a935c0404 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php @@ -18,10 +18,6 @@ class IcuResFileLoaderTest extends LocalizedTestCase { protected function setUp() { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - if (!extension_loaded('intl')) { $this->markTestSkipped('This test requires intl extension to work.'); } diff --git a/src/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php index ae1289d086..1a5de0ed58 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Config\Resource\FileResource; class IniFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testLoad() { $loader = new IniFileLoader(); diff --git a/src/Symfony/Component/Translation/Tests/Loader/MoFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/MoFileLoaderTest.php index c2616bda6a..d568e4530b 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/MoFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/MoFileLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Config\Resource\FileResource; class MoFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testLoad() { $loader = new MoFileLoader(); diff --git a/src/Symfony/Component/Translation/Tests/Loader/PhpFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/PhpFileLoaderTest.php index 5dfe837dea..0816b0f854 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/PhpFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/PhpFileLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Config\Resource\FileResource; class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testLoad() { $loader = new PhpFileLoader(); diff --git a/src/Symfony/Component/Translation/Tests/Loader/PoFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/PoFileLoaderTest.php index 92fc58b188..87090eb736 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/PoFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/PoFileLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Config\Resource\FileResource; class PoFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testLoad() { $loader = new PoFileLoader(); diff --git a/src/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php index 1d7d2b99d4..3aca86a53e 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Config\Resource\FileResource; class QtFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testLoad() { $loader = new QtFileLoader(); diff --git a/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php index 50865c2452..e5b731b713 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php @@ -16,13 +16,6 @@ use Symfony\Component\Config\Resource\FileResource; class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - } - public function testLoad() { $loader = new XliffFileLoader(); diff --git a/src/Symfony/Component/Translation/Tests/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/YamlFileLoaderTest.php index 511b127974..00f7163468 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/YamlFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/YamlFileLoaderTest.php @@ -16,17 +16,6 @@ use Symfony\Component\Config\Resource\FileResource; class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - $this->markTestSkipped('The "Yaml" component is not available'); - } - } - public function testLoad() { $loader = new YamlFileLoader(); diff --git a/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php b/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php index 344e39b253..7d956553d9 100644 --- a/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php +++ b/src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php @@ -82,10 +82,6 @@ class MessageCatalogueTest extends \PHPUnit_Framework_TestCase public function testAddCatalogue() { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); @@ -108,10 +104,6 @@ class MessageCatalogueTest extends \PHPUnit_Framework_TestCase public function testAddFallbackCatalogue() { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); @@ -155,10 +147,6 @@ class MessageCatalogueTest extends \PHPUnit_Framework_TestCase public function testGetAddResource() { - if (!class_exists('Symfony\Component\Config\Loader\Loader')) { - $this->markTestSkipped('The "Config" component is not available'); - } - $catalogue = new MessageCatalogue('en'); $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); diff --git a/src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php b/src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php index 22a39c582e..731ab83561 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php @@ -23,13 +23,6 @@ use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; class AnnotationLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) { - $this->markTestSkipped('The "Doctrine Common" library is not available'); - } - } - public function testLoadClassMetadataReturnsTrueIfSuccessful() { $reader = new AnnotationReader(); diff --git a/src/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php index 9e31cbb37d..dd394acaf0 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/Loader/YamlFileLoaderTest.php @@ -23,13 +23,6 @@ use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - $this->markTestSkipped('The "Yaml" component is not available'); - } - } - public function testLoadClassMetadataReturnsFalseIfEmpty() { $loader = new YamlFileLoader(__DIR__.'/empty-mapping.yml'); diff --git a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php index d48d6b1fe4..900243f31a 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php @@ -75,10 +75,6 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase public function testEnableAnnotationMapping() { - if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) { - $this->markTestSkipped('Annotations is required for this test'); - } - $this->assertSame($this->builder, $this->builder->enableAnnotationMapping()); } 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 2dedcf36ec..941bf911cf 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" >