public function testUserIsNotValid()
 {
     $this->setExpectedException('Symfony\\Component\\Validator\\Exception\\ConstraintDefinitionException');
     $user = $this->getMock('Foo\\Bar\\User');
     $encoderFactory = $this->getMock('Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactoryInterface');
     $securityContext = $this->createSecurityContext($user);
     $validator = new UserPasswordValidator($securityContext, $encoderFactory);
     $validator->initialize($this->context);
     $validator->validate('secret', new UserPassword());
 }
 public function __construct(SecurityContextInterface $securityContext, EncoderFactoryInterface $encoderFactory)
 {
     trigger_error('UserPasswordValidator class in Symfony\\Component\\Security\\Core\\Validator\\Constraint namespace is deprecated since version 2.2 and will be removed in 2.3. Use the Symfony\\Component\\Security\\Core\\Validator\\Constraints\\UserPasswordValidator class instead.', E_USER_DEPRECATED);
     parent::__construct($securityContext, $encoderFactory);
 }