Merge branch '2.3' into 2.5

* 2.3:
  [2.3] Remove useless tests skips
  [2.3] Cleanup deprecations

Conflicts:
	src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/TwigBundle/composer.json
	src/Symfony/Component/Debug/Tests/MockExceptionHandler.php
	src/Symfony/Component/Debug/composer.json
	src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php
	src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
	src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
	src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
	src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php
	src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php
	src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php
	src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php
	src/Symfony/Component/HttpKernel/composer.json
	src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php
	src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php
	src/Symfony/Component/Security/composer.json
This commit is contained in:
Nicolas Grekas 2015-01-03 16:23:51 +01:00
commit 85d0716cd5
56 changed files with 173 additions and 178 deletions

View File

@ -16,7 +16,7 @@ use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
/** /**
* Class DoctrineOrmTestCase. * 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. * Use {@link DoctrineTestHelper} instead.
*/ */
abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase

View File

@ -36,22 +36,6 @@ abstract class AbstractEntityChoiceListTest extends AbstractChoiceListTest
protected function setUp() 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->em = DoctrineTestHelper::createTestEntityManager();
$schemaTool = new SchemaTool($this->em); $schemaTool = new SchemaTool($this->em);

View File

@ -36,22 +36,6 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
protected function setUp() 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->em = DoctrineTestHelper::createTestEntityManager();
$schemaTool = new SchemaTool($this->em); $schemaTool = new SchemaTool($this->em);

View File

