From 583fee4d2df62a45f05d2dffc51590bdbe8391ef Mon Sep 17 00:00:00 2001 From: Hugo Hamon Date: Sun, 4 Jan 2015 13:49:58 +0100 Subject: [PATCH 1/2] [Validator] marks TraversalStrategy::STOP_RECURSION constant internal as it has been introduced for the BC layer and will be removed in 3.0. --- src/Symfony/Component/Validator/Mapping/TraversalStrategy.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/Validator/Mapping/TraversalStrategy.php b/src/Symfony/Component/Validator/Mapping/TraversalStrategy.php index d44733b61c..5122c475d0 100644 --- a/src/Symfony/Component/Validator/Mapping/TraversalStrategy.php +++ b/src/Symfony/Component/Validator/Mapping/TraversalStrategy.php @@ -53,6 +53,7 @@ class TraversalStrategy * * @deprecated This constant was added for backwards compatibility only. * It will be removed in Symfony 3.0. + * @internal */ const STOP_RECURSION = 8; From d79aa70edd37845bbd58030f624eb135c93064c0 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 5 Jan 2015 17:25:45 +0100 Subject: [PATCH 2/2] [Form] fix Context\ExecutionContextInterface mock --- .../GenericEntityChoiceListTest.php | 2 +- .../Form/ChoiceList/ModelChoiceListTest.php | 6 +++--- .../Console/Tests/ApplicationTest.php | 4 ++-- .../Console/Tests/Command/CommandTest.php | 4 ++-- .../Tests/Input/InputDefinitionTest.php | 4 ++-- .../Console/Tests/Input/StringInputTest.php | 2 +- .../Form/Test/DeprecationErrorHandler.php | 4 ++-- .../ChoiceList/AbstractChoiceListTest.php | 20 +++++++++---------- .../Core/ChoiceList/LazyChoiceListTest.php | 4 ++-- .../Core/ChoiceList/ObjectChoiceListTest.php | 8 ++++---- .../SimpleNumericChoiceListTest.php | 4 ++-- .../Constraints/FormValidatorTest.php | 15 +++++++++++++- ...hp => LegacyUserPasswordValidatorTest.php} | 2 +- .../Templating/Tests/Loader/LoaderTest.php | 2 +- .../AbstractConstraintValidatorTest.php | 2 +- .../Tests/LegacyExecutionContextTest.php | 2 +- .../Mapping/Cache/LegacyApcCacheTest.php | 2 +- .../Mapping/LegacyElementMetadataTest.php | 2 +- .../Tests/Validator/Abstract2Dot5ApiTest.php | 2 +- .../Tests/Validator/AbstractLegacyApiTest.php | 2 +- .../Tests/Validator/AbstractValidatorTest.php | 4 ++-- .../Validator/Tests/ValidatorBuilderTest.php | 6 +++--- 22 files changed, 58 insertions(+), 45 deletions(-) rename src/Symfony/Component/Security/Core/Tests/Validator/Constraints/{LegacyUserPasswordValidatorLegacyApiTest.php => LegacyUserPasswordValidatorTest.php} (86%) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php index 9aaf53cd6e..cc9b21cf9d 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php @@ -269,7 +269,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyInitShorthandEntityName() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $item1 = new SingleIntIdEntity(1, 'Foo'); $item2 = new SingleIntIdEntity(2, 'Bar'); diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php index 53fb2c5d59..5fb49a1fc8 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php @@ -206,7 +206,7 @@ class ModelChoiceListTest extends Propel1TestCase public function testLegacygetIndicesForChoices() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $item1 = new Item(1, 'Foo'); $item2 = new Item(2, 'Bar'); @@ -230,7 +230,7 @@ class ModelChoiceListTest extends Propel1TestCase public function testLegacyDifferentEqualObjectsAreChoosen() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $item = new Item(1, 'Foo'); @@ -251,7 +251,7 @@ class ModelChoiceListTest extends Propel1TestCase public function testLegacyGetIndicesForNullChoices() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $item = new Item(1, 'Foo'); $choiceList = new ModelChoiceList( diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 401f19aaae..cfc99920f8 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -482,7 +482,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase public function testLegacyAsText() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $application = new Application(); $application->add(new \FooCommand()); @@ -493,7 +493,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase public function testLegacyAsXml() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $application = new Application(); $application->add(new \FooCommand()); diff --git a/src/Symfony/Component/Console/Tests/Command/CommandTest.php b/src/Symfony/Component/Console/Tests/Command/CommandTest.php index a9455ca71d..9f62c7f4d8 100644 --- a/src/Symfony/Component/Console/Tests/Command/CommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/CommandTest.php @@ -320,7 +320,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase public function testLegacyAsText() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $command = new \TestCommand(); $command->setApplication(new Application()); @@ -331,7 +331,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase public function testLegacyAsXml() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $command = new \TestCommand(); $command->setApplication(new Application()); diff --git a/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php b/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php index be63311176..9e3e982d7d 100644 --- a/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php +++ b/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php @@ -375,7 +375,7 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase public function testLegacyAsText() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $definition = new InputDefinition(array( new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), @@ -392,7 +392,7 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase public function testLegacyAsXml() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $definition = new InputDefinition(array( new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'), diff --git a/src/Symfony/Component/Console/Tests/Input/StringInputTest.php b/src/Symfony/Component/Console/Tests/Input/StringInputTest.php index fec26dc01f..a79a7181dd 100644 --- a/src/Symfony/Component/Console/Tests/Input/StringInputTest.php +++ b/src/Symfony/Component/Console/Tests/Input/StringInputTest.php @@ -43,7 +43,7 @@ class StringInputTest extends \PHPUnit_Framework_TestCase public function testLegacyInputOptionDefinitionInConstructor() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $definition = new InputDefinition( array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) diff --git a/src/Symfony/Component/Form/Test/DeprecationErrorHandler.php b/src/Symfony/Component/Form/Test/DeprecationErrorHandler.php index 9ee0523177..a88ec79214 100644 --- a/src/Symfony/Component/Form/Test/DeprecationErrorHandler.php +++ b/src/Symfony/Component/Form/Test/DeprecationErrorHandler.php @@ -20,7 +20,7 @@ class DeprecationErrorHandler { public static function handle($errorNumber, $message, $file, $line, $context) { - if ($errorNumber & E_USER_DEPRECATED) { + if ($errorNumber & ~E_USER_DEPRECATED) { return true; } @@ -29,7 +29,7 @@ class DeprecationErrorHandler public static function handleBC($errorNumber, $message, $file, $line, $context) { - if ($errorNumber & E_USER_DEPRECATED) { + if ($errorNumber & ~E_USER_DEPRECATED) { return true; } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/AbstractChoiceListTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/AbstractChoiceListTest.php index f503b95622..f7615546be 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/AbstractChoiceListTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/AbstractChoiceListTest.php @@ -163,7 +163,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForChoices() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $choices = array($this->choice1, $this->choice2); $this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForChoices($choices)); @@ -171,7 +171,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForChoicesPreservesKeys() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $choices = array(5 => $this->choice1, 8 => $this->choice2); $this->assertSame(array(5 => $this->index1, 8 => $this->index2), $this->list->getIndicesForChoices($choices)); @@ -179,7 +179,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForChoicesPreservesOrder() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $choices = array($this->choice2, $this->choice1); $this->assertSame(array($this->index2, $this->index1), $this->list->getIndicesForChoices($choices)); @@ -187,7 +187,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForChoicesIgnoresNonExistingChoices() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $choices = array($this->choice1, $this->choice2, 'foobar'); $this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForChoices($choices)); @@ -195,14 +195,14 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForChoicesEmpty() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->assertSame(array(), $this->list->getIndicesForChoices(array())); } public function testLegacyGetIndicesForValues() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); // values and indices are always the same $values = array($this->value1, $this->value2); @@ -211,7 +211,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForValuesPreservesKeys() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); // values and indices are always the same $values = array(5 => $this->value1, 8 => $this->value2); @@ -220,7 +220,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForValuesPreservesOrder() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $values = array($this->value2, $this->value1); $this->assertSame(array($this->index2, $this->index1), $this->list->getIndicesForValues($values)); @@ -228,7 +228,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForValuesIgnoresNonExistingValues() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $values = array($this->value1, $this->value2, 'foobar'); $this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForValues($values)); @@ -236,7 +236,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForValuesEmpty() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->assertSame(array(), $this->list->getIndicesForValues(array())); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php index d4ff2124af..4b23916673 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php @@ -59,7 +59,7 @@ class LazyChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForChoices() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $choices = array('b', 'c'); $this->assertSame(array(1, 2), $this->list->getIndicesForChoices($choices)); @@ -67,7 +67,7 @@ class LazyChoiceListTest extends \PHPUnit_Framework_TestCase public function testLegacyGetIndicesForValues() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $values = array('b', 'c'); $this->assertSame(array(1, 2), $this->list->getIndicesForValues($values)); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php index c20ac1ce27..eca3169150 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php @@ -187,7 +187,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest public function testLegacyGetIndicesForChoicesWithValuePath() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->list = new ObjectChoiceList( array($this->obj1, $this->obj2, $this->obj3, $this->obj4), @@ -204,7 +204,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest public function testLegacyGetIndicesForChoicesWithValuePathPreservesKeys() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->list = new ObjectChoiceList( array($this->obj1, $this->obj2, $this->obj3, $this->obj4), @@ -220,7 +220,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest public function testLegacyGetIndicesForChoicesWithValuePathPreservesOrder() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->list = new ObjectChoiceList( array($this->obj1, $this->obj2, $this->obj3, $this->obj4), @@ -236,7 +236,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest public function testLegacyGetIndicesForChoicesWithValuePathIgnoresNonExistingChoices() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->list = new ObjectChoiceList( array($this->obj1, $this->obj2, $this->obj3, $this->obj4), diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleNumericChoiceListTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleNumericChoiceListTest.php index 540ae16f74..9bbac31a37 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleNumericChoiceListTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleNumericChoiceListTest.php @@ -17,7 +17,7 @@ class SimpleNumericChoiceListTest extends AbstractChoiceListTest { public function testLegacyGetIndicesForChoicesDealsWithNumericChoices() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); // Pass choices as strings although they are integers $choices = array('0', '1'); @@ -26,7 +26,7 @@ class SimpleNumericChoiceListTest extends AbstractChoiceListTest public function testLegacyGetIndicesForValuesDealsWithNumericValues() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); // Pass values as strings although they are integers $values = array('0', '1'); diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php index b92536fb0f..cad7c25491 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php @@ -566,7 +566,20 @@ class FormValidatorTest extends AbstractConstraintValidatorTest private function getMockExecutionContext() { - return $this->getMock('Symfony\Component\Validator\Context\ExecutionContextInterface'); + $context = $this->getMock('Symfony\Component\Validator\Context\ExecutionContextInterface'); + $validator = $this->getMock('Symfony\Component\Validator\Validator\ValidatorInterface'); + $contextualValidator = $this->getMock('Symfony\Component\Validator\Validator\ContextualValidatorInterface'); + + $validator->expects($this->any()) + ->method('inContext') + ->with($context) + ->will($this->returnValue($contextualValidator)); + + $context->expects($this->any()) + ->method('getValidator') + ->will($this->returnValue($validator)); + + return $context; } /** diff --git a/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorLegacyApiTest.php b/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php similarity index 86% rename from src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorLegacyApiTest.php rename to src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php index 5092a798dc..5cfe4440af 100644 --- a/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorLegacyApiTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Validator/Constraints/LegacyUserPasswordValidatorTest.php @@ -17,7 +17,7 @@ use Symfony\Component\Validator\Validation; * @since 2.5.4 * @author Bernhard Schussek */ -class LegacyUserPasswordValidatorLegacyApiTest extends UserPasswordValidatorTest +class LegacyUserPasswordValidatorApiTest extends UserPasswordValidatorTest { protected function getApiVersion() { diff --git a/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php b/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php index 67e7b044e6..b11ed7081b 100644 --- a/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php +++ b/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php @@ -26,7 +26,7 @@ class LoaderTest extends \PHPUnit_Framework_TestCase public function testLegacyGetSetDebugger() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $loader = new ProjectTemplateLoader4(); $debugger = $this->getMock('Symfony\Component\Templating\DebuggerInterface'); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php index de274124fe..ee6371aa7d 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php @@ -54,7 +54,7 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa protected function setUp() { if (Validation::API_VERSION_2_5 !== $this->getApiVersion()) { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); } $this->group = 'MyGroup'; diff --git a/src/Symfony/Component/Validator/Tests/LegacyExecutionContextTest.php b/src/Symfony/Component/Validator/Tests/LegacyExecutionContextTest.php index 88549d5815..36cba61ce8 100644 --- a/src/Symfony/Component/Validator/Tests/LegacyExecutionContextTest.php +++ b/src/Symfony/Component/Validator/Tests/LegacyExecutionContextTest.php @@ -38,7 +38,7 @@ class LegacyExecutionContextTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->visitor = $this->getMockBuilder('Symfony\Component\Validator\ValidationVisitor') ->disableOriginalConstructor() diff --git a/src/Symfony/Component/Validator/Tests/Mapping/Cache/LegacyApcCacheTest.php b/src/Symfony/Component/Validator/Tests/Mapping/Cache/LegacyApcCacheTest.php index a80e2cb59f..009e7e38ef 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/Cache/LegacyApcCacheTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/Cache/LegacyApcCacheTest.php @@ -17,7 +17,7 @@ class LegacyApcCacheTest extends \PHPUnit_Framework_TestCase { protected function setUp() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) { $this->markTestSkipped('APC is not loaded.'); diff --git a/src/Symfony/Component/Validator/Tests/Mapping/LegacyElementMetadataTest.php b/src/Symfony/Component/Validator/Tests/Mapping/LegacyElementMetadataTest.php index 473eea6176..059479090d 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/LegacyElementMetadataTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/LegacyElementMetadataTest.php @@ -21,7 +21,7 @@ class LegacyElementMetadataTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->metadata = new TestElementMetadata(); } diff --git a/src/Symfony/Component/Validator/Tests/Validator/Abstract2Dot5ApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/Abstract2Dot5ApiTest.php index fbc045d266..ea85b97e8c 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/Abstract2Dot5ApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/Abstract2Dot5ApiTest.php @@ -635,7 +635,7 @@ abstract class Abstract2Dot5ApiTest extends AbstractValidatorTest */ public function testLegacyPropertyMetadataMustImplementPropertyMetadataInterface() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $entity = new Entity(); diff --git a/src/Symfony/Component/Validator/Tests/Validator/AbstractLegacyApiTest.php b/src/Symfony/Component/Validator/Tests/Validator/AbstractLegacyApiTest.php index bef0b98177..a4c1fe8150 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/AbstractLegacyApiTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/AbstractLegacyApiTest.php @@ -42,7 +42,7 @@ abstract class AbstractLegacyApiTest extends AbstractValidatorTest protected function setUp() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); parent::setUp(); diff --git a/src/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php b/src/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php index 26085901fe..4554affdbd 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php @@ -843,7 +843,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase */ public function testLegacyValidatePropertyFailsIfPropertiesNotSupported() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); // $metadata does not implement PropertyMetadataContainerInterface $metadata = $this->getMock('Symfony\Component\Validator\MetadataInterface'); @@ -975,7 +975,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase */ public function testLegacyValidatePropertyValueFailsIfPropertiesNotSupported() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); // $metadata does not implement PropertyMetadataContainerInterface $metadata = $this->getMock('Symfony\Component\Validator\MetadataInterface'); diff --git a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php index 4de62efe99..0a15737f75 100644 --- a/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidatorBuilderTest.php @@ -112,7 +112,7 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase public function testLegacyDefaultApiVersion() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); if (PHP_VERSION_ID < 50309) { // Old implementation on PHP < 5.3.9 @@ -125,7 +125,7 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase public function testLegacySetApiVersion24() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); $this->assertSame($this->builder, $this->builder->setApiVersion(Validation::API_VERSION_2_4)); $this->assertInstanceOf('Symfony\Component\Validator\Validator', $this->builder->getValidator()); @@ -139,7 +139,7 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase public function testLegacySetApiVersion24And25() { - $this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); if (PHP_VERSION_ID < 50309) { $this->markTestSkipped('Not supported prior to PHP 5.3.9');