Merge branch '2.6' into 2.7

* 2.6:
  [2.6] fix deprecation silencing...
  [Form] fix Context\ExecutionContextInterface mock
  [Validator] marks TraversalStrategy::STOP_RECURSION constant internal as it has been introduced for the BC layer and will be removed in 3.0.
This commit is contained in:
Nicolas Grekas 2015-01-05 19:25:37 +01:00
commit ea1ac32815
29 changed files with 65 additions and 51 deletions

View File

@ -269,7 +269,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
public function testLegacyInitShorthandEntityName() public function testLegacyInitShorthandEntityName()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$item1 = new SingleIntIdEntity(1, 'Foo'); $item1 = new SingleIntIdEntity(1, 'Foo');
$item2 = new SingleIntIdEntity(2, 'Bar'); $item2 = new SingleIntIdEntity(2, 'Bar');

View File

@ -206,7 +206,7 @@ class ModelChoiceListTest extends Propel1TestCase
public function testLegacygetIndicesForChoices() public function testLegacygetIndicesForChoices()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$item1 = new Item(1, 'Foo'); $item1 = new Item(1, 'Foo');
$item2 = new Item(2, 'Bar'); $item2 = new Item(2, 'Bar');
@ -230,7 +230,7 @@ class ModelChoiceListTest extends Propel1TestCase
public function testLegacyDifferentEqualObjectsAreChoosen() public function testLegacyDifferentEqualObjectsAreChoosen()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$item = new Item(1, 'Foo'); $item = new Item(1, 'Foo');
@ -251,7 +251,7 @@ class ModelChoiceListTest extends Propel1TestCase
public function testLegacyGetIndicesForNullChoices() public function testLegacyGetIndicesForNullChoices()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$item = new Item(1, 'Foo'); $item = new Item(1, 'Foo');
$choiceList = new ModelChoiceList( $choiceList = new ModelChoiceList(

View File

@ -28,7 +28,7 @@ class GlobalVariablesTest extends TestCase
public function testLegacyGetSecurity() public function testLegacyGetSecurity()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$securityContext = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); $securityContext = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');

View File

@ -482,7 +482,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testLegacyAsText() public function testLegacyAsText()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$application = new Application(); $application = new Application();
$application->add(new \FooCommand()); $application->add(new \FooCommand());
@ -493,7 +493,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testLegacyAsXml() public function testLegacyAsXml()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$application = new Application(); $application = new Application();
$application->add(new \FooCommand()); $application->add(new \FooCommand());

View File

@ -320,7 +320,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
public function testLegacyAsText() public function testLegacyAsText()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$command = new \TestCommand(); $command = new \TestCommand();
$command->setApplication(new Application()); $command->setApplication(new Application());
@ -331,7 +331,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
public function testLegacyAsXml() public function testLegacyAsXml()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$command = new \TestCommand(); $command = new \TestCommand();
$command->setApplication(new Application()); $command->setApplication(new Application());

View File

@ -375,7 +375,7 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase
public function testLegacyAsText() public function testLegacyAsText()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $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'),
@ -392,7 +392,7 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase
public function testLegacyAsXml() public function testLegacyAsXml()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $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'),

View File

@ -43,7 +43,7 @@ class StringInputTest extends \PHPUnit_Framework_TestCase
public function testLegacyInputOptionDefinitionInConstructor() public function testLegacyInputOptionDefinitionInConstructor()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$definition = new InputDefinition( $definition = new InputDefinition(
array(new InputOption('foo', null, InputOption::VALUE_REQUIRED)) array(new InputOption('foo', null, InputOption::VALUE_REQUIRED))

View File

@ -39,7 +39,7 @@ class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase
*/ */
public function testLegacyHandleClassNotFound($error, $translatedMessage, $autoloader) public function testLegacyHandleClassNotFound($error, $translatedMessage, $autoloader)
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
// Unregister all autoloaders to ensure the custom provided // Unregister all autoloaders to ensure the custom provided
// autoloader is the only one to be used during the test run. // autoloader is the only one to be used during the test run.

View File

@ -18,7 +18,7 @@ class LegacyContainerBuilderTest extends \PHPUnit_Framework_TestCase
{ {
public function setUp() public function setUp()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
} }
/** /**

View File

@ -20,7 +20,7 @@ class DeprecationErrorHandler
{ {
public static function handle($errorNumber, $message, $file, $line, $context) public static function handle($errorNumber, $message, $file, $line, $context)
{ {
if ($errorNumber & E_USER_DEPRECATED) { if ($errorNumber & ~E_USER_DEPRECATED) {
return true; return true;
} }
@ -29,7 +29,7 @@ class DeprecationErrorHandler
public static function handleBC($errorNumber, $message, $file, $line, $context) public static function handleBC($errorNumber, $message, $file, $line, $context)
{ {
if ($errorNumber & E_USER_DEPRECATED) { if ($errorNumber & ~E_USER_DEPRECATED) {
return true; return true;
} }

View File

@ -163,7 +163,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase
public function testLegacyGetIndicesForChoices() 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); $choices = array($this->choice1, $this->choice2);
$this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForChoices($choices)); $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() 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); $choices = array(5 => $this->choice1, 8 => $this->choice2);
$this->assertSame(array(5 => $this->index1, 8 => $this->index2), $this->list->getIndicesForChoices($choices)); $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() 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); $choices = array($this->choice2, $this->choice1);
$this->assertSame(array($this->index2, $this->index1), $this->list->getIndicesForChoices($choices)); $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() 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'); $choices = array($this->choice1, $this->choice2, 'foobar');
$this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForChoices($choices)); $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() 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())); $this->assertSame(array(), $this->list->getIndicesForChoices(array()));
} }
public function testLegacyGetIndicesForValues() 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 and indices are always the same
$values = array($this->value1, $this->value2); $values = array($this->value1, $this->value2);
@ -211,7 +211,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase
public function testLegacyGetIndicesForValuesPreservesKeys() 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 and indices are always the same
$values = array(5 => $this->value1, 8 => $this->value2); $values = array(5 => $this->value1, 8 => $this->value2);
@ -220,7 +220,7 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase
public function testLegacyGetIndicesForValuesPreservesOrder() 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); $values = array($this->value2, $this->value1);
$this->assertSame(array($this->index2, $this->index1), $this->list->getIndicesForValues($values)); $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() 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'); $values = array($this->value1, $this->value2, 'foobar');
$this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForValues($values)); $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() 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())); $this->assertSame(array(), $this->list->getIndicesForValues(array()));
} }

View File

@ -59,7 +59,7 @@ class LazyChoiceListTest extends \PHPUnit_Framework_TestCase
public function testLegacyGetIndicesForChoices() public function testLegacyGetIndicesForChoices()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$choices = array('b', 'c'); $choices = array('b', 'c');
$this->assertSame(array(1, 2), $this->list->getIndicesForChoices($choices)); $this->assertSame(array(1, 2), $this->list->getIndicesForChoices($choices));
@ -67,7 +67,7 @@ class LazyChoiceListTest extends \PHPUnit_Framework_TestCase
public function testLegacyGetIndicesForValues() public function testLegacyGetIndicesForValues()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$values = array('b', 'c'); $values = array('b', 'c');
$this->assertSame(array(1, 2), $this->list->getIndicesForValues($values)); $this->assertSame(array(1, 2), $this->list->getIndicesForValues($values));

View File

@ -187,7 +187,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest
public function testLegacyGetIndicesForChoicesWithValuePath() public function testLegacyGetIndicesForChoicesWithValuePath()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->list = new ObjectChoiceList( $this->list = new ObjectChoiceList(
array($this->obj1, $this->obj2, $this->obj3, $this->obj4), array($this->obj1, $this->obj2, $this->obj3, $this->obj4),
@ -204,7 +204,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest
public function testLegacyGetIndicesForChoicesWithValuePathPreservesKeys() public function testLegacyGetIndicesForChoicesWithValuePathPreservesKeys()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->list = new ObjectChoiceList( $this->list = new ObjectChoiceList(
array($this->obj1, $this->obj2, $this->obj3, $this->obj4), array($this->obj1, $this->obj2, $this->obj3, $this->obj4),
@ -220,7 +220,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest
public function testLegacyGetIndicesForChoicesWithValuePathPreservesOrder() public function testLegacyGetIndicesForChoicesWithValuePathPreservesOrder()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->list = new ObjectChoiceList( $this->list = new ObjectChoiceList(
array($this->obj1, $this->obj2, $this->obj3, $this->obj4), array($this->obj1, $this->obj2, $this->obj3, $this->obj4),
@ -236,7 +236,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest
public function testLegacyGetIndicesForChoicesWithValuePathIgnoresNonExistingChoices() public function testLegacyGetIndicesForChoicesWithValuePathIgnoresNonExistingChoices()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->list = new ObjectChoiceList( $this->list = new ObjectChoiceList(
array($this->obj1, $this->obj2, $this->obj3, $this->obj4), array($this->obj1, $this->obj2, $this->obj3, $this->obj4),

View File

@ -17,7 +17,7 @@ class SimpleNumericChoiceListTest extends AbstractChoiceListTest
{ {
public function testLegacyGetIndicesForChoicesDealsWithNumericChoices() 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 // Pass choices as strings although they are integers
$choices = array('0', '1'); $choices = array('0', '1');
@ -26,7 +26,7 @@ class SimpleNumericChoiceListTest extends AbstractChoiceListTest
public function testLegacyGetIndicesForValuesDealsWithNumericValues() 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 // Pass values as strings although they are integers
$values = array('0', '1'); $values = array('0', '1');

View File

@ -598,7 +598,20 @@ class FormValidatorTest extends AbstractConstraintValidatorTest
private function getMockExecutionContext() 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;
} }
/** /**

View File

@ -19,7 +19,7 @@ class LegacyPdoSessionHandlerTest extends \PHPUnit_Framework_TestCase
protected function setUp() protected function setUp()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) { if (!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

@ -23,7 +23,7 @@ class LegacyOptionsTest extends \PHPUnit_Framework_TestCase
protected function setUp() protected function setUp()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->options = new OptionsResolver(); $this->options = new OptionsResolver();
} }

View File

@ -17,7 +17,7 @@ use Symfony\Component\Validator\Validation;
* @since 2.5.4 * @since 2.5.4
* @author Bernhard Schussek <bschussek@gmail.com> * @author Bernhard Schussek <bschussek@gmail.com>
*/ */
class LegacyUserPasswordValidatorLegacyApiTest extends UserPasswordValidatorTest class LegacyUserPasswordValidatorApiTest extends UserPasswordValidatorTest
{ {
protected function getApiVersion() protected function getApiVersion()
{ {

View File

@ -21,7 +21,7 @@ class LegacySecurityContextInterfaceTest extends \PHPUnit_Framework_TestCase
*/ */
public function testConstantSync() public function testConstantSync()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->assertSame(Security::ACCESS_DENIED_ERROR, SecurityContextInterface::ACCESS_DENIED_ERROR); $this->assertSame(Security::ACCESS_DENIED_ERROR, SecurityContextInterface::ACCESS_DENIED_ERROR);
$this->assertSame(Security::AUTHENTICATION_ERROR, SecurityContextInterface::AUTHENTICATION_ERROR); $this->assertSame(Security::AUTHENTICATION_ERROR, SecurityContextInterface::AUTHENTICATION_ERROR);

View File

@ -26,7 +26,7 @@ class LoaderTest extends \PHPUnit_Framework_TestCase
public function testLegacyGetSetDebugger() public function testLegacyGetSetDebugger()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$loader = new ProjectTemplateLoader4(); $loader = new ProjectTemplateLoader4();
$debugger = $this->getMock('Symfony\Component\Templating\DebuggerInterface'); $debugger = $this->getMock('Symfony\Component\Templating\DebuggerInterface');

View File

@ -53,6 +53,7 @@ class TraversalStrategy
* *
* @deprecated This constant was added for backwards compatibility only. * @deprecated This constant was added for backwards compatibility only.
* It will be removed in Symfony 3.0. * It will be removed in Symfony 3.0.
* @internal
*/ */
const STOP_RECURSION = 8; const STOP_RECURSION = 8;

View File

@ -60,7 +60,7 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa
protected function setUp() protected function setUp()
{ {
if (Validation::API_VERSION_2_5 !== $this->getApiVersion()) { 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'; $this->group = 'MyGroup';

View File

@ -38,7 +38,7 @@ class LegacyExecutionContextTest extends \PHPUnit_Framework_TestCase
protected function setUp() 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') $this->visitor = $this->getMockBuilder('Symfony\Component\Validator\ValidationVisitor')
->disableOriginalConstructor() ->disableOriginalConstructor()

View File

@ -17,7 +17,7 @@ class LegacyApcCacheTest extends \PHPUnit_Framework_TestCase
{ {
protected function setUp() 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')) { if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) {
$this->markTestSkipped('APC is not loaded.'); $this->markTestSkipped('APC is not loaded.');

View File

@ -21,7 +21,7 @@ class LegacyElementMetadataTest extends \PHPUnit_Framework_TestCase
protected function setUp() protected function setUp()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->metadata = new TestElementMetadata(); $this->metadata = new TestElementMetadata();
} }

View File

@ -636,7 +636,7 @@ abstract class Abstract2Dot5ApiTest extends AbstractValidatorTest
*/ */
public function testLegacyPropertyMetadataMustImplementPropertyMetadataInterface() public function testLegacyPropertyMetadataMustImplementPropertyMetadataInterface()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$entity = new Entity(); $entity = new Entity();

View File

@ -42,7 +42,7 @@ abstract class AbstractLegacyApiTest extends AbstractValidatorTest
protected function setUp() protected function setUp()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
parent::setUp(); parent::setUp();

View File

@ -843,7 +843,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase
*/ */
public function testLegacyValidatePropertyFailsIfPropertiesNotSupported() 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 does not implement PropertyMetadataContainerInterface
$metadata = $this->getMock('Symfony\Component\Validator\MetadataInterface'); $metadata = $this->getMock('Symfony\Component\Validator\MetadataInterface');
@ -975,7 +975,7 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase
*/ */
public function testLegacyValidatePropertyValueFailsIfPropertiesNotSupported() 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 does not implement PropertyMetadataContainerInterface
$metadata = $this->getMock('Symfony\Component\Validator\MetadataInterface'); $metadata = $this->getMock('Symfony\Component\Validator\MetadataInterface');

View File

@ -112,7 +112,7 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase
public function testLegacyDefaultApiVersion() public function testLegacyDefaultApiVersion()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
if (PHP_VERSION_ID < 50309) { if (PHP_VERSION_ID < 50309) {
// Old implementation on PHP < 5.3.9 // Old implementation on PHP < 5.3.9
@ -125,7 +125,7 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase
public function testLegacySetApiVersion24() 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->assertSame($this->builder, $this->builder->setApiVersion(Validation::API_VERSION_2_4));
$this->assertInstanceOf('Symfony\Component\Validator\Validator', $this->builder->getValidator()); $this->assertInstanceOf('Symfony\Component\Validator\Validator', $this->builder->getValidator());
@ -139,7 +139,7 @@ class ValidatorBuilderTest extends \PHPUnit_Framework_TestCase
public function testLegacySetApiVersion24And25() public function testLegacySetApiVersion24And25()
{ {
$this->iniSet('error_reporting', -1 & E_USER_DEPRECATED); $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
if (PHP_VERSION_ID < 50309) { if (PHP_VERSION_ID < 50309) {
$this->markTestSkipped('Not supported prior to PHP 5.3.9'); $this->markTestSkipped('Not supported prior to PHP 5.3.9');