@ -12,10 +12,10 @@
namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList; namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList;
use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader; use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader;
use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
class ORMQueryBuilderLoaderTest extends DoctrineOrmTestCase class ORMQueryBuilderLoaderTest extends DoctrineTestHelper
{ {
/** /**
* @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException * @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException

View File

@ -14,7 +14,7 @@ namespace Symfony\Bridge\Doctrine\Tests\Form\Type;
use Symfony\Component\Form\Test\FormPerformanceTestCase; use Symfony\Component\Form\Test\FormPerformanceTestCase;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity; use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity;
use Doctrine\ORM\Tools\SchemaTool; 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\Component\Form\Extension\Core\CoreExtension;
use Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension; use Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension;
@ -50,7 +50,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
protected function setUp() protected function setUp()
{ {
$this->em = DoctrineOrmTestCase::createTestEntityManager(); $this->em = DoctrineTestHelper::createTestEntityManager();
parent::setUp(); parent::setUp();

View File

@ -43,22 +43,6 @@ class EntityTypeTest extends TypeTestCase
protected function setUp() 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->em = DoctrineTestHelper::createTestEntityManager();
$this->emRegistry = $this->createRegistryMock('default', $this->em); $this->emRegistry = $this->createRegistryMock('default', $this->em);

View File

@ -21,23 +21,6 @@ class CompatModelChoiceListTest extends AbstractChoiceListTest
protected $item3; protected $item3;
protected $item4; 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() public function testGetChoicesForValues()
{ {
$this->query $this->query

View File

@ -22,19 +22,6 @@ class ModelChoiceListTest extends Propel1TestCase
{ {
const ITEM_CLASS = '\Symfony\Bridge\Propel1\Tests\Fixtures\Item'; 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() protected function setUp()
{ {
ItemQuery::$result = array(); ItemQuery::$result = array();

View File

@ -24,7 +24,7 @@
"symfony/finder": "~2.3", "symfony/finder": "~2.3",
"symfony/form": "~2.5.2", "symfony/form": "~2.5.2",
"symfony/http-kernel": "~2.3", "symfony/http-kernel": "~2.3",
"symfony/locale": "~2.0,>=2.0.5", "symfony/intl": "~2.3",
"symfony/routing": "~2.2", "symfony/routing": "~2.2",
"symfony/templating": "~2.1", "symfony/templating": "~2.1",
"symfony/translation": "~2.2", "symfony/translation": "~2.2",

View File

@ -74,10 +74,6 @@ class AppKernel extends Kernel
return include $filename; return include $filename;
} }
public function init()
{
}
public function getRootDir() public function getRootDir()
{ {
return __DIR__; return __DIR__;

View File

@ -64,7 +64,11 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
protected function renderEnctype(FormView $view) 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()) protected function renderLabel(FormView $view, $label = null, array $vars = array())

View File

@ -65,7 +65,11 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
protected function renderEnctype(FormView $view) 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()) protected function renderLabel(FormView $view, $label = null, array $vars = array())

View File

@ -37,7 +37,7 @@
"symfony/css-selector": "~2.0,>=2.0.5", "symfony/css-selector": "~2.0,>=2.0.5",
"symfony/dom-crawler": "~2.0,>=2.0.5", "symfony/dom-crawler": "~2.0,>=2.0.5",
"symfony/finder": "~2.0,>=2.0.5", "symfony/finder": "~2.0,>=2.0.5",
"symfony/locale": "~2.0,>=2.0.5", "symfony/intl": "~2.3",
"symfony/security": "~2.4", "symfony/security": "~2.4",
"symfony/form": "2.5.*", "symfony/form": "2.5.*",
"symfony/class-loader": "~2.1", "symfony/class-loader": "~2.1",

View File

@ -74,10 +74,6 @@ class AppKernel extends Kernel
return include $filename; return include $filename;
} }
public function init()
{
}
public function getRootDir() public function getRootDir()
{ {
return __DIR__; return __DIR__;

View File

@ -19,7 +19,7 @@ class ExceptionControllerTest extends TestCase
{ {
public function testOnlyClearOwnOutputBuffers() public function testOnlyClearOwnOutputBuffers()
{ {
$flatten = $this->getMock('Symfony\Component\HttpKernel\Exception\FlattenException'); $flatten = $this->getMock('Symfony\Component\Debug\Exception\FlattenException');
$flatten $flatten
->expects($this->once()) ->expects($this->once())
->method('getStatusCode') ->method('getStatusCode')

View File

@ -19,7 +19,7 @@
"php": ">=5.3.3", "php": ">=5.3.3",
"symfony/twig-bridge": "~2.5", "symfony/twig-bridge": "~2.5",
"symfony/http-foundation": "~2.5", "symfony/http-foundation": "~2.5",
"symfony/http-kernel": "~2.1" "symfony/http-kernel": "~2.3,>=2.3.24"
}, },
"require-dev": { "require-dev": {
"symfony/stopwatch": "~2.2", "symfony/stopwatch": "~2.2",

View File

@ -105,7 +105,7 @@
{% macro display_message(log_index, log) %} {% 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 }} DEPRECATION - {{ log.message }}
{% set id = 'sf-call-stack-' ~ log_index %} {% set id = 'sf-call-stack-' ~ log_index %}
<a href="#" onclick="Sfjs.toggle('{{ id }}', document.getElementById('{{ id }}-on'), document.getElementById('{{ id }}-off')); return false;"> <a href="#" onclick="Sfjs.toggle('{{ id }}', document.getElementById('{{ id }}-on'), document.getElementById('{{ id }}-off')); return false;">

View File

@ -480,8 +480,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
} }
} }
public function testAsText() public function testLegacyAsText()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED);
$application = new Application(); $application = new Application();
$application->add(new \FooCommand()); $application->add(new \FooCommand());
$this->ensureStaticCommandHelp($application); $this->ensureStaticCommandHelp($application);
@ -489,8 +491,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application'); $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 = new Application();
$application->add(new \FooCommand()); $application->add(new \FooCommand());
$this->ensureStaticCommandHelp($application); $this->ensureStaticCommandHelp($application);

View File

@ -318,8 +318,10 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$output->writeln('from the code...'); $output->writeln('from the code...');
} }
public function testAsText() public function testLegacyAsText()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED);
$command = new \TestCommand(); $command = new \TestCommand();
$command->setApplication(new Application()); $command->setApplication(new Application());
$tester = new CommandTester($command); $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'); $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 = new \TestCommand();
$command->setApplication(new Application()); $command->setApplication(new Application());
$tester = new CommandTester($command); $tester = new CommandTester($command);

View File

@ -373,8 +373,10 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('foo1 ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options'); $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( $definition = new InputDefinition(array(
new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'),
new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), 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'); $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( $definition = new InputDefinition(array(
new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'),
new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true), 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('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false),
new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'), 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() protected function initializeArguments()

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Debug\Exception; namespace Symfony\Component\Debug\Exception;
use Symfony\Component\HttpKernel\Exception\FatalErrorException as LegacyFatalErrorException;
/** /**
* Fatal Error Exception. * Fatal Error Exception.
* *
@ -18,6 +20,19 @@ namespace Symfony\Component\Debug\Exception;
* @author Konstanton Myakshin <koc-dp@yandex.ru> * @author Konstanton Myakshin <koc-dp@yandex.ru>
* @author Nicolas Grekas <p@tchwork.com> * @author Nicolas Grekas <p@tchwork.com>
*/ */
class FatalErrorException extends LegacyFatalErrorException
{
}
namespace Symfony\Component\HttpKernel\Exception;
/**
* Fatal Error Exception.
*
* @author Konstanton Myakshin <koc-dp@yandex.ru>
*
* @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead.
*/
class FatalErrorException extends \ErrorException class FatalErrorException extends \ErrorException
{ {
public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true) public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true)

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Debug\Exception; namespace Symfony\Component\Debug\Exception;
use Symfony\Component\HttpKernel\Exception\FlattenException as LegacyFlattenException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
/** /**
@ -20,7 +21,7 @@ use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class FlattenException class FlattenException extends LegacyFlattenException
{ {
private $message; private $message;
private $code; private $code;
@ -249,3 +250,35 @@ class FlattenException
return $array['__PHP_Incomplete_Class_Name']; 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 <fabien@symfony.com>
*
* @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);
}
}

View File

@ -20,7 +20,7 @@
}, },
"require-dev": { "require-dev": {
"symfony/class-loader": "~2.2", "symfony/class-loader": "~2.2",
"symfony/http-kernel": "~2.2", "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2",
"symfony/http-foundation": "~2.1" "symfony/http-foundation": "~2.1"
}, },
"suggest": { "suggest": {

View File

@ -386,6 +386,9 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
* @param bool $virtual * @param bool $virtual
* *
* @throws BadMethodCallException * @throws BadMethodCallException
*
* @deprecated since version 2.3, to be removed in 3.0. Use
* {@link setInheritData()} instead.
*/ */
public function setVirtual($virtual) public function setVirtual($virtual)
{ {
@ -588,6 +591,9 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
* Unsupported method. * Unsupported method.
* *
* @return bool Always returns false. * @return bool Always returns false.
*
* @deprecated since version 2.3, to be removed in 3.0. Use
* {@link getInheritData()} instead.
*/ */
public function getVirtual() public function getVirtual()
{ {

View File

@ -13,6 +13,9 @@ namespace Symfony\Component\Form\Test;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
/**
* @deprecated since version 2.3, to be removed in 3.0.
*/
class DeprecationErrorHandler class DeprecationErrorHandler
{ {
public static function handle($errorNumber, $message, $file, $line, $context) public static function handle($errorNumber, $message, $file, $line, $context)

View File

@ -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 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()); 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); 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') $form = $this->factory->createNamedBuilder('name', 'form')
->add('file', 'file') ->add('file', 'file')
->getForm(); ->getForm();
@ -128,8 +133,10 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
$this->assertEquals('enctype="multipart/form-data"', $this->renderEnctype($form->createView())); $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') $form = $this->factory->createNamedBuilder('name', 'form')
->add('text', 'text') ->add('text', 'text')
->getForm(); ->getForm();

View File

@ -15,14 +15,13 @@ use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestLis
use Symfony\Component\Form\Form; use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormConfigBuilder; use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\Test\DeprecationErrorHandler;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
/** /**
* @author Bernhard Schussek <bschussek@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com>
*/ */
class BindRequestListenerTest extends \PHPUnit_Framework_TestCase class LegacyBindRequestListenerTest extends \PHPUnit_Framework_TestCase
{ {
private $values; private $values;
@ -37,6 +36,8 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp() protected function setUp()
{ {
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$path = tempnam(sys_get_temp_dir(), 'sf2'); $path = tempnam(sys_get_temp_dir(), 'sf2');
touch($path); touch($path);
@ -98,7 +99,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
$event = new FormEvent($form, $request); $event = new FormEvent($form, $request);
$listener = new BindRequestListener(); $listener = new BindRequestListener();
DeprecationErrorHandler::preBind($listener, $event); $listener->preBind($event);
$this->assertEquals(array( $this->assertEquals(array(
'name' => 'Bernhard', 'name' => 'Bernhard',
@ -121,7 +122,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
$event = new FormEvent($form, $request); $event = new FormEvent($form, $request);
$listener = new BindRequestListener(); $listener = new BindRequestListener();
DeprecationErrorHandler::preBind($listener, $event); $listener->preBind($event);
$this->assertEquals(array( $this->assertEquals(array(
'name' => 'Bernhard', 'name' => 'Bernhard',
@ -146,7 +147,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
$event = new FormEvent($form, $request); $event = new FormEvent($form, $request);
$listener = new BindRequestListener(); $listener = new BindRequestListener();
DeprecationErrorHandler::preBind($listener, $event); $listener->preBind($event);
// Default to empty array // Default to empty array
$this->assertEquals(array(), $event->getData()); $this->assertEquals(array(), $event->getData());
@ -168,7 +169,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
$event = new FormEvent($form, $request); $event = new FormEvent($form, $request);
$listener = new BindRequestListener(); $listener = new BindRequestListener();
DeprecationErrorHandler::preBind($listener, $event); $listener->preBind($event);
// Default to null // Default to null
$this->assertNull($event->getData()); $this->assertNull($event->getData());
@ -187,7 +188,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
$event = new FormEvent($form, $request); $event = new FormEvent($form, $request);
$listener = new BindRequestListener(); $listener = new BindRequestListener();
DeprecationErrorHandler::preBind($listener, $event); $listener->preBind($event);
$this->assertEquals(array( $this->assertEquals(array(
'name' => 'Bernhard', 'name' => 'Bernhard',
@ -207,7 +208,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
$event = new FormEvent($form, $request); $event = new FormEvent($form, $request);
$listener = new BindRequestListener(); $listener = new BindRequestListener();
DeprecationErrorHandler::preBind($listener, $event); $listener->preBind($event);
$this->assertEquals(array( $this->assertEquals(array(
'name' => 'Bernhard', 'name' => 'Bernhard',
@ -229,7 +230,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
$event = new FormEvent($form, $request); $event = new FormEvent($form, $request);
$listener = new BindRequestListener(); $listener = new BindRequestListener();
DeprecationErrorHandler::preBind($listener, $event); $listener->preBind($event);
$this->assertEquals(array(), $event->getData()); $this->assertEquals(array(), $event->getData());
} }
@ -247,7 +248,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
$event = new FormEvent($form, $request); $event = new FormEvent($form, $request);
$listener = new BindRequestListener(); $listener = new BindRequestListener();
DeprecationErrorHandler::preBind($listener, $event); $listener->preBind($event);
$this->assertNull($event->getData()); $this->assertNull($event->getData());
} }

View File

@ -50,10 +50,6 @@ class ValidatorTypeGuesserTest extends \PHPUnit_Framework_TestCase
protected function setUp() 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->metadata = new ClassMetadata(self::TEST_CLASS);
$this->metadataFactory = $this->getMock('Symfony\Component\Validator\MetadataFactoryInterface'); $this->metadataFactory = $this->getMock('Symfony\Component\Validator\MetadataFactoryInterface');
$this->metadataFactory->expects($this->any()) $this->metadataFactory->expects($this->any())

View File

@ -57,10 +57,6 @@ class ResolvedFormTypeTest extends \PHPUnit_Framework_TestCase
public function testGetOptionsResolver() public function testGetOptionsResolver()
{ {
if (version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<')) {
$this->markTestSkipped('This test requires PHPUnit 3.7.');
}
$test = $this; $test = $this;
$i = 0; $i = 0;

View File

@ -17,7 +17,7 @@ CHANGELOG
* [BC BREAK] renamed `Symfony\Component\HttpKernel\EventListener\DeprecationLoggerListener` to `Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener` and changed its constructor * [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`, * 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()`` * deprecated `Symfony\Component\HttpKernel\Kernel::init()``
* added the possibility to specify an id an extra attributes to hinclude tags * 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 * added the collect of data if a controller is a Closure in the Request collector

View File

@ -11,9 +11,9 @@
namespace Symfony\Component\HttpKernel\DataCollector; namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\FlattenException;
/** /**
* ExceptionDataCollector. * ExceptionDataCollector.

View File

@ -12,12 +12,12 @@
namespace Symfony\Component\HttpKernel\EventListener; namespace Symfony\Component\HttpKernel\EventListener;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Exception\FlattenException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\HttpKernel\Exception; namespace Symfony\Component\HttpKernel\Exception;
use Symfony\Component\Debug\Exception\FatalErrorException as DebugFatalErrorException;
/** /**
* Fatal Error Exception. * 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. * @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');
{
}

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\HttpKernel\Exception; namespace Symfony\Component\HttpKernel\Exception;
use Symfony\Component\Debug\Exception\FlattenException as DebugFlattenException;
/** /**
* FlattenException wraps a PHP Exception to be able to serialize it. * 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. * @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');
{
}

View File

@ -69,10 +69,6 @@ class KernelForTest extends Kernel
{ {
} }
public function init()
{
}
public function getBundles() public function getBundles()
{ {
return array(); return array();

View File

@ -11,8 +11,8 @@
namespace Symfony\Component\HttpKernel\Tests\DataCollector; namespace Symfony\Component\HttpKernel\Tests\DataCollector;
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector; use Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector;
use Symfony\Component\HttpKernel\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;

View File

@ -11,8 +11,8 @@
namespace Symfony\Component\HttpKernel\Tests\DataCollector; namespace Symfony\Component\HttpKernel\Tests\DataCollector;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector; use Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector;
use Symfony\Component\HttpKernel\Debug\ErrorHandler;
class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase
{ {

View File

@ -67,10 +67,6 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase
public function testRouterResetWithParentRequestOnKernelFinishRequest() public function testRouterResetWithParentRequestOnKernelFinishRequest()
{ {
if (!class_exists('Symfony\Component\Routing\Router')) {
$this->markTestSkipped('The "Routing" component is not available');
}
// the request context is updated // the request context is updated
$context = $this->getMock('Symfony\Component\Routing\RequestContext'); $context = $this->getMock('Symfony\Component\Routing\RequestContext');
$context->expects($this->once())->method('setParameter')->with('_locale', 'es'); $context->expects($this->once())->method('setParameter')->with('_locale', 'es');

View File

@ -194,11 +194,6 @@ class KernelTest extends \PHPUnit_Framework_TestCase
public function testStripComments() public function testStripComments()
{ {
if (!function_exists('token_get_all')) {
$this->markTestSkipped('The function token_get_all() is not available.');
return;
}
$source = <<<'EOF' $source = <<<'EOF'
<?php <?php

View File

@ -60,10 +60,6 @@ class ProfilerTest extends \PHPUnit_Framework_TestCase
protected function setUp() protected function setUp()
{ {
if (!class_exists('Symfony\Component\HttpFoundation\Request')) {
$this->markTestSkipped('The "HttpFoundation" component is not available');
}
if (!class_exists('SQLite3') && (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers()))) { if (!class_exists('SQLite3') && (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers()))) {
$this->markTestSkipped('This test requires SQLite support in your environment'); $this->markTestSkipped('This test requires SQLite support in your environment');
} }

View File

@ -19,7 +19,7 @@
"php": ">=5.3.3", "php": ">=5.3.3",
"symfony/event-dispatcher": "~2.5.9|~2.6,>=2.6.2", "symfony/event-dispatcher": "~2.5.9|~2.6,>=2.6.2",
"symfony/http-foundation": "~2.5", "symfony/http-foundation": "~2.5",
"symfony/debug": "~2.5", "symfony/debug": "~2.5.9|~2.6,>=2.6.2",
"psr/log": "~1.0" "psr/log": "~1.0"
}, },
"require-dev": { "require-dev": {

View File

@ -1,6 +1,12 @@
CHANGELOG 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 2.1.0
----- -----

View File

@ -23,6 +23,8 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
{ {
protected function setUp() protected function setUp()
{ {
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
// Locale extends \Locale, so intl must be present // Locale extends \Locale, so intl must be present
IntlTestHelper::requireIntl($this); IntlTestHelper::requireIntl($this);
} }

View File

@ -21,9 +21,10 @@ class StubLocaleTest extends \PHPUnit_Framework_TestCase
{ {
protected function setUp() 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() public function testGetCurrenciesData()

View File

@ -39,7 +39,7 @@ final class PropertyAccess
} }
/** /**
* Alias of {@link getPropertyAccessor}. * Alias of {@link createPropertyAccessor}.
* *
* @return PropertyAccessor The new property accessor * @return PropertyAccessor The new property accessor
* *

View File

@ -25,7 +25,7 @@ interface PropertyAccessorInterface
* *
* use Symfony\Component\PropertyAccess\PropertyAccess; * use Symfony\Component\PropertyAccess\PropertyAccess;
* *
* $propertyAccessor = PropertyAccess::getPropertyAccessor(); * $propertyAccessor = PropertyAccess::createPropertyAccessor();
* *
* echo $propertyAccessor->setValue($object, 'child.name', 'Fabien'); * echo $propertyAccessor->setValue($object, 'child.name', 'Fabien');
* // equals echo $object->getChild()->setName('Fabien'); * // equals echo $object->getChild()->setName('Fabien');
@ -57,7 +57,7 @@ interface PropertyAccessorInterface
* *
* use Symfony\Component\PropertyAccess\PropertyAccess; * use Symfony\Component\PropertyAccess\PropertyAccess;
* *
* $propertyAccessor = PropertyAccess::getPropertyAccessor(); * $propertyAccessor = PropertyAccess::createPropertyAccessor();
* *
* echo $propertyAccessor->getValue($object, 'child.name); * echo $propertyAccessor->getValue($object, 'child.name);
* // equals echo $object->getChild()->getName(); * // equals echo $object->getChild()->getName();

View File

@ -35,7 +35,6 @@ class RouteTest extends \PHPUnit_Framework_TestCase
public function getValidParameters() public function getValidParameters()
{ {
return array( return array(
array('value', '/Blog', 'getPattern'),
array('value', '/Blog', 'getPath'), array('value', '/Blog', 'getPath'),
array('requirements', array('_method' => 'GET'), 'getRequirements'), array('requirements', array('_method' => 'GET'), 'getRequirements'),
array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'), array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
@ -47,4 +46,12 @@ class RouteTest extends \PHPUnit_Framework_TestCase
array('condition', array('context.getMethod() == "GET"'), 'getCondition'), array('condition', array('context.getMethod() == "GET"'), 'getCondition'),
); );
} }
public function testLegacyGetPattern()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$route = new Route(array('value' => '/Blog'));
$this->assertEquals($route->getPattern(), '/Blog');
}
} }

View File

@ -363,7 +363,7 @@ class UrlMatcherTest extends \PHPUnit_Framework_TestCase
$subColl->add('bar', new Route('/bar')); $subColl->add('bar', new Route('/bar'));
$subColl->addPrefix('/prefix'); $subColl->addPrefix('/prefix');
// overwrite the pattern, so the prefix is not valid anymore for this route in the collection // 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); $coll->addCollection($subColl);

View File

@ -146,7 +146,7 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase
$collection2->add('bar', $bar = new Route('/bar')); $collection2->add('bar', $bar = new Route('/bar'));
$collection->addCollection($collection2); $collection->addCollection($collection2);
$collection->addPrefix(' / '); $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+')); $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}/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'); $this->assertEquals('/{admin}/bar', $collection->get('bar')->getPath(), '->addPrefix() adds a prefix to all routes');
@ -155,7 +155,7 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('admin' => '\d+'), $collection->get('foo')->getRequirements(), '->addPrefix() adds requirements to all routes'); $this->assertEquals(array('admin' => '\d+'), $collection->get('foo')->getRequirements(), '->addPrefix() adds requirements to all routes');
$this->assertEquals(array('admin' => '\d+'), $collection->get('bar')->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'); $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('/ /'); $collection->addPrefix('/ /');
$this->assertSame('/ /0/{admin}/foo', $collection->get('foo')->getPath(), '->addPrefix() can handle spaces if desired'); $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'); $this->assertSame('/ /0/{admin}/bar', $collection->get('bar')->getPath(), 'the route pattern of an added collection is in synch with the added prefix');

View File

@ -218,8 +218,10 @@ class RouteTest extends \PHPUnit_Framework_TestCase
$this->assertNotSame($compiled, $route->compile(), '->compile() recompiles if the route was modified'); $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}'); $route = new Route('/{foo}');
$this->assertEquals('/{foo}', $route->getPattern()); $this->assertEquals('/{foo}', $route->getPattern());

View File

@ -55,10 +55,6 @@ class AnonymousAuthenticationListenerTest extends \PHPUnit_Framework_TestCase
public function testHandledEventIsLogged() public function testHandledEventIsLogged()
{ {
if (!interface_exists('Psr\Log\LoggerInterface')) {
$this->markTestSkipped('The "LoggerInterface" is not available');
}
$context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); $context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
$logger = $this->getMock('Psr\Log\LoggerInterface'); $logger = $this->getMock('Psr\Log\LoggerInterface');
$logger->expects($this->once()) $logger->expects($this->once())

View File

@ -28,7 +28,7 @@
"symfony/security-http": "self.version" "symfony/security-http": "self.version"
}, },
"require-dev": { "require-dev": {
"symfony/locale": "~2.0,>=2.0.5", "symfony/intl": "~2.3",
"symfony/routing": "~2.2", "symfony/routing": "~2.2",
"symfony/translation": "~2.0,>=2.0.5", "symfony/translation": "~2.0,>=2.0.5",
"symfony/validator": "~2.5,>=2.5.5", "symfony/validator": "~2.5,>=2.5.5",

View File

@ -159,7 +159,7 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
$translator = new Translator('fr'); $translator = new Translator('fr');
$translator->addLoader('array', new ArrayLoader()); $translator->addLoader('array', new ArrayLoader());
$translator->setFallbackLocale(array('en')); $translator->setFallbackLocales(array('en'));
$translator->addResource('array', array('foo' => 'foofoo'), 'en'); $translator->addResource('array', array('foo' => 'foofoo'), 'en');
$this->assertEquals('foofoo', $translator->trans('foo')); $this->assertEquals('foofoo', $translator->trans('foo'));

View File

@ -0,0 +1,14 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* 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);});

View File

@ -20,6 +20,7 @@
"symfony/translation": "~2.0,>=2.0.5" "symfony/translation": "~2.0,>=2.0.5"
}, },
"require-dev": { "require-dev": {
"doctrine/common": "~2.3",
"symfony/http-foundation": "~2.1", "symfony/http-foundation": "~2.1",
"symfony/intl": "~2.3", "symfony/intl": "~2.3",
"symfony/yaml": "~2.0,>=2.0.5", "symfony/yaml": "~2.0,>=2.0.5",

View File

@ -4,7 +4,7 @@
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false" backupGlobals="false"
colors="true" colors="true"
bootstrap="vendor/autoload.php" bootstrap="Tests/bootstrap.php"
> >
<php> <php>
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) --> <!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->